genbindings: move inheritance exceptions to config-allowlist

This commit is contained in:
mappu 2025-01-19 17:06:35 +13:00
parent 8705ac0b5c
commit d3319cf273
2 changed files with 10 additions and 2 deletions

View File

@ -195,6 +195,15 @@ func AllowSignal(mm CppMethod) bool {
}
}
func AllowInheritedParent(className string) bool {
// QItemSelection extends a QList<>, but we omit that from the inheritance hierarchy
if strings.HasPrefix(className, `QList<`) {
return false
}
return true
}
func AllowVirtual(mm CppMethod) bool {
if mm.MethodName == "metaObject" || mm.MethodName == "qt_metacast" {

View File

@ -532,9 +532,8 @@ func (c *CppClass) DirectInheritClassInfo() []lookupResultClass {
for _, inh := range c.DirectInherits {
cinfo, ok := KnownClassnames[inh]
if !ok {
if strings.HasPrefix(inh, `QList<`) {
if !AllowInheritedParent(inh) {
// OK, allow this one to slip through
// e.g. QItemSelection extends a QList<>
continue
} else {
panic("Class " + c.ClassName + " inherits from unknown class " + inh)