diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-11-30 11:06:57 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-11-30 11:29:18 (GMT) |
commit | 0d09c6bfa5da53fedc794d6dc99f5675bdf59d49 (patch) | |
tree | 1066531735766690ee8c711ce938d3f9e14f7bf7 /tests/auto/moc/tst_moc.cpp | |
parent | 1d5621a4958ab6f250566c26f891d3e99c6f8585 (diff) | |
download | Qt-0d09c6bfa5da53fedc794d6dc99f5675bdf59d49.zip Qt-0d09c6bfa5da53fedc794d6dc99f5675bdf59d49.tar.gz Qt-0d09c6bfa5da53fedc794d6dc99f5675bdf59d49.tar.bz2 |
Do not recoginze templated types or pointers as flags.
Those types can never by flags.
This fixes QML as they do not use Q_DECLARE_METATYPE in a way visible to moc.
Patch by Aaron Kennedy
Reviewed-by: Kent Hansen
Diffstat (limited to 'tests/auto/moc/tst_moc.cpp')
-rw-r--r-- | tests/auto/moc/tst_moc.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp index 69d6ca7..2316ba2 100644 --- a/tests/auto/moc/tst_moc.cpp +++ b/tests/auto/moc/tst_moc.cpp @@ -489,7 +489,6 @@ private slots: void constructors(); void typenameWithUnsigned(); void warnOnVirtualSignal(); - signals: void sigWithUnsignedArg(unsigned foo); void sigWithSignedArg(signed foo); @@ -817,6 +816,8 @@ void tst_Moc::structQObject() #include "namespaced-flags.h" +Q_DECLARE_METATYPE(QList<Foo::Bar::Flags>); + void tst_Moc::namespacedFlags() { Foo::Baz baz; @@ -829,6 +830,12 @@ void tst_Moc::namespacedFlags() QVERIFY(v.isValid()); QVERIFY(baz.setProperty("flags", v)); QVERIFY(baz.flags() == bar.flags()); + + QList<Foo::Bar::Flags> l; + l << baz.flags(); + QVariant v2 = baz.setProperty("flagsList", QVariant::fromValue(l)); + QCOMPARE(l, baz.flagsList()); + QCOMPARE(l, qvariant_cast<QList<Foo::Bar::Flags> >(baz.property("flagsList"))); } void tst_Moc::warnOnMultipleInheritance() |