diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/tools/moc/tst_moc.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index af77e5c3ad..195361e007 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -547,7 +547,7 @@ private slots: void returnRefs(); void memberProperties_data(); void memberProperties(); - + void memberProperties2(); void privateSignalConnection(); void finalClasses_data(); void finalClasses(); @@ -1893,6 +1893,23 @@ void tst_Moc::memberProperties() } } +//this used to fail to compile +class ClassWithOneMember : public QObject { + Q_PROPERTY(int member MEMBER member) + Q_OBJECT +public: + int member; +}; + +void tst_Moc::memberProperties2() +{ + ClassWithOneMember o; + o.member = 442; + QCOMPARE(o.property("member").toInt(), 442); + QVERIFY(o.setProperty("member", 6666)); + QCOMPARE(o.member, 6666); +} + class SignalConnectionTester : public QObject { Q_OBJECT |