genbindings: fixes for QStrings

This commit is contained in:
mappu 2024-08-29 17:17:12 +12:00
parent 050d668765
commit 97a56647b7
2 changed files with 11 additions and 0 deletions

View File

@ -472,6 +472,13 @@ func emitBindingCpp(src *CppParsedHeader, filename string) (string, error) {
continue
}
if ref == "QString" {
ret.WriteString("#include <QString>\n")
ret.WriteString("#include <QByteArray>\n")
ret.WriteString("#include <cstring>\n")
continue
}
if strings.Contains(ref, `::`) {
ret.WriteString(`#define WORKAROUND_INNER_CLASS_DEFINITION_` + cabiClassName(ref) + "\n")
continue

View File

@ -90,6 +90,10 @@ func (p CppParameter) QtClassType() bool {
return true
}
if p.ParameterType == "QString" {
return true
}
return false
}