summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qmlconnection/tst_qmlconnection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/declarative/qmlconnection/tst_qmlconnection.cpp')
-rw-r--r--tests/auto/declarative/qmlconnection/tst_qmlconnection.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlconnection/tst_qmlconnection.cpp b/tests/auto/declarative/qmlconnection/tst_qmlconnection.cpp
index b21da48..3d9ee46 100644
--- a/tests/auto/declarative/qmlconnection/tst_qmlconnection.cpp
+++ b/tests/auto/declarative/qmlconnection/tst_qmlconnection.cpp
@@ -57,6 +57,7 @@ private slots:
void defaultValues();
void properties();
void connection();
+ void trimming();
private:
QmlEngine engine;
@@ -113,6 +114,26 @@ void tst_qmlconnection::connection()
delete item;
}
+void tst_qmlconnection::trimming()
+{
+ QmlEngine engine;
+ QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/trimming.qml"));
+ QmlGraphicsItem *item = qobject_cast<QmlGraphicsItem*>(c.create());
+
+ QVERIFY(item != 0);
+
+ QCOMPARE(item->property("tested").toString(), QString(""));
+ int index = item->metaObject()->indexOfSignal("testMe(int,QString)");
+ QMetaMethod method = item->metaObject()->method(index);
+ method.invoke(item,
+ Qt::DirectConnection,
+ Q_ARG(int, 5),
+ Q_ARG(QString, "worked"));
+ QCOMPARE(item->property("tested").toString(), QString("worked5"));
+
+ delete item;
+}
+
QTEST_MAIN(tst_qmlconnection)
#include "tst_qmlconnection.moc"