genbindings/typedefs: exclude typedefs from class pointer declarations

This commit is contained in:
mappu 2024-08-17 11:25:54 +12:00
parent 4ee89b157f
commit 5fa7bd37eb
3 changed files with 10 additions and 4 deletions

View File

@ -96,8 +96,8 @@ func parseHeader(topLevel []interface{}) (*CppParsedHeader, error) {
if typ, ok := node["type"].(map[string]interface{}); ok {
if qualType, ok := typ["qualType"].(string); ok {
ret.Typedefs = append(ret.Typedefs, CppTypedef{
Name: nodename,
Typedef: qualType,
Alias: nodename,
UnderlyingType: qualType,
})
}
}

View File

@ -239,6 +239,12 @@ func getReferencedTypes(src *CppParsedHeader) []string {
}
}
// Some types (e.g. QRgb) are found but are typedefs, not classes
for _, td := range src.Typedefs {
delete(foundTypes, td.Alias)
}
// Convert to sorted list
foundTypesList := make([]string, 0, len(foundTypes))
for ft := range foundTypes {
if strings.HasPrefix(ft, "QList<") {

View File

@ -109,8 +109,8 @@ type CppClass struct {
}
type CppTypedef struct {
Name string
Typedef string
Alias string
UnderlyingType string
}
type CppParsedHeader struct {