From e1cbcb4629d9308b4ac5dbb78aef1d9e2d5a5514 Mon Sep 17 00:00:00 2001 From: mappu Date: Fri, 15 Nov 2024 18:39:44 +1300 Subject: [PATCH] genbindings/qmap: fix not applying typedefs to inner types --- cmd/genbindings/transformtypedefs.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/cmd/genbindings/transformtypedefs.go b/cmd/genbindings/transformtypedefs.go index ea7884bc..b51ff170 100644 --- a/cmd/genbindings/transformtypedefs.go +++ b/cmd/genbindings/transformtypedefs.go @@ -29,6 +29,21 @@ func applyTypedefs(p CppParameter) CppParameter { p.QtCppOriginalType = &tmp } p.ParameterType = p.ParameterType[0:bpos] + `<` + t2.RenderTypeQtCpp() + `>` + + } else if kType, vType, ok := p.QMapOf(); ok { + kType2 := applyTypedefs(kType) + kType2.QtCppOriginalType = nil + + vType2 := applyTypedefs(vType) + vType2.QtCppOriginalType = nil + + bpos := strings.Index(p.ParameterType, `<`) + + if p.QtCppOriginalType == nil { + tmp := p // copy + p.QtCppOriginalType = &tmp + } + p.ParameterType = p.ParameterType[0:bpos] + `<` + kType2.RenderTypeQtCpp() + `, ` + vType2.RenderTypeQtCpp() + `>` } return p