diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-01-14 04:03:39 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-01-14 04:03:39 (GMT) |
commit | 93512cc3a615e91a5ef9ed96361d93cc13d7fb6e (patch) | |
tree | 993d3e1b357e1991a05c170436820169b0fea322 /tests/auto/declarative | |
parent | 57d7eef906df1ed82b9722e93cb58420460684ed (diff) | |
download | Qt-93512cc3a615e91a5ef9ed96361d93cc13d7fb6e.zip Qt-93512cc3a615e91a5ef9ed96361d93cc13d7fb6e.tar.gz Qt-93512cc3a615e91a5ef9ed96361d93cc13d7fb6e.tar.bz2 |
compile
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r-- | tests/auto/declarative/anchors/tst_anchors.cpp | 3 | ||||
-rw-r--r-- | tests/auto/declarative/qmltimer/tst_qmltimer.cpp | 24 |
2 files changed, 18 insertions, 9 deletions
diff --git a/tests/auto/declarative/anchors/tst_anchors.cpp b/tests/auto/declarative/anchors/tst_anchors.cpp index 4a51861..9e8024b 100644 --- a/tests/auto/declarative/anchors/tst_anchors.cpp +++ b/tests/auto/declarative/anchors/tst_anchors.cpp @@ -207,7 +207,8 @@ void tst_anchors::illegalSets() QTest::ignoreMessage(QtWarningMsg, warning.toLatin1()); QmlEngine engine; - QmlComponent component(&engine, QByteArray("import Qt 4.6\n" + qml.toUtf8()), QUrl("file://")); + QmlComponent component(&engine); + component.setData(QByteArray("import Qt 4.6\n" + qml.toUtf8()), QUrl("file://")); if (!component.isReady()) qWarning() << "Test errors:" << component.errors(); QVERIFY(component.isReady()); diff --git a/tests/auto/declarative/qmltimer/tst_qmltimer.cpp b/tests/auto/declarative/qmltimer/tst_qmltimer.cpp index d681fbb..7191e85 100644 --- a/tests/auto/declarative/qmltimer/tst_qmltimer.cpp +++ b/tests/auto/declarative/qmltimer/tst_qmltimer.cpp @@ -91,7 +91,8 @@ tst_qmltimer::tst_qmltimer() void tst_qmltimer::notRepeating() { QmlEngine engine; - QmlComponent component(&engine, QByteArray("import Qt 4.6\nTimer { interval: 100; running: true }"), QUrl("file://")); + QmlComponent component(&engine); + component.setData(QByteArray("import Qt 4.6\nTimer { interval: 100; running: true }"), QUrl("file://")); QmlTimer *timer = qobject_cast<QmlTimer*>(component.create()); QVERIFY(timer != 0); QVERIFY(timer->isRunning()); @@ -111,7 +112,8 @@ void tst_qmltimer::notRepeating() void tst_qmltimer::notRepeatingStart() { QmlEngine engine; - QmlComponent component(&engine, QByteArray("import Qt 4.6\nTimer { interval: 100 }"), QUrl("file://")); + QmlComponent component(&engine); + component.setData(QByteArray("import Qt 4.6\nTimer { interval: 100 }"), QUrl("file://")); QmlTimer *timer = qobject_cast<QmlTimer*>(component.create()); QVERIFY(timer != 0); QVERIFY(!timer->isRunning()); @@ -135,7 +137,8 @@ void tst_qmltimer::notRepeatingStart() void tst_qmltimer::repeat() { QmlEngine engine; - QmlComponent component(&engine, QByteArray("import Qt 4.6\nTimer { interval: 100; repeat: true; running: true }"), QUrl("file://")); + QmlComponent component(&engine); + component.setData(QByteArray("import Qt 4.6\nTimer { interval: 100; repeat: true; running: true }"), QUrl("file://")); QmlTimer *timer = qobject_cast<QmlTimer*>(component.create()); QVERIFY(timer != 0); @@ -164,7 +167,8 @@ void tst_qmltimer::repeat() void tst_qmltimer::triggeredOnStart() { QmlEngine engine; - QmlComponent component(&engine, QByteArray("import Qt 4.6\nTimer { interval: 100; running: true; triggeredOnStart: true }"), QUrl("file://")); + QmlComponent component(&engine); + component.setData(QByteArray("import Qt 4.6\nTimer { interval: 100; running: true; triggeredOnStart: true }"), QUrl("file://")); QmlTimer *timer = qobject_cast<QmlTimer*>(component.create()); QVERIFY(timer != 0); QVERIFY(timer->triggeredOnStart()); @@ -186,7 +190,8 @@ void tst_qmltimer::triggeredOnStart() void tst_qmltimer::triggeredOnStartRepeat() { QmlEngine engine; - QmlComponent component(&engine, QByteArray("import Qt 4.6\nTimer { interval: 100; running: true; triggeredOnStart: true; repeat: true }"), QUrl("file://")); + QmlComponent component(&engine); + component.setData(QByteArray("import Qt 4.6\nTimer { interval: 100; running: true; triggeredOnStart: true; repeat: true }"), QUrl("file://")); QmlTimer *timer = qobject_cast<QmlTimer*>(component.create()); QVERIFY(timer != 0); @@ -208,7 +213,8 @@ void tst_qmltimer::triggeredOnStartRepeat() void tst_qmltimer::noTriggerIfNotRunning() { QmlEngine engine; - QmlComponent component(&engine, QByteArray( + QmlComponent component(&engine); + component.setData(QByteArray( "import Qt 4.6\n" "Item { property bool ok: true\n" "Timer { id: t1; interval: 100; repeat: true; running: true; onTriggered: if (!running) ok=false }" @@ -226,7 +232,8 @@ void tst_qmltimer::noTriggerIfNotRunning() void tst_qmltimer::changeDuration() { QmlEngine engine; - QmlComponent component(&engine, QByteArray("import Qt 4.6\nTimer { interval: 200; repeat: true; running: true }"), QUrl("file://")); + QmlComponent component(&engine); + component.setData(QByteArray("import Qt 4.6\nTimer { interval: 200; repeat: true; running: true }"), QUrl("file://")); QmlTimer *timer = qobject_cast<QmlTimer*>(component.create()); QVERIFY(timer != 0); @@ -249,7 +256,8 @@ void tst_qmltimer::changeDuration() void tst_qmltimer::restart() { QmlEngine engine; - QmlComponent component(&engine, QByteArray("import Qt 4.6\nTimer { interval: 500; repeat: true; running: true }"), QUrl("file://")); + QmlComponent component(&engine); + component.setData(QByteArray("import Qt 4.6\nTimer { interval: 500; repeat: true; running: true }"), QUrl("file://")); QmlTimer *timer = qobject_cast<QmlTimer*>(component.create()); QVERIFY(timer != 0); |