diff options
-rw-r--r-- | src/qml/qml/qqml.h | 4 | ||||
-rw-r--r-- | tests/auto/qml/qqmlproperty/interfaces.h | 8 | ||||
-rw-r--r-- | tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp | 11 |
3 files changed, 8 insertions, 15 deletions
diff --git a/src/qml/qml/qqml.h b/src/qml/qml/qqml.h index 7f0c81c514..bac8039251 100644 --- a/src/qml/qml/qqml.h +++ b/src/qml/qml/qqml.h @@ -151,6 +151,10 @@ template<typename T, typename... Args> \ friend void QML_REGISTER_TYPES_AND_REVISIONS(const char *uri, int versionMajor, QList<int> *); +#define QML_IMPLEMENTS_INTERFACES(INTERFACES) \ + Q_INTERFACES(INTERFACES) \ + enum class QmlIsInterface {yes = false}; + #define QML_UNAVAILABLE \ QML_FOREIGN(QQmlTypeNotAvailable) diff --git a/tests/auto/qml/qqmlproperty/interfaces.h b/tests/auto/qml/qqmlproperty/interfaces.h index f89b47efbe..bad5925c76 100644 --- a/tests/auto/qml/qqmlproperty/interfaces.h +++ b/tests/auto/qml/qqmlproperty/interfaces.h @@ -44,12 +44,12 @@ QT_END_NAMESPACE class A : public QObject, public Interface { Q_OBJECT - Q_INTERFACES(Interface) + QML_IMPLEMENTS_INTERFACES(Interface) }; class B : public QObject, Interface { Q_OBJECT - Q_INTERFACES(Interface) + QML_IMPLEMENTS_INTERFACES(Interface) }; class C : public QObject { @@ -74,13 +74,13 @@ class A2 : public QObject, public Interface2 { Q_OBJECT QML_ELEMENT - Q_INTERFACES(Interface2) + QML_IMPLEMENTS_INTERFACES(Interface2) }; class B2 : public QObject, Interface2 { Q_OBJECT QML_ELEMENT - Q_INTERFACES(Interface2) + QML_IMPLEMENTS_INTERFACES(Interface2) }; class C2 : public QObject { diff --git a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp index 10a4881579..7177089d7c 100644 --- a/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp +++ b/tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp @@ -2152,17 +2152,6 @@ void tst_qqmlproperty::interfaceBinding() qmlRegisterType<C>("io.qt.bugreports", 1, 0, "C"); qmlRegisterType<InterfaceConsumer>("io.qt.bugreports", 1, 0, "InterfaceConsumer"); - // Currently registration macros such as QML_ELEMENT are broken when there's multiple inheritance (QTBUG-88623) - // So these types have to be registered again. - // TODO: Fix QTBUG-88623 and remove this hack - qmlRegisterInterface<Interface2>("Interface2", 2); - qmlRegisterType<A2>("io.qt.bugreports", 2, 0, "A2"); - qmlRegisterType<A2>("io.qt.bugreports", 2, 0, "A2"); - qmlRegisterType<B2>("io.qt.bugreports", 2, 0, "B2"); - qmlRegisterType<C2>("io.qt.bugreports", 2, 0, "C2"); - qmlRegisterType<InterfaceConsumer2>("io.qt.bugreports", 2, 0, "InterfaceConsumer2"); - - const QVector<QUrl> urls = { testFileUrl("interfaceBinding.qml"), testFileUrl("interfaceBinding2.qml") |