genbindings/qmap: fix not applying typedefs to inner types

This commit is contained in:
mappu 2024-11-15 18:39:44 +13:00
parent 598b8bdb89
commit e1cbcb4629

View File

@ -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