summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools/moc/tst_moc.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-12-23 15:16:08 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-24 08:10:16 +0100
commit2b287c7c210ac708c0f8872e51517e0d46380ad3 (patch)
tree42a127faabe1318db2ef18cfdd7dc1ffc6ab58e5 /tests/auto/tools/moc/tst_moc.cpp
parentd776937df91e46536f404c6868d64016b6038d7b (diff)
Fix regression in property handling with enums from gadgets
When declaring a Q_PROPERTY(SomeType::SomeEnum foo ...) and SomeType is not a QObject but a gadget, then we must still include SomeType's meta object in the list of related meta objects. Task-number: QTBUG-35657 Change-Id: I46195140cb5d180c4f03bb1fe06a876e3fe11267 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'tests/auto/tools/moc/tst_moc.cpp')
-rw-r--r--tests/auto/tools/moc/tst_moc.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp
index 46f3e5a42a..e0e6129075 100644
--- a/tests/auto/tools/moc/tst_moc.cpp
+++ b/tests/auto/tools/moc/tst_moc.cpp
@@ -77,6 +77,7 @@
#include "parse-defines.h"
#include "related-metaobjects-in-namespaces.h"
+#include "related-metaobjects-in-gadget.h"
QT_USE_NAMESPACE
@@ -571,6 +572,7 @@ private slots:
void QTBUG32933_relatedObjectsDontIncludeItself();
void writeEnumFromUnrelatedClass();
void relatedMetaObjectsWithinNamespaces();
+ void relatedMetaObjectsInGadget();
signals:
void sigWithUnsignedArg(unsigned foo);
@@ -3162,6 +3164,15 @@ void tst_Moc::relatedMetaObjectsWithinNamespaces()
QVERIFY(testMo->d.relatedMetaObjects[0] == relatedMo);
}
+void tst_Moc::relatedMetaObjectsInGadget()
+{
+ const QMetaObject *relatedMo = &QTBUG_35657::A::staticMetaObject;
+
+ const QMetaObject *testMo = &QTBUG_35657::B::staticMetaObject;
+ QVERIFY(testMo->d.relatedMetaObjects);
+ QVERIFY(testMo->d.relatedMetaObjects[0] == relatedMo);
+}
+
QTEST_MAIN(tst_Moc)
// the generated code must compile with QT_NO_KEYWORDS