summaryrefslogtreecommitdiffstats
path: root/tests/auto/qmetaobject/tst_qmetaobject.cpp
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-03-05 03:56:47 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-03-05 03:56:47 (GMT)
commit0c558e05f880cb51078b2d5e5281227352c1de3f (patch)
tree809e95ab06fc5d757c1d66493de5c9376866aee1 /tests/auto/qmetaobject/tst_qmetaobject.cpp
parentaf81ea8a5abbd9a94eb6ab5c3fe0425779905d5a (diff)
parent48fd47f64f3f73e82016161d82cdf67908a9c653 (diff)
downloadQt-0c558e05f880cb51078b2d5e5281227352c1de3f.zip
Qt-0c558e05f880cb51078b2d5e5281227352c1de3f.tar.gz
Qt-0c558e05f880cb51078b2d5e5281227352c1de3f.tar.bz2
Merge branch '4.7' of git@scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'tests/auto/qmetaobject/tst_qmetaobject.cpp')
-rw-r--r--tests/auto/qmetaobject/tst_qmetaobject.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qmetaobject/tst_qmetaobject.cpp b/tests/auto/qmetaobject/tst_qmetaobject.cpp
index bd54975..bb4a0d2 100644
--- a/tests/auto/qmetaobject/tst_qmetaobject.cpp
+++ b/tests/auto/qmetaobject/tst_qmetaobject.cpp
@@ -157,6 +157,7 @@ private slots:
void invokeQueuedMetaMember();
void invokeCustomTypes();
void invokeMetaConstructor();
+ void invokeTypedefTypes();
void qtMetaObjectInheritance();
void normalizedSignature_data();
void normalizedSignature();
@@ -598,6 +599,8 @@ struct MyType
int i1, i2, i3;
};
+typedef QString CustomString;
+
class QtTestCustomObject: public QObject
{
Q_OBJECT
@@ -607,6 +610,9 @@ public:
public slots:
void sl1(MyType myType);
+signals:
+ void sig_custom(const CustomString &string);
+
public:
int sum;
};
@@ -664,6 +670,20 @@ void tst_QMetaObject::invokeMetaConstructor()
}
}
+void tst_QMetaObject::invokeTypedefTypes()
+{
+ qRegisterMetaType<CustomString>("CustomString");
+ QtTestCustomObject obj;
+ QSignalSpy spy(&obj, SIGNAL(sig_custom(CustomString)));
+
+ QCOMPARE(spy.count(), 0);
+ CustomString arg("hello");
+ QVERIFY(QMetaObject::invokeMethod(&obj, "sig_custom", Q_ARG(CustomString, arg)));
+ QCOMPARE(spy.count(), 1);
+ QCOMPARE(spy.at(0).count(), 1);
+ QCOMPARE(spy.at(0).at(0), QVariant(arg));
+}
+
void tst_QMetaObject::normalizedSignature_data()
{
QTest::addColumn<QString>("signature");