Merge pull request #169 from mappu/miqt-fix-qt682

Qt 6.8.2 compatibility fix for QStringConverterBase
This commit is contained in:
mappu 2025-02-08 10:04:40 +13:00 committed by GitHub
commit b61e12fcc9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 18 additions and 22 deletions

View File

@ -394,6 +394,10 @@ nextMethod:
// an existing class instance // an existing class instance
mm.IsStatic = true mm.IsStatic = true
if !AllowCtor(ret.ClassName, mm) {
continue
}
ret.Ctors = append(ret.Ctors, mm) ret.Ctors = append(ret.Ctors, mm)
case "CXXDestructorDecl": case "CXXDestructorDecl":

View File

@ -321,6 +321,20 @@ func AllowMethod(className string, mm CppMethod) error {
return nil // OK, allow return nil // OK, allow
} }
func AllowCtor(className string, mm CppMethod) bool {
if className == `QStringConverterBase` {
// Both the main ctor and the copy constructor were changed from public to protected between 6.8.1 and 6.8.2
// @ref https://github.com/qt/qtbase/commit/41679e0b4398c0de38a8107642dc643fe2c3554f
// @ref https://github.com/mappu/miqt/issues/168
// Block both ctors from generation
return false
}
// Default allow
return true
}
// AllowType controls whether to permit binding of a method, if a method uses // AllowType controls whether to permit binding of a method, if a method uses
// this type in its parameter list or return type. // this type in its parameter list or return type.
// Any type not permitted by AllowClass is also not permitted by this method. // Any type not permitted by AllowClass is also not permitted by this method.

View File

@ -12,14 +12,6 @@ extern "C" {
} /* extern C */ } /* extern C */
#endif #endif
QStringConverterBase* QStringConverterBase_new(QStringConverterBase* param1) {
return new QStringConverterBase(*param1);
}
QStringConverterBase* QStringConverterBase_new2() {
return new QStringConverterBase();
}
void QStringConverter_virtbase(QStringConverter* src, QStringConverterBase** outptr_QStringConverterBase) { void QStringConverter_virtbase(QStringConverter* src, QStringConverterBase** outptr_QStringConverterBase) {
*outptr_QStringConverterBase = static_cast<QStringConverterBase*>(src); *outptr_QStringConverterBase = static_cast<QStringConverterBase*>(src);
} }

View File

@ -71,18 +71,6 @@ func UnsafeNewQStringConverterBase(h unsafe.Pointer) *QStringConverterBase {
return newQStringConverterBase((*C.QStringConverterBase)(h)) return newQStringConverterBase((*C.QStringConverterBase)(h))
} }
// NewQStringConverterBase constructs a new QStringConverterBase object.
func NewQStringConverterBase(param1 *QStringConverterBase) *QStringConverterBase {
return newQStringConverterBase(C.QStringConverterBase_new(param1.cPointer()))
}
// NewQStringConverterBase2 constructs a new QStringConverterBase object.
func NewQStringConverterBase2() *QStringConverterBase {
return newQStringConverterBase(C.QStringConverterBase_new2())
}
type QStringConverter struct { type QStringConverter struct {
h *C.QStringConverter h *C.QStringConverter
*QStringConverterBase *QStringConverterBase

View File

@ -28,8 +28,6 @@ typedef struct QStringConverterBase QStringConverterBase;
typedef struct QStringConverterBase__State QStringConverterBase__State; typedef struct QStringConverterBase__State QStringConverterBase__State;
#endif #endif
QStringConverterBase* QStringConverterBase_new(QStringConverterBase* param1);
QStringConverterBase* QStringConverterBase_new2();
void QStringConverter_virtbase(QStringConverter* src, QStringConverterBase** outptr_QStringConverterBase); void QStringConverter_virtbase(QStringConverter* src, QStringConverterBase** outptr_QStringConverterBase);
bool QStringConverter_isValid(const QStringConverter* self); bool QStringConverter_isValid(const QStringConverter* self);