genbindings: add WId->uintptr typedef for QWidget.h

This commit is contained in:
mappu 2024-08-11 16:54:23 +12:00
parent 08168454c1
commit 027c059b0b
3 changed files with 7 additions and 0 deletions

View File

@ -364,6 +364,9 @@ func parseSingleTypeString(p string) CppParameter {
} else if tok == "qreal" {
// Transform typedef
insert.ParameterType += " double"
} else if tok == "WId" {
// Transform typedef
insert.ParameterType += " uintptr_t"
} else {
// Valid part of the type name
insert.ParameterType += " " + tok

View File

@ -140,6 +140,7 @@ func emitBindingHeader(src *CppParsedHeader, filename string) (string, error) {
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"

View File

@ -14,6 +14,9 @@ func (p CppParameter) RenderTypeGo() string {
if p.ParameterType == "QString" {
return "string"
}
if p.ParameterType == "uintptr_t" {
return "uintptr"
}
if t, ok := p.QListOf(); ok {
return "[]" + t.RenderTypeGo()