genbindings: misc fixes

This commit is contained in:
mappu 2024-08-28 18:47:44 +12:00
parent 56395eaa7a
commit 8da51d61f5
3 changed files with 8 additions and 4 deletions

View File

@ -166,6 +166,12 @@ func processClassType(node map[string]interface{}, addNamePrefix string) (CppCla
return CppClass{}, ErrNoContent // errors.New("node has no name")
}
nodename = addNamePrefix + nodename
// Hacks:
if nodename == "FromBase64Result" {
nodename = "QByteArray::FromBase64Result"
}
ret.ClassName = nodename
log.Printf("-> Processing class %q...\n", nodename)

View File

@ -594,6 +594,7 @@ extern "C" {
nonConst.Const = false
nonConst.ByRef = false
nonConst.Pointer = true
nonConst.PointerCount = 1
afterCall += "\treturn const_cast<" + nonConst.RenderTypeQtCpp() + ">(&ret);\n"
} else {
afterCall += "\treturn &ret;\n"

View File

@ -17,10 +17,7 @@ func TestTransformTypedefs(t *testing.T) {
CppMethod{
Parameters: []CppParameter{
CppParameter{
ParameterName: "foo",
ParameterType: typeName,
},
parseSingleTypeString(typeName),
},
IsStatic: true,
},