mirror of
https://github.com/mappu/miqt.git
synced 2025-01-09 17:01:06 +00:00
genbindings/typedefs: exclude typedefs from class pointer declarations
This commit is contained in:
parent
4ee89b157f
commit
5fa7bd37eb
@ -96,8 +96,8 @@ func parseHeader(topLevel []interface{}) (*CppParsedHeader, error) {
|
|||||||
if typ, ok := node["type"].(map[string]interface{}); ok {
|
if typ, ok := node["type"].(map[string]interface{}); ok {
|
||||||
if qualType, ok := typ["qualType"].(string); ok {
|
if qualType, ok := typ["qualType"].(string); ok {
|
||||||
ret.Typedefs = append(ret.Typedefs, CppTypedef{
|
ret.Typedefs = append(ret.Typedefs, CppTypedef{
|
||||||
Name: nodename,
|
Alias: nodename,
|
||||||
Typedef: qualType,
|
UnderlyingType: qualType,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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))
|
foundTypesList := make([]string, 0, len(foundTypes))
|
||||||
for ft := range foundTypes {
|
for ft := range foundTypes {
|
||||||
if strings.HasPrefix(ft, "QList<") {
|
if strings.HasPrefix(ft, "QList<") {
|
||||||
|
@ -109,8 +109,8 @@ type CppClass struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type CppTypedef struct {
|
type CppTypedef struct {
|
||||||
Name string
|
Alias string
|
||||||
Typedef string
|
UnderlyingType string
|
||||||
}
|
}
|
||||||
|
|
||||||
type CppParsedHeader struct {
|
type CppParsedHeader struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user