diff options
Diffstat (limited to 'tests/auto/declarative')
20 files changed, 1102 insertions, 132 deletions
diff --git a/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp b/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp index 1001278..da15a85 100644 --- a/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp +++ b/tests/auto/declarative/qdeclarativeanimatedimage/tst_qdeclarativeanimatedimage.cpp @@ -47,22 +47,13 @@ #include <private/qdeclarativeanimatedimage_p.h> #include "../shared/testhttpserver.h" +#include "../../../shared/util.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir #define SRCDIR "." #endif -#define TRY_WAIT(expr) \ - do { \ - for (int ii = 0; ii < 6; ++ii) { \ - if ((expr)) break; \ - QTest::qWait(50); \ - } \ - QVERIFY((expr)); \ - } while (false) - - class tst_qdeclarativeanimatedimage : public QObject { Q_OBJECT @@ -152,14 +143,14 @@ void tst_qdeclarativeanimatedimage::remote() QDeclarativeEngine engine; QDeclarativeComponent component(&engine, QUrl("http://127.0.0.1:14449/" + fileName)); - TRY_WAIT(component.isReady()); + QTRY_VERIFY(component.isReady()); QDeclarativeAnimatedImage *anim = qobject_cast<QDeclarativeAnimatedImage *>(component.create()); QVERIFY(anim); - TRY_WAIT(anim->isPlaying()); + QTRY_VERIFY(anim->isPlaying()); if (paused) { - TRY_WAIT(anim->isPaused()); + QTRY_VERIFY(anim->isPaused()); QCOMPARE(anim->currentFrame(), 2); } QVERIFY(anim->status() != QDeclarativeAnimatedImage::Error); diff --git a/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp b/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp index 1b73cf7..c77d395 100644 --- a/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp +++ b/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp @@ -53,6 +53,7 @@ #include <QtDeclarative/qdeclarativecontext.h> #include "../shared/testhttpserver.h" +#include "../../../shared/util.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir @@ -62,16 +63,6 @@ #define SERVER_PORT 14446 #define SERVER_ADDR "http://127.0.0.1:14446" -#define TRY_WAIT(expr) \ - do { \ - for (int ii = 0; ii < 60; ++ii) { \ - if ((expr)) break; \ - QTest::qWait(50); \ - } \ - QVERIFY((expr)); \ - } while (false) - - class tst_qdeclarativeborderimage : public QObject { @@ -154,18 +145,18 @@ void tst_qdeclarativeborderimage::imageSource() QVERIFY(obj != 0); if (remote) - TRY_WAIT(obj->status() == QDeclarativeBorderImage::Loading); + QTRY_VERIFY(obj->status() == QDeclarativeBorderImage::Loading); QCOMPARE(obj->source(), remote ? source : QUrl(source)); if (error.isEmpty()) { - TRY_WAIT(obj->status() == QDeclarativeBorderImage::Ready); + QTRY_VERIFY(obj->status() == QDeclarativeBorderImage::Ready); QCOMPARE(obj->width(), 120.); QCOMPARE(obj->height(), 120.); QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Stretch); QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Stretch); } else { - TRY_WAIT(obj->status() == QDeclarativeBorderImage::Error); + QTRY_VERIFY(obj->status() == QDeclarativeBorderImage::Error); } delete obj; @@ -273,14 +264,14 @@ void tst_qdeclarativeborderimage::sciSource() QVERIFY(obj != 0); if (remote) - TRY_WAIT(obj->status() == QDeclarativeBorderImage::Loading); + QTRY_VERIFY(obj->status() == QDeclarativeBorderImage::Loading); QCOMPARE(obj->source(), remote ? source : QUrl(source)); QCOMPARE(obj->width(), 300.); QCOMPARE(obj->height(), 300.); if (valid) { - TRY_WAIT(obj->status() == QDeclarativeBorderImage::Ready); + QTRY_VERIFY(obj->status() == QDeclarativeBorderImage::Ready); QCOMPARE(obj->border()->left(), 10); QCOMPARE(obj->border()->top(), 20); QCOMPARE(obj->border()->right(), 30); @@ -288,7 +279,7 @@ void tst_qdeclarativeborderimage::sciSource() QCOMPARE(obj->horizontalTileMode(), QDeclarativeBorderImage::Round); QCOMPARE(obj->verticalTileMode(), QDeclarativeBorderImage::Repeat); } else { - TRY_WAIT(obj->status() == QDeclarativeBorderImage::Error); + QTRY_VERIFY(obj->status() == QDeclarativeBorderImage::Error); } delete obj; diff --git a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp index 33bf7ea..c10a110 100644 --- a/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp +++ b/tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp @@ -52,6 +52,7 @@ #include <private/qdeclarativeglobalscriptclass_p.h> #include "testtypes.h" #include "testhttpserver.h" +#include "../../../shared/util.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir @@ -2416,15 +2417,6 @@ void tst_qdeclarativeecmascript::function() delete o; } -#define TRY_WAIT(expr) \ - do { \ - for (int ii = 0; ii < 6; ++ii) { \ - if ((expr)) break; \ - QTest::qWait(50); \ - } \ - QVERIFY((expr)); \ - } while (false) - // Test the "Qt.include" method void tst_qdeclarativeecmascript::include() { @@ -2496,8 +2488,8 @@ void tst_qdeclarativeecmascript::include() QObject *o = component.create(); QVERIFY(o != 0); - TRY_WAIT(o->property("done").toBool() == true); - TRY_WAIT(o->property("done2").toBool() == true); + QTRY_VERIFY(o->property("done").toBool() == true); + QTRY_VERIFY(o->property("done2").toBool() == true); QCOMPARE(o->property("test1").toBool(), true); QCOMPARE(o->property("test2").toBool(), true); @@ -2524,7 +2516,7 @@ void tst_qdeclarativeecmascript::include() QObject *o = component.create(); QVERIFY(o != 0); - TRY_WAIT(o->property("done").toBool() == true); + QTRY_VERIFY(o->property("done").toBool() == true); QCOMPARE(o->property("test1").toBool(), true); QCOMPARE(o->property("test2").toBool(), true); diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp index d4d8bf6..5fd373c 100644 --- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp +++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp @@ -604,6 +604,8 @@ void tst_QDeclarativeGridView::currentIndex() // no wrap gridview->setCurrentIndex(0); QCOMPARE(gridview->currentIndex(), 0); + // confirm that the velocity is updated + QTRY_VERIFY(gridview->verticalVelocity() != 0.0); gridview->moveCurrentIndexUp(); QCOMPARE(gridview->currentIndex(), 0); diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp index 8cfb487..2686127 100644 --- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp +++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp @@ -52,7 +52,9 @@ #include <private/qdeclarativeloader_p.h> #include <QtDeclarative/qdeclarativecontext.h> #include <QtDeclarative/qdeclarativeexpression.h> +#include <QtTest/QSignalSpy> +#include "../../../shared/util.h" #include "../shared/testhttpserver.h" #ifdef Q_OS_SYMBIAN @@ -63,18 +65,7 @@ #define SERVER_PORT 14451 #define SERVER_ADDR "http://127.0.0.1:14451" -#define TRY_WAIT(expr) \ - do { \ - for (int ii = 0; ii < 60; ++ii) { \ - if ((expr)) break; \ - QTest::qWait(50); \ - } \ - QVERIFY((expr)); \ - } while (false) - - class tst_qdeclarativeimage : public QObject - { Q_OBJECT public: @@ -91,6 +82,7 @@ private slots: void svg(); void big(); void tiling_QTBUG_6716(); + void noLoading(); private: template<typename T> @@ -173,18 +165,18 @@ void tst_qdeclarativeimage::imageSource() QVERIFY(obj->asynchronous() == true); if (remote || async) - TRY_WAIT(obj->status() == QDeclarativeImage::Loading); + QTRY_VERIFY(obj->status() == QDeclarativeImage::Loading); QCOMPARE(obj->source(), remote ? source : QUrl(source)); if (error.isEmpty()) { - TRY_WAIT(obj->status() == QDeclarativeImage::Ready); + QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready); QCOMPARE(obj->width(), qreal(width)); QCOMPARE(obj->height(), qreal(height)); QCOMPARE(obj->fillMode(), QDeclarativeImage::Stretch); QCOMPARE(obj->progress(), 1.0); } else { - TRY_WAIT(obj->status() == QDeclarativeImage::Error); + QTRY_VERIFY(obj->status() == QDeclarativeImage::Error); } delete obj; @@ -355,6 +347,54 @@ void tst_qdeclarativeimage::tiling_QTBUG_6716() } } +void tst_qdeclarativeimage::noLoading() +{ + TestHTTPServer server(SERVER_PORT); + QVERIFY(server.isValid()); + server.serveDirectory(SRCDIR "/data"); + server.addRedirect("oldcolors.png", SERVER_ADDR "/colors.png"); + + QString componentStr = "import Qt 4.7\nImage { source: srcImage }"; + QDeclarativeContext *ctxt = engine.rootContext(); + ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/heart.png")); + QDeclarativeComponent component(&engine); + component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); + QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create()); + QVERIFY(obj != 0); + QVERIFY(obj->status() == QDeclarativeImage::Ready); + + QSignalSpy sourceSpy(obj, SIGNAL(sourceChanged(const QUrl &))); + QSignalSpy progressSpy(obj, SIGNAL(progressChanged(qreal))); + QSignalSpy statusSpy(obj, SIGNAL(statusChanged(QDeclarativeImageBase::Status))); + + // Loading local file + ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png")); + QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready); + QTRY_VERIFY(obj->progress() == 1.0); + QTRY_COMPARE(sourceSpy.count(), 1); + QTRY_COMPARE(progressSpy.count(), 0); + QTRY_COMPARE(statusSpy.count(), 0); + + // Loading remote file + ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/oldcolors.png"); + QTRY_VERIFY(obj->status() == QDeclarativeImage::Loading); + QTRY_VERIFY(obj->progress() == 0.0); + QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready); + QTRY_VERIFY(obj->progress() == 1.0); + QTRY_COMPARE(sourceSpy.count(), 2); + QTRY_COMPARE(progressSpy.count(), 2); + QTRY_COMPARE(statusSpy.count(), 2); + + // Loading remote file again - should not go through 'Loading' state. + ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png")); + ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/oldcolors.png"); + QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready); + QTRY_VERIFY(obj->progress() == 1.0); + QTRY_COMPARE(sourceSpy.count(), 4); + QTRY_COMPARE(progressSpy.count(), 2); + QTRY_COMPARE(statusSpy.count(), 2); +} + /* Find an item with the specified objectName. If index is supplied then the item must also evaluate the {index} expression equal to index diff --git a/tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro b/tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro index bdb6423..3bf0ea1 100644 --- a/tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro +++ b/tests/auto/declarative/qdeclarativeimageprovider/qdeclarativeimageprovider.pro @@ -8,11 +8,7 @@ SOURCES += tst_qdeclarativeimageprovider.cpp # QMAKE_CXXFLAGS = -fprofile-arcs -ftest-coverage # LIBS += -lgcov -symbian: { - importFiles.sources = data - importFiles.path = . - DEPLOYMENT = importFiles -} else { +!symbian: { DEFINES += SRCDIR=\\\"$$PWD\\\" } diff --git a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp index d0afc8a..d38160d 100644 --- a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp +++ b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp @@ -45,26 +45,15 @@ #include <private/qdeclarativeimage_p.h> #include <QImageReader> #include <QWaitCondition> +#include "../../../shared/util.h" #ifdef Q_OS_SYMBIAN // In Symbian OS test data is located in applications private dir #define SRCDIR "." #endif -// QDeclarativeImageProvider::request() is run in an idle thread where possible -// Be generous in our timeout. -#define TRY_WAIT(expr) \ - do { \ - for (int ii = 0; ii < 10; ++ii) { \ - if ((expr)) break; \ - QTest::qWait(100); \ - } \ - QVERIFY((expr)); \ - } while (false) - Q_DECLARE_METATYPE(QDeclarativeImageProvider*); - class tst_qdeclarativeimageprovider : public QObject { Q_OBJECT @@ -212,13 +201,13 @@ void tst_qdeclarativeimageprovider::runTest(bool async, QDeclarativeImageProvide QVERIFY(obj != 0); if (async) - TRY_WAIT(obj->status() == QDeclarativeImage::Loading); + QTRY_VERIFY(obj->status() == QDeclarativeImage::Loading); QCOMPARE(obj->source(), QUrl(source)); if (error.isEmpty()) { if (async) - TRY_WAIT(obj->status() == QDeclarativeImage::Ready); + QTRY_VERIFY(obj->status() == QDeclarativeImage::Ready); else QVERIFY(obj->status() == QDeclarativeImage::Ready); QCOMPARE(obj->width(), qreal(size.width())); @@ -229,7 +218,7 @@ void tst_qdeclarativeimageprovider::runTest(bool async, QDeclarativeImageProvide QCOMPARE(obj->progress(), 1.0); } else { if (async) - TRY_WAIT(obj->status() == QDeclarativeImage::Error); + QTRY_VERIFY(obj->status() == QDeclarativeImage::Error); else QVERIFY(obj->status() == QDeclarativeImage::Error); } @@ -391,7 +380,7 @@ void tst_qdeclarativeimageprovider::threadTest() provider->cond.wakeAll(); QTest::qWait(250); foreach(QDeclarativeImage *img, images) { - TRY_WAIT(img->status() == QDeclarativeImage::Ready); + QTRY_VERIFY(img->status() == QDeclarativeImage::Ready); } } diff --git a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp index e4b59a7..cd17fad 100644 --- a/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp +++ b/tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp @@ -1016,6 +1016,8 @@ void tst_QDeclarativeListView::currentIndex() // no wrap listview->setCurrentIndex(0); QCOMPARE(listview->currentIndex(), 0); + // confirm that the velocity is updated + QTRY_VERIFY(listview->verticalVelocity() != 0.0); listview->incrementCurrentIndex(); QCOMPARE(listview->currentIndex(), 1); diff --git a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp index 3baf848..b62392d 100644 --- a/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp +++ b/tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp @@ -61,15 +61,6 @@ inline QUrl TEST_FILE(const QString &filename) return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename); } -#define TRY_WAIT(expr) \ - do { \ - for (int ii = 0; ii < 6; ++ii) { \ - if ((expr)) break; \ - QTest::qWait(50); \ - } \ - QVERIFY((expr)); \ - } while (false) - class tst_QDeclarativeLoader : public QObject { @@ -460,7 +451,7 @@ void tst_QDeclarativeLoader::networkRequestUrl() QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create()); QVERIFY(loader != 0); - TRY_WAIT(loader->status() == QDeclarativeLoader::Ready); + QTRY_VERIFY(loader->status() == QDeclarativeLoader::Ready); QVERIFY(loader->item()); QCOMPARE(loader->progress(), 1.0); @@ -491,7 +482,7 @@ void tst_QDeclarativeLoader::networkComponent() QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(item->QGraphicsObject::children().at(1)); QVERIFY(loader); - TRY_WAIT(loader->status() == QDeclarativeLoader::Ready); + QTRY_VERIFY(loader->status() == QDeclarativeLoader::Ready); QVERIFY(loader->item()); QCOMPARE(loader->progress(), 1.0); @@ -515,7 +506,7 @@ void tst_QDeclarativeLoader::failNetworkRequest() QDeclarativeLoader *loader = qobject_cast<QDeclarativeLoader*>(component.create()); QVERIFY(loader != 0); - TRY_WAIT(loader->status() == QDeclarativeLoader::Error); + QTRY_VERIFY(loader->status() == QDeclarativeLoader::Error); QVERIFY(loader->item() == 0); QCOMPARE(loader->progress(), 0.0); diff --git a/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml b/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml new file mode 100644 index 0000000..9cddf1b --- /dev/null +++ b/tests/auto/declarative/qdeclarativemousearea/data/doubleclick.qml @@ -0,0 +1,14 @@ +import Qt 4.7 + +Item { + id: root + property int clicked: 0 + property int doubleClicked: 0 + + MouseArea { + width: 200; height: 200 + onClicked: { root.clicked++ } + onDoubleClicked: { root.doubleClicked++ } + } +} + diff --git a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp index c9bb467..e4ec01f 100644 --- a/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp +++ b/tests/auto/declarative/qdeclarativemousearea/tst_qdeclarativemousearea.cpp @@ -62,6 +62,7 @@ private slots: void updateMouseAreaPosOnResize(); void noOnClickedWithPressAndHold(); void onMousePressRejected(); + void doubleClick(); private: QDeclarativeView *createView(); @@ -390,6 +391,37 @@ void tst_QDeclarativeMouseArea::onMousePressRejected() QVERIFY(!canvas->rootObject()->property("mr2_released").toBool()); } +void tst_QDeclarativeMouseArea::doubleClick() +{ + QDeclarativeView *canvas = createView(); + canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/doubleclick.qml")); + canvas->show(); + canvas->setFocus(); + QVERIFY(canvas->rootObject() != 0); + + QGraphicsScene *scene = canvas->scene(); + QGraphicsSceneMouseEvent pressEvent(QEvent::GraphicsSceneMousePress); + pressEvent.setScenePos(QPointF(100, 100)); + pressEvent.setButton(Qt::LeftButton); + pressEvent.setButtons(Qt::LeftButton); + QApplication::sendEvent(scene, &pressEvent); + + QGraphicsSceneMouseEvent releaseEvent(QEvent::GraphicsSceneMouseRelease); + releaseEvent.setScenePos(QPointF(100, 100)); + releaseEvent.setButton(Qt::LeftButton); + releaseEvent.setButtons(Qt::LeftButton); + QApplication::sendEvent(scene, &releaseEvent); + + QGraphicsSceneMouseEvent dblClickEvent(QEvent::GraphicsSceneMouseDoubleClick); + dblClickEvent.setScenePos(QPointF(100, 100)); + dblClickEvent.setButton(Qt::LeftButton); + dblClickEvent.setButtons(Qt::LeftButton); + QApplication::sendEvent(scene, &dblClickEvent); + + QCOMPARE(canvas->rootObject()->property("clicked").toInt(), 1); + QCOMPARE(canvas->rootObject()->property("doubleClicked").toInt(), 1); +} + QTEST_MAIN(tst_QDeclarativeMouseArea) #include "tst_qdeclarativemousearea.moc" diff --git a/tests/auto/declarative/qdeclarativestates/data/parentChange6.qml b/tests/auto/declarative/qdeclarativestates/data/parentChange6.qml new file mode 100644 index 0000000..be92aba --- /dev/null +++ b/tests/auto/declarative/qdeclarativestates/data/parentChange6.qml @@ -0,0 +1,30 @@ +import Qt 4.7 + +Rectangle { + width: 400; height: 400 + Rectangle { + id: myRect + objectName: "MyRect" + x: 5; y: 5 + width: 100; height: 100 + color: "red" + } + MouseArea { + id: clickable + anchors.fill: parent + } + + Item { + id: newParent + rotation: 180 + } + + states: State { + name: "reparented" + when: clickable.pressed + ParentChange { + target: myRect + parent: newParent + } + } +} diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp index 6ae2759..0621602 100644 --- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp +++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp @@ -581,6 +581,21 @@ void tst_qdeclarativestates::parentChange() //do a non-qFuzzyCompare fuzzy compare QVERIFY(innerRect->y() < qreal(0.00001) && innerRect->y() > qreal(-0.00001)); } + + { + QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/parentChange6.qml"); + QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create()); + QVERIFY(rect != 0); + + QDeclarativeRectangle *innerRect = qobject_cast<QDeclarativeRectangle*>(rect->findChild<QDeclarativeRectangle*>("MyRect")); + QVERIFY(innerRect != 0); + + QDeclarativeItemPrivate::get(rect)->setState("reparented"); + QCOMPARE(innerRect->rotation(), qreal(180)); + QCOMPARE(innerRect->scale(), qreal(1)); + QCOMPARE(innerRect->x(), qreal(-105)); + QCOMPARE(innerRect->y(), qreal(-105)); + } } void tst_qdeclarativestates::parentChangeErrors() diff --git a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp index 658f381..f683d98 100644 --- a/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp +++ b/tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp @@ -608,6 +608,17 @@ void tst_qdeclarativetext::style() QCOMPARE((int)textObject->style(), (int)styles.at(i)); QCOMPARE(textObject->styleColor(), QColor("white")); } + QString componentStr = "import Qt 4.7\nText { text: \"Hello World\" }"; + QDeclarativeComponent textComponent(&engine); + textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); + QDeclarativeText *textObject = qobject_cast<QDeclarativeText*>(textComponent.create()); + + QRectF brPre = textObject->boundingRect(); + textObject->setStyle(QDeclarativeText::Outline); + QRectF brPost = textObject->boundingRect(); + + QVERIFY(brPre.width() < brPost.width()); + QVERIFY(brPre.height() < brPost.height()); } void tst_qdeclarativetext::color() diff --git a/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp b/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp index ecce349..89252fb 100644 --- a/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp +++ b/tests/auto/declarative/qdeclarativexmlhttprequest/tst_qdeclarativexmlhttprequest.cpp @@ -45,6 +45,7 @@ #include <QDebug> #include <QNetworkCookieJar> #include "testhttpserver.h" +#include "../../../shared/util.h" #define SERVER_PORT 14445 @@ -156,16 +157,6 @@ void tst_qdeclarativexmlhttprequest::domExceptionCodes() delete object; } -#define TRY_WAIT(expr) \ - do { \ - for (int ii = 0; ii < 6; ++ii) { \ - if ((expr)) break; \ - QTest::qWait(50); \ - } \ - QVERIFY((expr)); \ - } while (false) - - void tst_qdeclarativexmlhttprequest::callbackException_data() { QTest::addColumn<QString>("which"); @@ -193,7 +184,7 @@ void tst_qdeclarativexmlhttprequest::callbackException() object->setProperty("which", which); component.completeCreate(); - TRY_WAIT(object->property("threw").toBool() == true); + QTRY_VERIFY(object->property("threw").toBool() == true); delete object; } @@ -289,7 +280,7 @@ void tst_qdeclarativexmlhttprequest::open() QCOMPARE(object->property("responseText").toBool(), true); QCOMPARE(object->property("responseXML").toBool(), true); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); delete server; delete object; @@ -372,7 +363,7 @@ void tst_qdeclarativexmlhttprequest::setRequestHeader() object->setProperty("url", "http://127.0.0.1:14445/testdocument.html"); component.completeCreate(); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); delete object; } @@ -442,7 +433,7 @@ void tst_qdeclarativexmlhttprequest::setRequestHeader_illegalName() QCOMPARE(object->property("responseText").toBool(), true); QCOMPARE(object->property("responseXML").toBool(), true); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); delete object; } @@ -464,7 +455,7 @@ void tst_qdeclarativexmlhttprequest::setRequestHeader_sent() QCOMPARE(object->property("test").toBool(), true); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); delete object; } @@ -501,7 +492,7 @@ void tst_qdeclarativexmlhttprequest::send_alreadySent() QVERIFY(object != 0); QCOMPARE(object->property("test").toBool(), true); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); delete object; } @@ -523,7 +514,7 @@ void tst_qdeclarativexmlhttprequest::send_ignoreData() object->setProperty("url", "http://127.0.0.1:14445/testdocument.html"); component.completeCreate(); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); delete object; } @@ -542,7 +533,7 @@ void tst_qdeclarativexmlhttprequest::send_ignoreData() object->setProperty("url", "http://127.0.0.1:14445/testdocument.html"); component.completeCreate(); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); delete object; } @@ -566,7 +557,7 @@ void tst_qdeclarativexmlhttprequest::send_withdata() object->setProperty("url", "http://127.0.0.1:14445/testdocument.html"); component.completeCreate(); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); delete object; } @@ -601,7 +592,7 @@ void tst_qdeclarativexmlhttprequest::abort_unsent() QCOMPARE(object->property("responseText").toBool(), true); QCOMPARE(object->property("responseXML").toBool(), true); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); delete object; } @@ -622,7 +613,7 @@ void tst_qdeclarativexmlhttprequest::abort_opened() QCOMPARE(object->property("responseText").toBool(), true); QCOMPARE(object->property("responseXML").toBool(), true); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); delete object; } @@ -647,7 +638,7 @@ void tst_qdeclarativexmlhttprequest::abort() QCOMPARE(object->property("didNotSeeUnsent").toBool(), true); QCOMPARE(object->property("endStateUnsent").toBool(), true); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); delete object; } @@ -674,7 +665,7 @@ void tst_qdeclarativexmlhttprequest::getResponseHeader() QCOMPARE(object->property("readyState").toBool(), true); QCOMPARE(object->property("openedState").toBool(), true); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); QCOMPARE(object->property("headersReceivedState").toBool(), true); QCOMPARE(object->property("headersReceivedNullHeader").toBool(), true); @@ -722,7 +713,7 @@ void tst_qdeclarativexmlhttprequest::getResponseHeader_args() QObject *object = component.create(); QVERIFY(object != 0); - TRY_WAIT(object->property("exceptionThrown").toBool() == true); + QTRY_VERIFY(object->property("exceptionThrown").toBool() == true); delete object; } @@ -748,7 +739,7 @@ void tst_qdeclarativexmlhttprequest::getAllResponseHeaders() QCOMPARE(object->property("readyState").toBool(), true); QCOMPARE(object->property("openedState").toBool(), true); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); QCOMPARE(object->property("headersReceivedState").toBool(), true); QCOMPARE(object->property("headersReceivedHeader").toBool(), true); @@ -790,7 +781,7 @@ void tst_qdeclarativexmlhttprequest::getAllResponseHeaders_args() QObject *object = component.create(); QVERIFY(object != 0); - TRY_WAIT(object->property("exceptionThrown").toBool() == true); + QTRY_VERIFY(object->property("exceptionThrown").toBool() == true); delete object; } @@ -813,7 +804,7 @@ void tst_qdeclarativexmlhttprequest::status() object->setProperty("expectedStatus", status); component.completeCreate(); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); QCOMPARE(object->property("unsentException").toBool(), true); QCOMPARE(object->property("openedException").toBool(), true); @@ -853,7 +844,7 @@ void tst_qdeclarativexmlhttprequest::statusText() object->setProperty("expectedStatus", statusText); component.completeCreate(); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); QCOMPARE(object->property("unsentException").toBool(), true); QCOMPARE(object->property("openedException").toBool(), true); @@ -894,7 +885,7 @@ void tst_qdeclarativexmlhttprequest::responseText() object->setProperty("expectedText", responseText); component.completeCreate(); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); QCOMPARE(object->property("unsent").toBool(), true); QCOMPARE(object->property("opened").toBool(), true); @@ -931,7 +922,7 @@ void tst_qdeclarativexmlhttprequest::nonUtf8() object->setProperty("fileName", fileName); QMetaObject::invokeMethod(object, "startRequest"); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); QCOMPARE(object->property("responseText").toString(), responseText); @@ -1000,7 +991,7 @@ void tst_qdeclarativexmlhttprequest::redirects() object->setProperty("expectedText", ""); component.completeCreate(); - TRY_WAIT(object->property("done").toBool() == true); + QTRY_VERIFY(object->property("done").toBool() == true); QCOMPARE(object->property("dataOK").toBool(), true); delete object; @@ -1019,7 +1010,7 @@ void tst_qdeclarativexmlhttprequest::redirects() object->setProperty("expectedText", ""); component.completeCreate(); - TRY_WAIT(object->property("done").toBool() == true); + QTRY_VERIFY(object->property("done").toBool() == true); QCOMPARE(object->property("dataOK").toBool(), true); delete object; @@ -1056,7 +1047,7 @@ void tst_qdeclarativexmlhttprequest::responseXML_invalid() QObject *object = component.create(); QVERIFY(object != 0); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); QCOMPARE(object->property("xmlNull").toBool(), true); @@ -1070,7 +1061,7 @@ void tst_qdeclarativexmlhttprequest::document() QObject *object = component.create(); QVERIFY(object != 0); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); QCOMPARE(object->property("xmlTest").toBool(), true); @@ -1084,7 +1075,7 @@ void tst_qdeclarativexmlhttprequest::element() QObject *object = component.create(); QVERIFY(object != 0); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); QCOMPARE(object->property("xmlTest").toBool(), true); @@ -1098,7 +1089,7 @@ void tst_qdeclarativexmlhttprequest::attr() QObject *object = component.create(); QVERIFY(object != 0); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); QCOMPARE(object->property("xmlTest").toBool(), true); @@ -1112,7 +1103,7 @@ void tst_qdeclarativexmlhttprequest::text() QObject *object = component.create(); QVERIFY(object != 0); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); QCOMPARE(object->property("xmlTest").toBool(), true); @@ -1126,7 +1117,7 @@ void tst_qdeclarativexmlhttprequest::cdata() QObject *object = component.create(); QVERIFY(object != 0); - TRY_WAIT(object->property("dataOK").toBool() == true); + QTRY_VERIFY(object->property("dataOK").toBool() == true); QCOMPARE(object->property("xmlTest").toBool(), true); diff --git a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.0.png b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.0.png Binary files differnew file mode 100644 index 0000000..bf02e1a --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.0.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.1.png b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.1.png Binary files differnew file mode 100644 index 0000000..ae71dc8 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.1.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.2.png b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.2.png Binary files differnew file mode 100644 index 0000000..6f631b0 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.2.png diff --git a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.qml b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.qml new file mode 100644 index 0000000..3124973 --- /dev/null +++ b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/data/smoothedfollow.qml @@ -0,0 +1,795 @@ +import Qt.VisualTest 4.7 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "2c6600b50a18c415032fa95fe5089da6" + } + Frame { + msec: 32 + hash: "aefd5a2570cc0252be102644ec1e49e3" + } + Frame { + msec: 48 + hash: "6183d0554a8b812bee02719dc4df21d1" + } + Frame { + msec: 64 + hash: "e1b3a94d033626338de0e04dba7b6df9" + } + Frame { + msec: 80 + hash: "7d1a5a265fb20ac4d741d76ab7b3a41f" + } + Frame { + msec: 96 + hash: "0ce7d2acda3e5ccb7b2364e2a7b409a4" + } + Frame { + msec: 112 + hash: "21f3a66ee80fcb2dd4dce0d1666aa4dd" + } + Frame { + msec: 128 + hash: "ea5b81ff2805210111cb388ab9be0d8f" + } + Frame { + msec: 144 + hash: "a8a54a3c524dcf6777b71d99ae2d50bd" + } + Frame { + msec: 160 + hash: "6b658c468af8a88e4a282d57fdcbc3b0" + } + Frame { + msec: 176 + hash: "986121c9d928cc9ceb912a975f75760a" + } + Frame { + msec: 192 + hash: "4bf3593d0edc4347cf77670a48ba4440" + } + Frame { + msec: 208 + hash: "ea00f25295fb019f949930fb7109ceb4" + } + Frame { + msec: 224 + hash: "ad6cc7563e2720c405842317d0ce731a" + } + Frame { + msec: 240 + hash: "8a03a1207cdb5bd92f5227b25a7b638e" + } + Frame { + msec: 256 + hash: "f355321aa47d18e8b6dde503565d0e97" + } + Frame { + msec: 272 + hash: "e18f671cac8e68948f32a468bf2630cf" + } + Frame { + msec: 288 + hash: "264bca92fba53f25439d240afef62880" + } + Frame { + msec: 304 + hash: "a1a226c73fb97d5302ce683f901ee5c4" + } + Frame { + msec: 320 + hash: "05578552476372fc58e463e84a147ddd" + } + Frame { + msec: 336 + hash: "0a3e0a651f9eb3e6a44a55a6786e60ff" + } + Frame { + msec: 352 + hash: "4ca362f079f96a01360ee8062fbb8238" + } + Frame { + msec: 368 + hash: "ba512c117d97ce16ff92d03ce2b08056" + } + Frame { + msec: 384 + hash: "8688355f0f97afe000d02f71c841d5dc" + } + Frame { + msec: 400 + hash: "a2ea6ad008da95a67d3bc70e11e3811d" + } + Frame { + msec: 416 + hash: "83bc9c444ab8618438dc2b8b14716f7b" + } + Frame { + msec: 432 + hash: "fafbba34fc8f9d33b559e6fcd0c5f1c6" + } + Frame { + msec: 448 + hash: "92d245951b759f74182602a7a337cb0f" + } + Frame { + msec: 464 + hash: "e0634d25088a6855df8d86d84fe37cd7" + } + Frame { + msec: 480 + hash: "7f4d05f4c3b1a365732e448f2c751740" + } + Frame { + msec: 496 + hash: "fcd6f55929f753f77b1617c0984b8690" + } + Frame { + msec: 512 + hash: "7e88f100a7012d739cd3c97c4e7f4b45" + } + Frame { + msec: 528 + hash: "8f9d029b3850ee2f11cdf6630d100682" + } + Frame { + msec: 544 + hash: "b915f712b24f187ee759b3337fb0df7a" + } + Frame { + msec: 560 + hash: "eae400a0c72d38156f7ae0f16ab9ee66" + } + Frame { + msec: 576 + hash: "e913a1e317cca355b06a393f44cc0243" + } + Frame { + msec: 592 + hash: "abf075ea63a6f5cce43c38e20dbcdbb2" + } + Frame { + msec: 608 + hash: "a6e85caa1eb933343a4605bc434e2841" + } + Frame { + msec: 624 + hash: "8e33e2582dd127d3f04017bf493b0ac6" + } + Frame { + msec: 640 + hash: "959e4062262bcc759abfc7b0bf3e10b6" + } + Frame { + msec: 656 + hash: "9529e2241df0d90ea640fdb3752b0837" + } + Frame { + msec: 672 + hash: "5595b64495996ce66b5f6892e9457456" + } + Frame { + msec: 688 + hash: "532259c3577553622093eba907ae82d3" + } + Frame { + msec: 704 + hash: "85c4332100b6f5256702b594c83f4eff" + } + Frame { + msec: 720 + hash: "b96292d85b12fa8e68c5de3deb29b980" + } + Frame { + msec: 736 + hash: "64febec9c8b58e2b93249f19c57b7aba" + } + Frame { + msec: 752 + hash: "88e588af29131cf942e02b1080e564e5" + } + Frame { + msec: 768 + hash: "07f911478be2f36d0c1b9cb878f4fe47" + } + Frame { + msec: 784 + hash: "8ffbf2381efefcbca413f6e3455018fb" + } + Frame { + msec: 800 + hash: "6e456af680e40799d3f38bdde29a85f9" + } + Frame { + msec: 816 + hash: "48a8dbc64d7823164c992f55b270115d" + } + Frame { + msec: 832 + hash: "a6d28eb1d0aafd387e35ca7b362bec53" + } + Frame { + msec: 848 + hash: "2e9f2b2ebf1b24f01fc986ded320d7c9" + } + Frame { + msec: 864 + hash: "d0cafd9be3263193c207c39eeb051bb8" + } + Frame { + msec: 880 + hash: "8dee1a5365fa3ccd7036c8afa6a805cc" + } + Frame { + msec: 896 + hash: "42f893afb80633f0ffb82f1725bb097f" + } + Frame { + msec: 912 + hash: "f466a404940abcd4c8f3180696da1a29" + } + Frame { + msec: 928 + hash: "e5746e33b3eb155a354bc5900b7593ee" + } + Frame { + msec: 944 + hash: "a1c2eb7048356f4ebc803d9d5439db24" + } + Frame { + msec: 960 + image: "smoothedfollow.0.png" + } + Frame { + msec: 976 + hash: "338aec0e679a8f2e79f6a5503dfbd6c3" + } + Frame { + msec: 992 + hash: "59321f1eb26c379e9e2a37b6890d922d" + } + Frame { + msec: 1008 + hash: "f37a821b9cf9f67fd011c6790a2757f0" + } + Frame { + msec: 1024 + hash: "c3f1b8722c616ecd55d8496e76a9bf06" + } + Frame { + msec: 1040 + hash: "ca6aff9addda2e3ac51e5e2013393365" + } + Frame { + msec: 1056 + hash: "17d1aa7821ce8169a3100a3cd3a0df2b" + } + Frame { + msec: 1072 + hash: "d85dd272f35868d6832316e862db4ec1" + } + Frame { + msec: 1088 + hash: "8bce5bdadfa974655dc7e020ad43edeb" + } + Frame { + msec: 1104 + hash: "b97f71587a5187d5175e5d9f1409c00a" + } + Frame { + msec: 1120 + hash: "53d438e601c25aebfd2ecb0064cdf5cc" + } + Frame { + msec: 1136 + hash: "18c43dd35b3e0d8f9ab5c8de3e48886a" + } + Frame { + msec: 1152 + hash: "e4ab585684d083de118b7862ef5cbd63" + } + Frame { + msec: 1168 + hash: "48ab046a2e2ca1a1225574b94925482e" + } + Frame { + msec: 1184 + hash: "c4bd06a5c329ef6975a60453f588bce7" + } + Frame { + msec: 1200 + hash: "864393a984dce3e9dd2daec56ddb3fe7" + } + Frame { + msec: 1216 + hash: "fcdf4cfcd8a6d8667868ba9633475fe0" + } + Frame { + msec: 1232 + hash: "5ac2b96158045c9b9eb35f1cbabe5b1f" + } + Frame { + msec: 1248 + hash: "83c409e5d3e6fe9e953d9ce14d731b3b" + } + Frame { + msec: 1264 + hash: "01805526b04e17b89238e7b929be48dd" + } + Frame { + msec: 1280 + hash: "4708345219b3732f9aaf8b40645f65d2" + } + Frame { + msec: 1296 + hash: "12716f84b6f648df2cbe08cfea58764c" + } + Frame { + msec: 1312 + hash: "6cce1e6354bd338f364bcca84a5fd081" + } + Frame { + msec: 1328 + hash: "c5da6f6b00402e0de00490792b963cdf" + } + Frame { + msec: 1344 + hash: "0eacadf69c0818e818abaf3aaf823aff" + } + Frame { + msec: 1360 + hash: "c68cd79bf0d329a3c672896b9ce2044d" + } + Frame { + msec: 1376 + hash: "26786f921ddddd9d2f975e1193943d2d" + } + Frame { + msec: 1392 + hash: "68c7c1779bb19ee5cd9370b5c06f4ce7" + } + Frame { + msec: 1408 + hash: "5e87c3e00ef7fab01c17d9e89c661aab" + } + Frame { + msec: 1424 + hash: "0b459122be303c38d3564dd7fea53fc1" + } + Frame { + msec: 1440 + hash: "3b13101a45b470fd04fa02f34548984b" + } + Frame { + msec: 1456 + hash: "6308fa1ed015bb698251af0d1b9be084" + } + Frame { + msec: 1472 + hash: "f219427d8fdf826f33351ba64db55d33" + } + Frame { + msec: 1488 + hash: "0c9ad8c5224d3cdefb8ac793cac3ca79" + } + Frame { + msec: 1504 + hash: "38438307162bceef76afb043c82b6a82" + } + Frame { + msec: 1520 + hash: "78b367e6bab0463fe08f5e634cfbced2" + } + Frame { + msec: 1536 + hash: "81e56f9d3bb9b360a07dc85697a59340" + } + Frame { + msec: 1552 + hash: "cef4fdb8c12485d3590e598090312297" + } + Frame { + msec: 1568 + hash: "8ea0c90a100c583558f92843030543cc" + } + Frame { + msec: 1584 + hash: "0037f0f17a50bdfe3bf0de810ff837f1" + } + Frame { + msec: 1600 + hash: "2b060ac0dfa045b916d3fd5ff6f84bfb" + } + Frame { + msec: 1616 + hash: "b20705dcc6176efd83cff6927991ff0a" + } + Frame { + msec: 1632 + hash: "0af69e490bdc54f27d3e50c1fdfd12a8" + } + Frame { + msec: 1648 + hash: "8e4cceadc01de5b51082889efabcbb7e" + } + Frame { + msec: 1664 + hash: "b64958786a7007686fb1734783d553f5" + } + Frame { + msec: 1680 + hash: "e0b9d98bb3a596fd235d58b6a761a0e0" + } + Frame { + msec: 1696 + hash: "1a5d7dc4dfd3ee86a36978d4effd299c" + } + Frame { + msec: 1712 + hash: "4946561f008635599651bf24b9aa0594" + } + Frame { + msec: 1728 + hash: "8427d33046af64c6e63939238c101e86" + } + Frame { + msec: 1744 + hash: "cdcfab5cea86c33f276c3613d76067c4" + } + Frame { + msec: 1760 + hash: "966005d62bd69b53d77459e5ab65116c" + } + Frame { + msec: 1776 + hash: "8a3c4ff083a973325c4ab09e09027ef6" + } + Frame { + msec: 1792 + hash: "737ffd6f52fa3d812ecaf835a30495af" + } + Frame { + msec: 1808 + hash: "6731007c97ba3ba60e73ab50803868e5" + } + Frame { + msec: 1824 + hash: "caa4ea08c5c330e77a7445cc1adf1666" + } + Frame { + msec: 1840 + hash: "73778bfbae55a81557a128acb4a197c8" + } + Frame { + msec: 1856 + hash: "7d8609f1336ddf4e25b505e54142114e" + } + Frame { + msec: 1872 + hash: "d8b4514d2bd77dbe67e27d400dc1a2f3" + } + Frame { + msec: 1888 + hash: "ac3e7040f1e9fc680f52f46d25eb3faa" + } + Frame { + msec: 1904 + hash: "509c21774f0fca9dde0657133a1cc363" + } + Frame { + msec: 1920 + image: "smoothedfollow.1.png" + } + Frame { + msec: 1936 + hash: "545bcb0c362a083ee698a5c8cd225014" + } + Frame { + msec: 1952 + hash: "77370c9b2880c55fecf07457dd0d455b" + } + Frame { + msec: 1968 + hash: "6c44209f31f5f010f1b3e05490468821" + } + Frame { + msec: 1984 + hash: "2dffac0c44e52f2984525d3d3700e6ed" + } + Frame { + msec: 2000 + hash: "d70f2db1b166b2de3bef74bc4bf94a80" + } + Frame { + msec: 2016 + hash: "50e4f6a82f498066fc9b6588762f59f9" + } + Frame { + msec: 2032 + hash: "956a7d7db9aef1b7abefac1a69622f02" + } + Frame { + msec: 2048 + hash: "13f19d5baefb6c8c9f71c16163663a27" + } + Frame { + msec: 2064 + hash: "076ff84405ddb29a12ed30d27cee558b" + } + Frame { + msec: 2080 + hash: "6af0261639f809da8f7e4831559596d3" + } + Frame { + msec: 2096 + hash: "a0500b18e99bfe3a48d52cc62b4a946b" + } + Frame { + msec: 2112 + hash: "bb0ea576c9136fb70720d4540731d2ca" + } + Frame { + msec: 2128 + hash: "d9b12ad9bf54d7db0ef1b36297a6dd6c" + } + Frame { + msec: 2144 + hash: "2de77e082872f072a849ba9ea93e3aec" + } + Frame { + msec: 2160 + hash: "69e186c3e8e6b2c75da2ca87043129da" + } + Frame { + msec: 2176 + hash: "0c2f23b0cbedb45a68f0cbe6132b4820" + } + Frame { + msec: 2192 + hash: "533bad00e5624611ea8a15d5fa98f0f2" + } + Frame { + msec: 2208 + hash: "d9c60bc821205aa4ea38d846e5b00f3a" + } + Frame { + msec: 2224 + hash: "d4de041edf15c6b6806d7f5992146711" + } + Frame { + msec: 2240 + hash: "100145df5271efaaee1d619bd50b69fc" + } + Frame { + msec: 2256 + hash: "22905b794fee24f3a25e4944d5505e96" + } + Frame { + msec: 2272 + hash: "aeed7adea08fe6e8b60310082cf87b6c" + } + Frame { + msec: 2288 + hash: "82bf8d40b6ed8aae9d6172eae76d1859" + } + Frame { + msec: 2304 + hash: "b1881778936744db3df0898638e4b0df" + } + Frame { + msec: 2320 + hash: "87195016996f8786a8a2430c54f13494" + } + Frame { + msec: 2336 + hash: "56f99b14320662b90eb10e77845bba30" + } + Frame { + msec: 2352 + hash: "69a84022d8d2b3cdb1d7eae6ce5ccef2" + } + Frame { + msec: 2368 + hash: "578ca8c66da6aa64392b253ab6cccbc0" + } + Frame { + msec: 2384 + hash: "4c2058e4708001f82f3bcb8110d6a54f" + } + Frame { + msec: 2400 + hash: "a838be752168bc6feb3151327147bb23" + } + Frame { + msec: 2416 + hash: "bf6cde06f0ee814cd4a23f3d43e7d270" + } + Frame { + msec: 2432 + hash: "9162ec43bc84261c0eb9ea2425da0b8a" + } + Frame { + msec: 2448 + hash: "7be19df0ee54f9bb31ebee2d786addc8" + } + Frame { + msec: 2464 + hash: "542a4c004f5b1b8efa7588b27cc2ba43" + } + Frame { + msec: 2480 + hash: "f9e2edd343be212a9679f1e2ad0e73b3" + } + Frame { + msec: 2496 + hash: "b6d4e9169fc4446cdbd3a36f485b943b" + } + Frame { + msec: 2512 + hash: "0d3b7a652a94162b71e88ed213559af4" + } + Frame { + msec: 2528 + hash: "9d4a2383a4d43ac94ff0a344f217b22d" + } + Frame { + msec: 2544 + hash: "719d402379c40de5cd6d4c8fa92f5472" + } + Frame { + msec: 2560 + hash: "78fb55f5b9c2033a91e41100229e4465" + } + Frame { + msec: 2576 + hash: "0a9ec91eee6c7c770ce2e414fa881229" + } + Frame { + msec: 2592 + hash: "5d9f81f1becf486a09f086e15a64d1f0" + } + Frame { + msec: 2608 + hash: "0f5e18af1eac31e6993ea2df51a143f0" + } + Frame { + msec: 2624 + hash: "08a292373756b06c3a624b8f3bf06236" + } + Frame { + msec: 2640 + hash: "f3c8101429753ce8f0ee094fe0db98ac" + } + Frame { + msec: 2656 + hash: "1603ad220d68ae0a2f613687533c2ebc" + } + Frame { + msec: 2672 + hash: "e2b8049d18fd36fff0180bd4bc199732" + } + Frame { + msec: 2688 + hash: "d1bfeadaa9046ec5013734938a8f4af1" + } + Frame { + msec: 2704 + hash: "3cb3a0e9dc73e76101288395ffeb2b7b" + } + Frame { + msec: 2720 + hash: "104a10e6bd48dacfedf5c98cf641ae93" + } + Frame { + msec: 2736 + hash: "f04a2985e7c203dd6fce46b60fcb23fc" + } + Frame { + msec: 2752 + hash: "30cb747f4604c208d7dc697d5fe2af6b" + } + Frame { + msec: 2768 + hash: "b9eca6ee8fe29351cadeb9a2caf36fa6" + } + Frame { + msec: 2784 + hash: "7bc56e712d713a00a684e07cf3d09907" + } + Frame { + msec: 2800 + hash: "0d7a5e2ff588b71e77abb72723c763b2" + } + Frame { + msec: 2816 + hash: "0d961843e54cbe5ba76c11bcd634bc39" + } + Frame { + msec: 2832 + hash: "6328b52965a002944c501d9888928caa" + } + Frame { + msec: 2848 + hash: "63e668a7688167b604b641929843d0cf" + } + Frame { + msec: 2864 + hash: "7f5e71332268be68de9dcb25f173d2e0" + } + Frame { + msec: 2880 + image: "smoothedfollow.2.png" + } + Frame { + msec: 2896 + hash: "dc6e83fcc5a403913a94c498f1571098" + } + Frame { + msec: 2912 + hash: "8deb275bd08df9b3abdcf3e2796a0601" + } + Frame { + msec: 2928 + hash: "6c08a25a442b97a8cb359792b6a01641" + } + Frame { + msec: 2944 + hash: "5f7ccd5706c77f0b0ddced41ed6352d8" + } + Frame { + msec: 2960 + hash: "6668d1936524f0fdc490720a962a3698" + } + Frame { + msec: 2976 + hash: "e36f901fb4b8ad754592642a7575e4ee" + } + Frame { + msec: 2992 + hash: "7453182980e458d827f3ff83aa3f2c88" + } + Frame { + msec: 3008 + hash: "0e15d75b2a7f2e4a39906093b930d6a8" + } + Frame { + msec: 3024 + hash: "822ccc6c629eabf38fd5ac56abb638f5" + } + Frame { + msec: 3040 + hash: "331ef5b3e3dd5642f8532d337fd22def" + } + Frame { + msec: 3056 + hash: "3c29aae83f28239f31125ef02f523d02" + } + Frame { + msec: 3072 + hash: "56ed674bf2d345861eb235a4239078e2" + } + Frame { + msec: 3088 + hash: "5412b9ad01a6780b67bc59b80a274cd5" + } + Frame { + msec: 3104 + hash: "a6f9ae09a7386f06a84c251083660dd6" + } + Frame { + msec: 3120 + hash: "83f07277c9bec7419dd6a4d40d8accf7" + } + Frame { + msec: 3136 + hash: "e6cb74961dfef68a32f255176e0ebff3" + } + Frame { + msec: 3152 + hash: "9e6c3ac0190beaf30754155a5d64b81c" + } +} diff --git a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedfollow.qml b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedfollow.qml index 0df727b..63dba47 100644 --- a/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedfollow.qml +++ b/tests/auto/declarative/qmlvisual/qdeclarativesmoothedanimation/smoothedfollow.qml @@ -1,15 +1,15 @@ import Qt 4.7 Rectangle { - width: 800; height: 240; color: "gray" + width: 800; height: 720; color: "gray" Rectangle { id: rect width: 50; height: 20; y: 30; color: "black" SequentialAnimation on x { loops: Animation.Infinite - NumberAnimation { from: 50; to: 700; duration: 2000 } - NumberAnimation { from: 700; to: 50; duration: 2000 } + NumberAnimation { from: 50; to: 700; duration: 1000 } + NumberAnimation { from: 700; to: 50; duration: 1000 } } } @@ -25,16 +25,104 @@ Rectangle { Rectangle { width: 50; height: 20; x: rect.x; y: 120; color: "green" - Behavior on x { SmoothedAnimation { reversingMode: SmoothedAnimation.Sync } } + Behavior on x { SmoothedAnimation { velocity: 200; reversingMode: SmoothedAnimation.Sync } } } Rectangle { width: 50; height: 20; x: rect.x; y: 150; color: "purple" - Behavior on x { SmoothedAnimation { maximumEasingTime: 200 } } + Behavior on x { SmoothedAnimation { velocity: 200; maximumEasingTime: 100 } } } Rectangle { width: 50; height: 20; x: rect.x; y: 180; color: "blue" - Behavior on x { SmoothedAnimation { duration: 300 } } + Behavior on x { SmoothedAnimation { velocity: -1; duration: 300 } } + } + + //rect2 has jerky movement, but the rects following it should be smooth + Rectangle { + id: rect2 + property int dir: 1 + width: 50; height: 20; x:50; y: 240; color: "black" + function advance(){ + if(x >= 700) + dir = -1; + if(x <= 50) + dir = 1; + x += 130.0 * dir; + } + } + Timer{ + interval: 200 + running: true + repeat: true + onTriggered: rect2.advance(); + } + + Rectangle { + width: 50; height: 20; x: rect2.x; y: 270; color: "red" + Behavior on x { SmoothedAnimation { velocity: 400 } } + } + + Rectangle { + width: 50; height: 20; x: rect2.x; y: 300; color: "yellow" + Behavior on x { SmoothedAnimation { velocity: 300; reversingMode: SmoothedAnimation.Immediate } } + } + + Rectangle { + width: 50; height: 20; x: rect2.x; y: 330; color: "green" + Behavior on x { SmoothedAnimation { velocity: 200; reversingMode: SmoothedAnimation.Sync } } + } + + Rectangle { + width: 50; height: 20; x: rect2.x; y: 360; color: "purple" + Behavior on x { SmoothedAnimation { velocity: 200; maximumEasingTime: 100 } } + } + + Rectangle { + width: 50; height: 20; x: rect2.x; y: 390; color: "blue" + Behavior on x { SmoothedAnimation { velocity: -1; duration: 300 } } + } + + //rect3 just jumps , but the rects following it should be smooth + Rectangle { + id: rect3 + width: 50; height: 20; x:50; y: 480; color: "black" + function advance(){ + if(x == 50) + x = 700; + else + x = 50; + } + } + Timer{ + interval: 1000 + running: true + repeat: true + onTriggered: rect3.advance(); + } + + Rectangle { + width: 50; height: 20; x: rect3.x; y: 510; color: "red" + Behavior on x { SmoothedAnimation { velocity: 400 } } + } + + Rectangle { + width: 50; height: 20; x: rect3.x; y: 540; color: "yellow" + Behavior on x { SmoothedAnimation { velocity: 300; reversingMode: SmoothedAnimation.Immediate } } + } + + Rectangle { + width: 50; height: 20; x: rect3.x; y: 570; color: "green" + Behavior on x { SmoothedAnimation { velocity: 200; reversingMode: SmoothedAnimation.Sync } } + } + + Rectangle { + width: 50; height: 20; x: rect3.x; y: 600; color: "purple" + Behavior on x { SmoothedAnimation { velocity: 200; maximumEasingTime: 100 } } + } + + Rectangle { + width: 50; height: 20; x: rect3.x; y: 630; color: "blue" + Behavior on x { SmoothedAnimation { velocity: -1; duration: 300 } } } } |