summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBill King <bill.king@nokia.com>2009-12-17 00:48:18 (GMT)
committerBill King <bill.king@nokia.com>2009-12-17 00:48:18 (GMT)
commitc7d3627141c5d92f18ee18f22d70cdd60415ac15 (patch)
treeb2d08c43eb8542b11eae9df30e99622770473af2 /tests
parentb1bec6c5fe862d603ef07ef682d3c813e1b9ff4c (diff)
parent0414a73942272d8e863e464b3fbffeb9982964c1 (diff)
downloadQt-c7d3627141c5d92f18ee18f22d70cdd60415ac15.zip
Qt-c7d3627141c5d92f18ee18f22d70cdd60415ac15.tar.gz
Qt-c7d3627141c5d92f18ee18f22d70cdd60415ac15.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/moc/tst_moc.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp
index 2316ba2..1ca2b3a 100644
--- a/tests/auto/moc/tst_moc.cpp
+++ b/tests/auto/moc/tst_moc.cpp
@@ -489,6 +489,7 @@ private slots:
void constructors();
void typenameWithUnsigned();
void warnOnVirtualSignal();
+ void QTBUG5590_dummyProperty();
signals:
void sigWithUnsignedArg(unsigned foo);
void sigWithSignedArg(signed foo);
@@ -1216,6 +1217,40 @@ void tst_Moc::warnOnVirtualSignal()
#endif
}
+
+class QTBUG5590_DummyObject: public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(bool dummy)
+};
+
+class QTBUG5590_PropertyObject: public QTBUG5590_DummyObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int value READ value WRITE setValue)
+ Q_PROPERTY(int value2 READ value2 WRITE setValue2)
+
+ public:
+ QTBUG5590_PropertyObject() : m_value(85), m_value2(40) { }
+ int value() const { return m_value; }
+ void setValue(int value) { m_value = value; }
+ int value2() const { return m_value2; }
+ void setValue2(int value) { m_value2 = value; }
+ private:
+ int m_value, m_value2;
+};
+
+void tst_Moc::QTBUG5590_dummyProperty()
+{
+ QTBUG5590_PropertyObject o;
+ QCOMPARE(o.property("value").toInt(), 85);
+ QCOMPARE(o.property("value2").toInt(), 40);
+ o.setProperty("value", 32);
+ QCOMPARE(o.value(), 32);
+ o.setProperty("value2", 82);
+ QCOMPARE(o.value2(), 82);
+}
+
QTEST_APPLESS_MAIN(tst_Moc)
#include "tst_moc.moc"