aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2020-11-19 15:36:03 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-11-23 09:06:06 +0000
commit62625e243558d9f4203596dad1c01b6a65cf7e8f (patch)
tree123291f58d259b14603372fede1afc06c1c1ae28 /tests
parentea55537d8153195cfd11fd510abce4584c599db0 (diff)
qqml.h: Add QML_IMPLEMENTS_INTERFACES
Needed in order to allow for the declarative registration of classes implementing interfaces. Fixes: QTBUG-88623 Change-Id: Id9c1ae92774dd9c316ceaa737cb48ef28f56545c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit 87533900738d65ad278722b292852c998e987c10) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qqmlproperty/interfaces.h8
-rw-r--r--tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp11
2 files changed, 4 insertions, 15 deletions
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")