summaryrefslogtreecommitdiffstats
path: root/tests/auto/moc
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-03-29 09:01:48 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2011-03-31 14:32:45 (GMT)
commita1a141e4af6226dca9ae67c51dd5e14cb3393772 (patch)
tree6b4ba52827c25f6bd06ea5b2b7b067968c634cc9 /tests/auto/moc
parentbc3491c1b85ca36486c9472ecf7ba82f46699e8a (diff)
downloadQt-a1a141e4af6226dca9ae67c51dd5e14cb3393772.zip
Qt-a1a141e4af6226dca9ae67c51dd5e14cb3393772.tar.gz
Qt-a1a141e4af6226dca9ae67c51dd5e14cb3393772.tar.bz2
moc: be able to compile if there are private classes
Reviewed-by: brad Reviewed-by: thiago
Diffstat (limited to 'tests/auto/moc')
-rw-r--r--tests/auto/moc/tst_moc.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp
index 203f0ae..7a8f958 100644
--- a/tests/auto/moc/tst_moc.cpp
+++ b/tests/auto/moc/tst_moc.cpp
@@ -497,7 +497,7 @@ private slots:
void revisions();
void warnings_data();
void warnings();
-
+ void privateClass();
signals:
void sigWithUnsignedArg(unsigned foo);
@@ -517,6 +517,7 @@ private:
private:
QString qtIncludePath;
+ class PrivateClass;
};
void tst_Moc::initTestCase()
@@ -1648,6 +1649,25 @@ void tst_Moc::warnings()
}
+class tst_Moc::PrivateClass : public QObject {
+ Q_PROPERTY(int someProperty READ someSlot WRITE someSlot2)
+Q_OBJECT
+Q_SIGNALS:
+ void someSignal();
+public Q_SLOTS:
+ int someSlot() { return 1; }
+ void someSlot2(int) {}
+public:
+ Q_INVOKABLE PrivateClass() {}
+};
+
+void tst_Moc::privateClass()
+{
+ QVERIFY(PrivateClass::staticMetaObject.indexOfConstructor("PrivateClass()") == 0);
+ QVERIFY(PrivateClass::staticMetaObject.indexOfSignal("someSignal()") > 0);
+}
+
+
QTEST_APPLESS_MAIN(tst_Moc)
#include "tst_moc.moc"