genbindings: bind QVector<T> as []T, like QList

This commit is contained in:
mappu 2024-08-17 11:29:31 +12:00
parent a579f80d34
commit b87c5998b1
2 changed files with 5 additions and 1 deletions

View File

@ -252,7 +252,7 @@ func getReferencedTypes(src *CppParsedHeader) []string {
// Convert to sorted list
foundTypesList := make([]string, 0, len(foundTypes))
for ft := range foundTypes {
if strings.HasPrefix(ft, "QList<") {
if strings.HasPrefix(ft, "QList<") || strings.HasPrefix(ft, "QVector<") {
continue
}
if ft == "QRgb" {

View File

@ -22,6 +22,10 @@ func (p CppParameter) QListOf() (CppParameter, bool) {
return parseSingleTypeString(p.ParameterType[6 : len(p.ParameterType)-1]), true
}
if strings.HasPrefix(p.ParameterType, "QVector<") && strings.HasSuffix(p.ParameterType, `>`) {
return parseSingleTypeString(p.ParameterType[8 : len(p.ParameterType)-1]), true
}
return CppParameter{}, false
}