diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-02-26 07:04:38 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-02-26 07:04:38 (GMT) |
commit | e1f33f2e4689a59de2814ffdea7ea246bbfe0283 (patch) | |
tree | e3a0d74f5e54f78b83d0c05d6e1588c5f1d47e37 /tests/auto/declarative/qdeclarativeconnection | |
parent | 93b02976b7c9c3a36cac475c1935622ebc2f1fe1 (diff) | |
download | Qt-e1f33f2e4689a59de2814ffdea7ea246bbfe0283.zip Qt-e1f33f2e4689a59de2814ffdea7ea246bbfe0283.tar.gz Qt-e1f33f2e4689a59de2814ffdea7ea246bbfe0283.tar.bz2 |
Change Connection syntax as per QT-2822.
Diffstat (limited to 'tests/auto/declarative/qdeclarativeconnection')
5 files changed, 8 insertions, 12 deletions
diff --git a/tests/auto/declarative/qdeclarativeconnection/data/test-connection.qml b/tests/auto/declarative/qdeclarativeconnection/data/test-connection.qml index 9534621..81ab599 100644 --- a/tests/auto/declarative/qdeclarativeconnection/data/test-connection.qml +++ b/tests/auto/declarative/qdeclarativeconnection/data/test-connection.qml @@ -6,5 +6,5 @@ Item { property bool tested: false signal testMe - Connection { sender: screen; signal: "widthChanged()"; script: screen.tested = true } + Connections { target: screen; onWidthChanged: screen.tested = true } } diff --git a/tests/auto/declarative/qdeclarativeconnection/data/test-connection2.qml b/tests/auto/declarative/qdeclarativeconnection/data/test-connection2.qml index 65fe23a..22e9422 100644 --- a/tests/auto/declarative/qdeclarativeconnection/data/test-connection2.qml +++ b/tests/auto/declarative/qdeclarativeconnection/data/test-connection2.qml @@ -1,3 +1,3 @@ import Qt 4.6 -Connection { id: connection; sender: connection; signal: "widthChanged()"; script: 1 == 1 } +Connections { id: connection; target: connection; onTargetChanged: 1 == 1 } diff --git a/tests/auto/declarative/qdeclarativeconnection/data/test-connection3.qml b/tests/auto/declarative/qdeclarativeconnection/data/test-connection3.qml index 32133f9..6e396c0 100644 --- a/tests/auto/declarative/qdeclarativeconnection/data/test-connection3.qml +++ b/tests/auto/declarative/qdeclarativeconnection/data/test-connection3.qml @@ -1,3 +1,3 @@ import Qt 4.6 -Connection {} +Connections {} diff --git a/tests/auto/declarative/qdeclarativeconnection/data/trimming.qml b/tests/auto/declarative/qdeclarativeconnection/data/trimming.qml index c27dc46..736d5e8 100644 --- a/tests/auto/declarative/qdeclarativeconnection/data/trimming.qml +++ b/tests/auto/declarative/qdeclarativeconnection/data/trimming.qml @@ -6,5 +6,5 @@ Item { property string tested signal testMe(int param1, string param2) - Connection { sender: screen; signal: "testMe(param1, param2)"; script: screen.tested = param2 + param1 } + Connections { target: screen; onTestMe: screen.tested = param2 + param1 } } diff --git a/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp b/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp index adf343f..f10217c 100644 --- a/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp +++ b/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp @@ -71,12 +71,10 @@ void tst_qdeclarativeconnection::defaultValues() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-connection3.qml")); - QDeclarativeConnection *item = qobject_cast<QDeclarativeConnection*>(c.create()); + QDeclarativeConnections *item = qobject_cast<QDeclarativeConnections*>(c.create()); QVERIFY(item != 0); - QVERIFY(item->signalSender() == 0); - QCOMPARE(item->script().script(), QString()); - QCOMPARE(item->signal(), QString()); + QVERIFY(item->target() == 0); delete item; } @@ -85,14 +83,12 @@ void tst_qdeclarativeconnection::properties() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(SRCDIR "/data/test-connection2.qml")); - QDeclarativeConnection *item = qobject_cast<QDeclarativeConnection*>(c.create()); + QDeclarativeConnections *item = qobject_cast<QDeclarativeConnections*>(c.create()); QVERIFY(item != 0); QVERIFY(item != 0); - QVERIFY(item->signalSender() == item); - QCOMPARE(item->script().script(), QString("1 == 1")); - QCOMPARE(item->signal(), QString("widthChanged()")); + QVERIFY(item->target() == item); delete item; } |