genbindings: move QAccessibleWidget hack into standard config

This commit is contained in:
mappu 2024-11-23 18:05:15 +13:00
parent 45db3c6bb1
commit f45604ee13
2 changed files with 19 additions and 10 deletions

View File

@ -196,6 +196,24 @@ func AllowVirtual(mm CppMethod) bool {
return true // AllowSignal(mm)
}
func AllowVirtualForClass(className string) bool {
// Allowing the subclassing of QAccessibleWidget compiles fine,
// but, always gives a linker error:
//
// /usr/lib/go-1.19/pkg/tool/linux_amd64/link: running g++ failed: exit status 1
// /usr/bin/ld: /tmp/go-link-1745036494/000362.o: in function `MiqtVirtualQAccessibleWidget::MiqtVirtualQAccessibleWidget(QWidget*)':
// undefined reference to `vtable for MiqtVirtualQAccessibleWidget'
//
// An undefined vtable usually indicates that the virtual class is missing
// definitions for some virtual methods, but AFAICT we have complete coverage.
if className == "QAccessibleWidget" {
return false
}
return true
}
func AllowMethod(className string, mm CppMethod) error {
for _, p := range mm.Parameters {

View File

@ -413,16 +413,7 @@ func (c *CppClass) VirtualMethods() []CppMethod {
return nil
}
// FIXME Allowing the subclassing of QAccessibleWidget compiles fine,
// but, always gives a linker error:
//
// /usr/lib/go-1.19/pkg/tool/linux_amd64/link: running g++ failed: exit status 1
// /usr/bin/ld: /tmp/go-link-1745036494/000362.o: in function `MiqtVirtualQAccessibleWidget::MiqtVirtualQAccessibleWidget(QWidget*)':
// undefined reference to `vtable for MiqtVirtualQAccessibleWidget'
//
// An undefined vtable usually indicates that the virtual class is missing
// definitions for some virtual methods, but AFAICT we have complete coverage.
if c.ClassName == "QAccessibleWidget" {
if !AllowVirtualForClass(c.ClassName) {
return nil
}