From afcbf6a97744a7b113dc5ce542618a5543aead91 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Tue, 3 Nov 2009 14:17:31 +1000 Subject: Avoid crashing on faulty call to createQmlObject --- src/declarative/qml/qmlengine.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index c562e02..29d91bc 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -625,6 +625,11 @@ QScriptValue QmlEnginePrivate::createQmlObject(QScriptContext *ctxt, QScriptEngi url = QUrl(ctxt->argument(2).toString()); QObject *parentArg = activeEnginePriv->objectClass->toQObject(ctxt->argument(1)); QmlContext *qmlCtxt = qmlContext(parentArg); + if(!parentArg || !qmlCtxt){ + //TODO: Could use a qmlInfo() like function for script functions + qWarning() << "createQmlObject called with invalid parent object"; + return engine->nullValue(); + } if (url.isEmpty()) { url = qmlCtxt->resolvedUrl(QUrl(QLatin1String(""))); } else { -- cgit v0.12 From 4e8df537210736d8a723a409e5e01046efa44a39 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 4 Nov 2009 08:53:12 +1000 Subject: Position items in the correct order Nearly fixes QT-2241, but still waiting for a signal to appear in QGraphicsItem which allows up to reposition items after a change. --- .../graphicsitems/qmlgraphicspositioners.cpp | 21 +++++++++++------- .../graphicsitems/qmlgraphicspositioners_p.h | 1 + tests/auto/declarative/layouts/tst_layouts.cpp | 25 ++++++++++++++++++++++ 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/src/declarative/graphicsitems/qmlgraphicspositioners.cpp b/src/declarative/graphicsitems/qmlgraphicspositioners.cpp index f599025..b4544c5 100644 --- a/src/declarative/graphicsitems/qmlgraphicspositioners.cpp +++ b/src/declarative/graphicsitems/qmlgraphicspositioners.cpp @@ -209,7 +209,12 @@ void QmlGraphicsBasePositioner::prePositioning() QCoreApplication::postEvent(this, new QEvent(QEvent::User)); } QSet allItems; + //Need to order children by creation order modified by stacking order + //###can we avoid using the QGraphicsItemPrivate? QList children = childItems(); + qSort(children.begin(), children.end(), d->insertionOrder); + positionedItems = QList(); + for (int ii = 0; ii < children.count(); ++ii) { QmlGraphicsItem *child = qobject_cast(children.at(ii)); if (!child) @@ -234,6 +239,7 @@ void QmlGraphicsBasePositioner::prePositioning() d->_newItems+=child; } allItems += child; + positionedItems << child; } QSet deletedItems = d->_items - allItems; foreach(QmlGraphicsItem *child, d->_items){ @@ -497,9 +503,9 @@ void QmlGraphicsColumn::doPositioning() } } - QList children = childItems(); + QList children = positionedItems; for (int ii = 0; ii < children.count(); ++ii) { - QmlGraphicsItem *child = qobject_cast(children.at(ii)); + QmlGraphicsItem *child = children.at(ii); if (!child || isInvisible(child)) continue; @@ -653,9 +659,9 @@ void QmlGraphicsRow::doPositioning() applyRemove(changes, item); } } - QList children = childItems(); + QList children = positionedItems; for (int ii = 0; ii < children.count(); ++ii) { - QmlGraphicsItem *child = qobject_cast(children.at(ii)); + QmlGraphicsItem *child = children.at(ii); if (!child || isInvisible(child)) continue; @@ -859,7 +865,7 @@ void QmlGraphicsGrid::doPositioning() QList maxColWidth; QList maxRowHeight; int childIndex =0; - QList children = childItems(); + QList children = positionedItems; for (int i=0; i(children.at(childIndex++)); + QmlGraphicsItem *child = children.at(childIndex++); if (!child || isInvisible(child)) continue; if (child->width() > maxColWidth[j]) @@ -889,8 +895,7 @@ void QmlGraphicsGrid::doPositioning() applyRemove(changes, item); } } - foreach(QGraphicsItem* schild, children){ - QmlGraphicsItem *child = qobject_cast(schild); + foreach(QmlGraphicsItem* child, children){ if (!child || isInvisible(child)) continue; bool needMove = (child->x()!=xoffset)||(child->y()!=yoffset); diff --git a/src/declarative/graphicsitems/qmlgraphicspositioners_p.h b/src/declarative/graphicsitems/qmlgraphicspositioners_p.h index 0011ec5..56adc8b 100644 --- a/src/declarative/graphicsitems/qmlgraphicspositioners_p.h +++ b/src/declarative/graphicsitems/qmlgraphicspositioners_p.h @@ -104,6 +104,7 @@ private Q_SLOTS: protected: QmlGraphicsBasePositioner(QmlGraphicsBasePositionerPrivate &dd, AutoUpdateType at, QmlGraphicsItem *parent); void setMovingItem(QmlGraphicsItem *); + QList positionedItems; private: void applyTransition(const QList >& changes, QmlGraphicsItem* target, diff --git a/tests/auto/declarative/layouts/tst_layouts.cpp b/tests/auto/declarative/layouts/tst_layouts.cpp index b0df57ea..96729a3 100644 --- a/tests/auto/declarative/layouts/tst_layouts.cpp +++ b/tests/auto/declarative/layouts/tst_layouts.cpp @@ -58,6 +58,7 @@ private slots: void test_grid(); void test_grid_spacing(); + void test_repeater(); private: QmlView *createView(const QString &filename); }; @@ -222,6 +223,30 @@ void tst_QmlGraphicsLayouts::test_grid_spacing() QCOMPARE(five->y(), 54.0); } +void tst_QmlGraphicsLayouts::test_repeater() +{ + QmlView *canvas = createView("data/repeater.qml"); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsRectangle *one = canvas->root()->findChild("one"); + QVERIFY(one != 0); + + QmlGraphicsRectangle *two = canvas->root()->findChild("two"); + QVERIFY(two != 0); + + QmlGraphicsRectangle *three = canvas->root()->findChild("three"); + QVERIFY(three != 0); + + QCOMPARE(one->x(), 0.0); + QCOMPARE(one->y(), 0.0); + QCOMPARE(two->x(), 50.0); + QCOMPARE(two->y(), 0.0); + QCOMPARE(three->x(), 100.0); + QCOMPARE(three->y(), 0.0); +} + QmlView *tst_QmlGraphicsLayouts::createView(const QString &filename) { QmlView *canvas = new QmlView(0); -- cgit v0.12 From f3cce7a770f25c42d5c85b012df338fc712f5b2e Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 4 Nov 2009 11:57:42 +1000 Subject: Add tests for the the positioner transitions. --- .../declarative/layouts/data/grid-animated.qml | 55 ++++++ .../layouts/data/horizontal-animated.qml | 42 +++++ tests/auto/declarative/layouts/data/repeater.qml | 20 ++ .../declarative/layouts/data/vertical-animated.qml | 42 +++++ tests/auto/declarative/layouts/tst_layouts.cpp | 204 +++++++++++++++++++++ 5 files changed, 363 insertions(+) create mode 100644 tests/auto/declarative/layouts/data/grid-animated.qml create mode 100644 tests/auto/declarative/layouts/data/horizontal-animated.qml create mode 100644 tests/auto/declarative/layouts/data/repeater.qml create mode 100644 tests/auto/declarative/layouts/data/vertical-animated.qml diff --git a/tests/auto/declarative/layouts/data/grid-animated.qml b/tests/auto/declarative/layouts/data/grid-animated.qml new file mode 100644 index 0000000..9edccaf --- /dev/null +++ b/tests/auto/declarative/layouts/data/grid-animated.qml @@ -0,0 +1,55 @@ +import Qt 4.6 + +Item { + width: 640 + height: 480 + Grid { + columns: 3 + add: Transition { + NumberAnimation { + properties: "x,y"; from: -100 + } + } + remove: Transition { + NumberAnimation { + properties: "x,y"; to: -100 + } + } + move: Transition { + NumberAnimation { + properties: "x,y"; + } + } + Rectangle { + objectName: "one" + color: "red" + width: 50 + height: 50 + } + Rectangle { + objectName: "two" + opacity: 0 + color: "green" + width: 50 + height: 50 + } + Rectangle { + objectName: "three" + color: "blue" + width: 50 + height: 50 + } + Rectangle { + objectName: "four" + color: "cyan" + width: 50 + height: 50 + } + Rectangle { + objectName: "five" + color: "magenta" + width: 50 + height: 50 + } + } +} diff --git a/tests/auto/declarative/layouts/data/horizontal-animated.qml b/tests/auto/declarative/layouts/data/horizontal-animated.qml new file mode 100644 index 0000000..f757d18 --- /dev/null +++ b/tests/auto/declarative/layouts/data/horizontal-animated.qml @@ -0,0 +1,42 @@ +import Qt 4.6 + +Item { + width: 640 + height: 480 + Row { + add: Transition { + NumberAnimation { + properties: "x"; from: -100 + } + } + remove: Transition { + NumberAnimation { + properties: "x"; to: -100 + } + } + move: Transition { + NumberAnimation { + properties: "x"; + } + } + Rectangle { + objectName: "one" + color: "red" + width: 50 + height: 50 + } + Rectangle { + objectName: "two" + color: "blue" + opacity: 0 + width: 50 + height: 50 + } + Rectangle { + objectName: "three" + color: "red" + width: 50 + height: 50 + } + } +} diff --git a/tests/auto/declarative/layouts/data/repeater.qml b/tests/auto/declarative/layouts/data/repeater.qml new file mode 100644 index 0000000..2bc5e94 --- /dev/null +++ b/tests/auto/declarative/layouts/data/repeater.qml @@ -0,0 +1,20 @@ +import Qt 4.6 + +Item { + width: 640 + height: 480 + Row { + Repeater{ model: 3; + delegate: Component { + Rectangle { + color: "red" + width: 50 + height: 50 + z: {if(index == 0){2;}else if(index == 1){1;} else{3;}} + objectName: {if(index == 0){"one";}else if(index == 1){"two";} else{"three";}} + + } + } + } + } +} diff --git a/tests/auto/declarative/layouts/data/vertical-animated.qml b/tests/auto/declarative/layouts/data/vertical-animated.qml new file mode 100644 index 0000000..f52a78a --- /dev/null +++ b/tests/auto/declarative/layouts/data/vertical-animated.qml @@ -0,0 +1,42 @@ +import Qt 4.6 + +Item { + width: 640 + height: 480 + Column { + add: Transition { + NumberAnimation { + properties: "y"; from: -100 + } + } + remove: Transition { + NumberAnimation { + properties: "y"; to: -100 + } + } + move: Transition { + NumberAnimation { + properties: "y"; + } + } + Rectangle { + objectName: "one" + color: "red" + width: 50 + height: 50 + } + Rectangle { + objectName: "two" + color: "blue" + opacity: 0 + width: 50 + height: 50 + } + Rectangle { + objectName: "three" + color: "red" + width: 50 + height: 50 + } + } +} diff --git a/tests/auto/declarative/layouts/tst_layouts.cpp b/tests/auto/declarative/layouts/tst_layouts.cpp index 96729a3..c0c067a 100644 --- a/tests/auto/declarative/layouts/tst_layouts.cpp +++ b/tests/auto/declarative/layouts/tst_layouts.cpp @@ -53,10 +53,13 @@ public: private slots: void test_horizontal(); void test_horizontal_spacing(); + void test_horizontal_animated(); void test_vertical(); void test_vertical_spacing(); + void test_vertical_animated(); void test_grid(); void test_grid_spacing(); + void test_grid_animated(); void test_repeater(); private: @@ -115,6 +118,57 @@ void tst_QmlGraphicsLayouts::test_horizontal_spacing() QCOMPARE(three->y(), 0.0); } +void tst_QmlGraphicsLayouts::test_horizontal_animated() +{ + QmlView *canvas = createView(SRCDIR "/data/horizontal-animated.qml"); + + canvas->execute(); + qApp->processEvents(); + + QTest::qWait(0);//Let the animation start + //Note that one and three animate in + QmlGraphicsRectangle *one = canvas->root()->findChild("one"); + QVERIFY(one != 0); + QCOMPARE(one->x(), -100.0); + + QmlGraphicsRectangle *two = canvas->root()->findChild("two"); + QVERIFY(two != 0); + QCOMPARE(two->x(), 0.0); + + QmlGraphicsRectangle *three = canvas->root()->findChild("three"); + QVERIFY(three != 0); + QCOMPARE(three->x(), -100.0); + + QTest::qWait(300);//Let the animation complete + + QCOMPARE(one->x(), 0.0); + QCOMPARE(one->y(), 0.0); + QCOMPARE(two->opacity(), 0.0); + QCOMPARE(two->x(), 0.0); + QCOMPARE(two->y(), 0.0); + QCOMPARE(three->x(), 50.0); + QCOMPARE(three->y(), 0.0); + + //Add 'two' + two->setOpacity(1.0); + QCOMPARE(two->opacity(), 1.0); + QTest::qWait(0);//Let the animation start + QCOMPARE(two->x(), -100.0); + QCOMPARE(three->x(), 50.0); + QTest::qWait(300);//Let the animation complete + QCOMPARE(two->x(), 50.0); + QCOMPARE(three->x(), 100.0); + + //Remove 'two' + two->setOpacity(0.0); + QCOMPARE(two->opacity(), 0.0); + QCOMPARE(two->x(), 50.0); + QCOMPARE(three->x(), 100.0); + QTest::qWait(300);//Let the animation complete + QCOMPARE(two->x(), 50.0); + QCOMPARE(three->x(), 50.0); +} + void tst_QmlGraphicsLayouts::test_vertical() { QmlView *canvas = createView(SRCDIR "/data/vertical.qml"); @@ -163,6 +217,57 @@ void tst_QmlGraphicsLayouts::test_vertical_spacing() QCOMPARE(three->y(), 80.0); } +void tst_QmlGraphicsLayouts::test_vertical_animated() +{ + QmlView *canvas = createView(SRCDIR "/data/vertical-animated.qml"); + + canvas->execute(); + qApp->processEvents(); + + QTest::qWait(0);//Let the animation start + //Note that one and three animate in + QmlGraphicsRectangle *one = canvas->root()->findChild("one"); + QVERIFY(one != 0); + QCOMPARE(one->y(), -100.0); + + QmlGraphicsRectangle *two = canvas->root()->findChild("two"); + QVERIFY(two != 0); + QCOMPARE(two->y(), 0.0); + + QmlGraphicsRectangle *three = canvas->root()->findChild("three"); + QVERIFY(three != 0); + QCOMPARE(three->y(), -100.0); + + QTest::qWait(300);//Let the animation complete + + QCOMPARE(one->y(), 0.0); + QCOMPARE(one->x(), 0.0); + QCOMPARE(two->opacity(), 0.0); + QCOMPARE(two->y(), 0.0); + QCOMPARE(two->x(), 0.0); + QCOMPARE(three->y(), 50.0); + QCOMPARE(three->x(), 0.0); + + //Add 'two' + two->setOpacity(1.0); + QCOMPARE(two->opacity(), 1.0); + QTest::qWait(0);//Let the animation start + QCOMPARE(two->y(), -100.0); + QCOMPARE(three->y(), 50.0); + QTest::qWait(300);//Let the animation complete + QCOMPARE(two->y(), 50.0); + QCOMPARE(three->y(), 100.0); + + //Remove 'two' + two->setOpacity(0.0); + QCOMPARE(two->opacity(), 0.0); + QCOMPARE(two->y(), 50.0); + QCOMPARE(three->y(), 100.0); + QTest::qWait(300);//Let the animation complete + QCOMPARE(two->y(), 50.0); + QCOMPARE(three->y(), 50.0); +} + void tst_QmlGraphicsLayouts::test_grid() { QmlView *canvas = createView("data/grid.qml"); @@ -223,6 +328,105 @@ void tst_QmlGraphicsLayouts::test_grid_spacing() QCOMPARE(five->y(), 54.0); } +void tst_QmlGraphicsLayouts::test_grid_animated() +{ + QmlView *canvas = createView(SRCDIR "/data/grid-animated.qml"); + canvas->execute(); + qApp->processEvents(); + + QTest::qWait(0);//Let the animation start + //Note that all but two animate in + QmlGraphicsRectangle *one = canvas->root()->findChild("one"); + QVERIFY(one != 0); + QCOMPARE(one->x(), -100.0); + QCOMPARE(one->y(), -100.0); + + QmlGraphicsRectangle *two = canvas->root()->findChild("two"); + QVERIFY(two != 0); + QCOMPARE(two->x(), 0.0); + QCOMPARE(two->y(), 0.0); + + QmlGraphicsRectangle *three = canvas->root()->findChild("three"); + QVERIFY(three != 0); + QCOMPARE(three->x(), -100.0); + QCOMPARE(three->y(), -100.0); + + QmlGraphicsRectangle *four = canvas->root()->findChild("four"); + QVERIFY(four != 0); + QCOMPARE(four->x(), -100.0); + QCOMPARE(four->y(), -100.0); + + QmlGraphicsRectangle *five = canvas->root()->findChild("five"); + QVERIFY(five != 0); + QCOMPARE(five->x(), -100.0); + QCOMPARE(five->y(), -100.0); + + QTest::qWait(300);//Let the animation complete + + QCOMPARE(one->y(), 0.0); + QCOMPARE(one->x(), 0.0); + QCOMPARE(two->opacity(), 0.0); + QCOMPARE(two->y(), 0.0); + QCOMPARE(two->x(), 0.0); + QCOMPARE(three->y(), 0.0); + QCOMPARE(three->x(), 50.0); + QCOMPARE(four->y(), 0.0); + QCOMPARE(four->x(), 100.0); + QCOMPARE(five->y(), 50.0); + QCOMPARE(five->x(), 0.0); + + //Add 'two' + two->setOpacity(1.0); + QCOMPARE(two->opacity(), 1.0); + QTest::qWait(0);//Let the animation start + QCOMPARE(two->x(), -100.0); + QCOMPARE(two->y(), -100.0); + QCOMPARE(one->x(), 0.0); + QCOMPARE(one->y(), 0.0); + QCOMPARE(three->x(), 50.0); + QCOMPARE(three->y(), 0.0); + QCOMPARE(four->x(), 100.0); + QCOMPARE(four->y(), 0.0); + QCOMPARE(five->x(), 0.0); + QCOMPARE(five->y(), 50.0); + QTest::qWait(300);//Let the animation complete + QCOMPARE(two->x(), 50.0); + QCOMPARE(two->y(), 0.0); + QCOMPARE(one->x(), 0.0); + QCOMPARE(one->y(), 0.0); + QCOMPARE(three->x(), 100.0); + QCOMPARE(three->y(), 0.0); + QCOMPARE(four->x(), 0.0); + QCOMPARE(four->y(), 50.0); + QCOMPARE(five->x(), 50.0); + QCOMPARE(five->y(), 50.0); + + //Remove 'two' + two->setOpacity(0.0); + QCOMPARE(two->opacity(), 0.0); + QCOMPARE(two->x(), 50.0); + QCOMPARE(two->y(), 0.0); + QCOMPARE(one->x(), 0.0); + QCOMPARE(one->y(), 0.0); + QCOMPARE(three->x(), 100.0); + QCOMPARE(three->y(), 0.0); + QCOMPARE(four->x(), 0.0); + QCOMPARE(four->y(), 50.0); + QCOMPARE(five->x(), 50.0); + QCOMPARE(five->y(), 50.0); + QTest::qWait(300);//Let the animation complete + QCOMPARE(two->x(), 50.0); + QCOMPARE(two->y(), 0.0); + QCOMPARE(one->x(), 0.0); + QCOMPARE(one->y(), 0.0); + QCOMPARE(three->x(), 50.0); + QCOMPARE(three->y(), 0.0); + QCOMPARE(four->x(), 100.0); + QCOMPARE(four->y(), 0.0); + QCOMPARE(five->x(), 0.0); + QCOMPARE(five->y(), 50.0); +} + void tst_QmlGraphicsLayouts::test_repeater() { QmlView *canvas = createView("data/repeater.qml"); -- cgit v0.12 From 8fbff4dffd53546e4c3acecd0a9700a7ad970c83 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 5 Nov 2009 13:48:33 +1000 Subject: Test more ListView. --- tests/auto/declarative/listview/tst_listview.cpp | 94 ++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/tests/auto/declarative/listview/tst_listview.cpp b/tests/auto/declarative/listview/tst_listview.cpp index 6bf1080..b8f87b7 100644 --- a/tests/auto/declarative/listview/tst_listview.cpp +++ b/tests/auto/declarative/listview/tst_listview.cpp @@ -70,6 +70,8 @@ private slots: void qAbstractItemModel_moved(); void enforceRange(); + void spacing(); + void sections(); private: template void items(); @@ -264,6 +266,13 @@ void tst_QmlGraphicsListView::items() listview->decrementCurrentIndex(); QCOMPARE(listview->currentIndex(), 0); + // set an empty model and confirm that items are destroyed + T model2; + ctxt->setContextProperty("testModel", &model2); + + int itemCount = findItems(viewport, "wrapper").count(); + QVERIFY(itemCount == 0); + delete canvas; } @@ -632,6 +641,91 @@ void tst_QmlGraphicsListView::enforceRange() delete canvas; } +void tst_QmlGraphicsListView::spacing() +{ + QmlView *canvas = createView(SRCDIR "/data/listview.qml"); + + TestModel model; + for (int i = 0; i < 30; i++) + model.addItem("Item" + QString::number(i), ""); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsListView *listview = findItem(canvas->root(), "list"); + QVERIFY(listview != 0); + + QmlGraphicsItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + // Confirm items positioned correctly + int itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->y() == i*20); + } + + listview->setSpacing(10); + + // Confirm items positioned correctly + itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->y() == i*30); + } + + listview->setSpacing(0); + + // Confirm items positioned correctly + itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->y() == i*20); + } + + delete canvas; +} + +void tst_QmlGraphicsListView::sections() +{ + QmlView *canvas = createView(SRCDIR "/data/listview-sections.qml"); + + TestModel model; + for (int i = 0; i < 30; i++) + model.addItem("Item" + QString::number(i), ""); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsListView *listview = findItem(canvas->root(), "list"); + QVERIFY(listview != 0); + + QmlGraphicsItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + // Confirm items positioned correctly + int itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + QVERIFY(item); + QCOMPARE(item->y(), qreal(i*20 + ((i+4)/5) * 20)); + } + + delete canvas; +} + void tst_QmlGraphicsListView::qListModelInterface_items() { items(); -- cgit v0.12 From f3bd54db65b88560a079ee19bfebb3f17004bef3 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Thu, 5 Nov 2009 14:10:04 +1000 Subject: mark untested features --- tests/auto/declarative/qmlqt/tst_qmlqt.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/auto/declarative/qmlqt/tst_qmlqt.cpp b/tests/auto/declarative/qmlqt/tst_qmlqt.cpp index cc9b94d..e9c9052 100644 --- a/tests/auto/declarative/qmlqt/tst_qmlqt.cpp +++ b/tests/auto/declarative/qmlqt/tst_qmlqt.cpp @@ -270,11 +270,13 @@ void tst_qmlqt::closestAngle() void tst_qmlqt::playSound() { QEXPECT_FAIL("", "How do we test this?", Abort); + QVERIFY(false); } void tst_qmlqt::openUrlExternally() { QEXPECT_FAIL("", "How do we test this?", Abort); + QVERIFY(false); } QTEST_MAIN(tst_qmlqt) -- cgit v0.12 From 0ef5d89b540be963d1a8131f6625f990a4fe66e8 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Thu, 5 Nov 2009 14:03:47 +1000 Subject: Particles cleaned up and placed in in qmlgraphics/ API changes: Removed bool streamIn Added int emissionRate Added int emissionVariance Added void burst(count, emissionRate=-1) While rewriting the internals to accomodate this, all other outstanding particles bugs were believed fixed. Task-number: QT-2392 QT-2391 QT-2390 QT-2406 --- demos/declarative/minehunt/Explosion.qml | 7 +- demos/declarative/samegame/content/BoomBlock.qml | 12 +- doc/src/declarative/advtutorial4.qdoc | 6 +- .../samegame/samegame4/content/BoomBlock.qml | 13 +- src/declarative/QmlChanges.txt | 2 + src/declarative/extra/extra.pri | 2 - src/declarative/extra/qmlgraphicsparticles.cpp | 1134 ----------------- src/declarative/extra/qmlgraphicsparticles_p.h | 230 ---- src/declarative/graphicsitems/graphicsitems.pri | 2 + .../graphicsitems/qmlgraphicsparticles.cpp | 1278 ++++++++++++++++++++ .../graphicsitems/qmlgraphicsparticles_p.h | 252 ++++ .../qmlgraphicsparticles/data/particles.qml | 2 +- .../tst_qmlgraphicsparticles.cpp | 7 +- 13 files changed, 1558 insertions(+), 1389 deletions(-) delete mode 100644 src/declarative/extra/qmlgraphicsparticles.cpp delete mode 100644 src/declarative/extra/qmlgraphicsparticles_p.h create mode 100644 src/declarative/graphicsitems/qmlgraphicsparticles.cpp create mode 100644 src/declarative/graphicsitems/qmlgraphicsparticles_p.h diff --git a/demos/declarative/minehunt/Explosion.qml b/demos/declarative/minehunt/Explosion.qml index a997048..e337c46 100644 --- a/demos/declarative/minehunt/Explosion.qml +++ b/demos/declarative/minehunt/Explosion.qml @@ -16,13 +16,10 @@ Item { velocity: 100 velocityDeviation: 20 z: 100 - opacity: 0 - streamIn: false + opacity: 1 } states: [ State { name: "exploding"; when: explode == true - PropertyChanges { target: particles; count: 200 } - PropertyChanges { target: particles; opacity: 1 } - PropertyChanges { target: particles; emitting: false } // i.e. emit only once + StateChangeScript {script: particles.burst(200); } } ] diff --git a/demos/declarative/samegame/content/BoomBlock.qml b/demos/declarative/samegame/content/BoomBlock.qml index b0c297b..723e62a 100644 --- a/demos/declarative/samegame/content/BoomBlock.qml +++ b/demos/declarative/samegame/content/BoomBlock.qml @@ -26,9 +26,11 @@ Item { id:block } Particles { id: particles - width:1; height:1; anchors.centerIn: parent; opacity: 0 - lifeSpan: 700; lifeSpanDeviation: 600; count:0; streamIn: false - angle: 0; angleDeviation: 360; velocity: 100; velocityDeviation:30 + width:1; height:1; anchors.centerIn: parent; + emissionRate: 0; + lifeSpan: 700; lifeSpanDeviation: 600; + angle: 0; angleDeviation: 360; + velocity: 100; velocityDeviation:30; source: { if(type == 0){ "pics/redStar.png"; @@ -45,9 +47,7 @@ Item { id:block PropertyChanges { target: img; opacity: 1 } }, State{ name: "DeathState"; when: dying == true - PropertyChanges { target: particles; count: 50 } - PropertyChanges { target: particles; opacity: 1 } - PropertyChanges { target: particles; emitting: false } // i.e. emit only once + StateChangeScript { script: particles.burst(50); } PropertyChanges { target: img; opacity: 0 } StateChangeScript { script: block.destroy(1000); } } diff --git a/doc/src/declarative/advtutorial4.qdoc b/doc/src/declarative/advtutorial4.qdoc index e30fe84..5f8c0e9 100644 --- a/doc/src/declarative/advtutorial4.qdoc +++ b/doc/src/declarative/advtutorial4.qdoc @@ -106,9 +106,9 @@ the block, like so: \snippet declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 3 -To fully understand this you'll want to look at the Particles element documentation, but it's important to note that count is set -to zero. -We next extend the 'dying' state, which triggers the particles by setting the count to non-zero. The code for the states now look +To fully understand this you'll want to look at the Particles element documentation, but it's important to note that emissionRate is set +to zero, so that no particles are emitted normally. +We next extend the 'dying' state, which creates a burst of particles by calling the burst method on the particles element. The code for the states now look like this: \snippet declarative/tutorials/samegame/samegame4/content/BoomBlock.qml 4 diff --git a/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml b/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml index 7ad8b07..4c2ba43 100644 --- a/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml +++ b/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml @@ -31,9 +31,11 @@ Item { id:block //![3] Particles { id: particles - width:1; height:1; anchors.centerIn: parent; opacity: 0 - lifeSpan: 700; lifeSpanDeviation: 600; count:0; streamIn: false - angle: 0; angleDeviation: 360; velocity: 100; velocityDeviation:30 + width:1; height:1; anchors.centerIn: parent; + emissionRate: 0; + lifeSpan: 700; lifeSpanDeviation: 600; + angle: 0; angleDeviation: 360; + velocity: 100; velocityDeviation:30; source: { if(type == 0){ "pics/redStar.png"; @@ -52,10 +54,9 @@ Item { id:block PropertyChanges { target: img; opacity: 1 } }, State{ name: "DeathState"; when: dying == true - PropertyChanges { target: particles; count: 50 } - PropertyChanges { target: particles; opacity: 1 } - PropertyChanges { target: particles; emitting: false } // i.e. emit only once + StateChangeScript { script: particles.burst(50); } PropertyChanges { target: img; opacity: 0 } + StateChangeScript { script: block.destroy(1000); } } ] //![4] diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt index 465ee9e..c85ef77 100644 --- a/src/declarative/QmlChanges.txt +++ b/src/declarative/QmlChanges.txt @@ -82,6 +82,7 @@ Loader: add sourceComponent property Loader: add resizeMode property ListView: preferredHighlightBegin, preferredHighlightEnd ListView: strictlyEnforceHighlightRange +Particles: Added emissionRate, emissionVariance and burst() Deletions: Column/VerticalPositioner: lost "margins" property @@ -92,6 +93,7 @@ Flickable: removed "dragMode" property ComponentInstance: removed. Replaced by Loader.sourceComponent ListView: removed currentItemMode. Replaced by highligh range. ListView: removed snapPos. +Particles: removed streamIn. Replaced by emissionRate Other Changes: ids must be lowercase: Text { id: foo }, not Text { id: Foo } diff --git a/src/declarative/extra/extra.pri b/src/declarative/extra/extra.pri index 9d0e760..a81416d 100644 --- a/src/declarative/extra/extra.pri +++ b/src/declarative/extra/extra.pri @@ -4,7 +4,6 @@ SOURCES += \ extra/qmldatetimeformatter.cpp \ extra/qmlgraphicsintegermodel.cpp \ extra/qmlgraphicsanimatedimageitem.cpp \ - extra/qmlgraphicsparticles.cpp \ extra/qmlbehavior.cpp \ extra/qmlfontloader.cpp @@ -15,7 +14,6 @@ HEADERS += \ extra/qmlgraphicsintegermodel_p.h \ extra/qmlgraphicsanimatedimageitem_p.h \ extra/qmlgraphicsanimatedimageitem_p_p.h \ - extra/qmlgraphicsparticles_p.h \ extra/qmlbehavior_p.h \ extra/qmlfontloader_p.h diff --git a/src/declarative/extra/qmlgraphicsparticles.cpp b/src/declarative/extra/qmlgraphicsparticles.cpp deleted file mode 100644 index 0349a4e..0000000 --- a/src/declarative/extra/qmlgraphicsparticles.cpp +++ /dev/null @@ -1,1134 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "private/qmlgraphicsitem_p.h" - -#include -#include -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#define M_PI_2 (M_PI / 2.) -#endif -#ifndef INT_MAX -#define INT_MAX 2147483647 -#endif -#include -#include -#include -#include - -#include "qmlgraphicsparticles_p.h" -#include -#include -#include - -QT_BEGIN_NAMESPACE -#define PI_SQR 9.8696044 -// parabolic approximation -inline qreal fastSin(qreal theta) -{ - const qreal b = 4 / M_PI; - const qreal c = -4 / PI_SQR; - - qreal y = b * theta + c * theta * qAbs(theta); - return y; -} - -inline qreal fastCos(qreal theta) -{ - theta += M_PI_2; - if (theta > M_PI) - theta -= 2 * M_PI; - - return fastSin(theta); -} - -class QmlGraphicsParticle -{ -public: - QmlGraphicsParticle(int time) : lifeSpan(1000), fadeOutAge(800) - , opacity(0), birthTime(time), x_velocity(0), y_velocity(0) - , state(FadeIn), data(0) - { - } - - int lifeSpan; - int fadeOutAge; - qreal x; - qreal y; - qreal opacity; - int birthTime; - qreal x_velocity; - qreal y_velocity; - enum State { FadeIn, Solid, FadeOut }; - State state; - void *data; -}; - -//--------------------------------------------------------------------------- - -QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotion,QmlGraphicsParticleMotion) - -/*! - \class QmlGraphicsParticleMotion - \ingroup group_effects - \brief The QmlGraphicsParticleMotion class is the base class for particle motion. - \internal - - This class causes the particles to remain static. -*/ - -/*! - Constructs a QmlGraphicsParticleMotion with parent object \a parent. -*/ -QmlGraphicsParticleMotion::QmlGraphicsParticleMotion(QObject *parent) : - QObject(parent) -{ -} - -/*! - Move the \a particle to its new position. \a interval is the number of - milliseconds elapsed since it was last moved. -*/ -void QmlGraphicsParticleMotion::advance(QmlGraphicsParticle &particle, int interval) -{ - Q_UNUSED(particle); - Q_UNUSED(interval); -} - -/*! - The \a particle has just been created. Some motion strategies require - additional state information. This can be allocated by this function. -*/ -void QmlGraphicsParticleMotion::created(QmlGraphicsParticle &particle) -{ - Q_UNUSED(particle); -} - -/*! - The \a particle is about to be destroyed. Any additional memory - that has been allocated for the particle should be freed. -*/ -void QmlGraphicsParticleMotion::destroy(QmlGraphicsParticle &particle) -{ - Q_UNUSED(particle); -} - -/*! - \qmlclass ParticleMotionLinear - \brief The ParticleMotionLinear object moves particles linearly. - - \sa Particles -*/ - -/*! - \internal - \class QmlGraphicsParticleMotionLinear - \ingroup group_effects - \brief The QmlGraphicsParticleMotionLinear class moves the particles linearly. -*/ - -QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotionLinear,QmlGraphicsParticleMotionLinear) - -void QmlGraphicsParticleMotionLinear::advance(QmlGraphicsParticle &p, int interval) -{ - p.x += interval * p.x_velocity; - p.y += interval * p.y_velocity; -} - -/*! - \qmlclass ParticleMotionGravity - \brief The ParticleMotionGravity object moves particles towards a point. - - \sa Particles -*/ - -/*! - \internal - \class QmlGraphicsParticleMotionGravity - \ingroup group_effects - \brief The QmlGraphicsParticleMotionGravity class moves the particles towards a point. -*/ - -QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotionGravity,QmlGraphicsParticleMotionGravity) - -/*! - \qmlproperty int ParticleMotionGravity::xattractor - \qmlproperty int ParticleMotionGravity::yattractor - These properties hold the x and y coordinates of the point attracting the particles. -*/ - -/*! - \qmlproperty int ParticleMotionGravity::acceleration - This property holds the acceleration to apply to the particles. -*/ - -/*! - \property QmlGraphicsParticleMotionGravity::xattractor - \brief the x coordinate of the point attracting the particles. -*/ - -/*! - \property QmlGraphicsParticleMotionGravity::yattractor - \brief the y coordinate of the point attracting the particles. -*/ - -/*! - \property QmlGraphicsParticleMotionGravity::acceleration - \brief the acceleration to apply to the particles. -*/ - -void QmlGraphicsParticleMotionGravity::advance(QmlGraphicsParticle &p, int interval) -{ - qreal xdiff = p.x - _xAttr; - qreal ydiff = p.y - _yAttr; - - qreal xcomp = xdiff / (xdiff + ydiff); - qreal ycomp = ydiff / (xdiff + ydiff); - - p.x_velocity += xcomp * _accel * interval; - p.y_velocity += ycomp * _accel * interval; - - p.x += interval * p.x_velocity; - p.y += interval * p.y_velocity; -} - -/*! - \qmlclass ParticleMotionWander - \brief The ParticleMotionWander object moves particles in a somewhat random fashion. - - The particles will continue roughly in the original direction, however will randomly - drift to each side. - - The code below produces an effect similar to falling snow. - - \qml -Rectangle { - width: 240 - height: 320 - color: "black" - - Particles { - y: 0 - width: parent.width - height: 30 - source: "star.png" - lifeSpan: 5000 - count: 50 - angle: 70 - angleDeviation: 36 - velocity: 30 - velocityDeviation: 10 - ParticleMotionWander { - xvariance: 30 - pace: 100 - } - } -} - \endqml - - \sa Particles -*/ - -/*! - \internal - \class QmlGraphicsParticleMotionWander - \ingroup group_effects - \brief The QmlGraphicsParticleMotionWander class moves particles in a somewhat random fashion. - - The particles will continue roughly in the original direction, however will randomly - drift to each side. -*/ - -/*! - \qmlproperty int QmlGraphicsParticleMotionWander::xvariance - \qmlproperty int QmlGraphicsParticleMotionWander::yvariance - - These properties set the amount to wander in the x and y directions. -*/ - -/*! - \qmlproperty int QmlGraphicsParticleMotionWander::pace - This property holds how quickly the paricles will move from side to side. -*/ - -QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotionWander,QmlGraphicsParticleMotionWander) - -void QmlGraphicsParticleMotionWander::advance(QmlGraphicsParticle &p, int interval) -{ - if (!particles) - particles = qobject_cast(parent()); - if (particles) { - Data *d = (Data*)p.data; - if (_xvariance != 0.) { - qreal xdiff = p.x_velocity - d->x_targetV; - if ((xdiff > d->x_peak && d->x_var > 0.0) || (xdiff < -d->x_peak && d->x_var < 0.0)) { - d->x_var = -d->x_var; - d->x_peak = _xvariance + _xvariance * qreal(rand()) / RAND_MAX; - } - p.x_velocity += d->x_var * interval; - } - p.x += interval * p.x_velocity; - - if (_yvariance != 0.) { - qreal ydiff = p.y_velocity - d->y_targetV; - if ((ydiff > d->y_peak && d->y_var > 0.0) || (ydiff < -d->y_peak && d->y_var < 0.0)) { - d->y_var = -d->y_var; - d->y_peak = _yvariance + _yvariance * qreal(rand()) / RAND_MAX; - } - p.y_velocity += d->y_var * interval; - } - p.y += interval * p.y_velocity; - } -} - -void QmlGraphicsParticleMotionWander::created(QmlGraphicsParticle &p) -{ - if (!p.data) { - Data *d = new Data; - p.data = (void*)d; - d->x_targetV = p.x_velocity; - d->y_targetV = p.y_velocity; - d->x_peak = _xvariance; - d->y_peak = _yvariance; - d->x_var = _pace * qreal(rand()) / RAND_MAX / 1000.0; - d->y_var = _pace * qreal(rand()) / RAND_MAX / 1000.0; - } -} - -void QmlGraphicsParticleMotionWander::destroy(QmlGraphicsParticle &p) -{ - if (p.data) - delete (Data*)p.data; -} - -//--------------------------------------------------------------------------- -class QmlGraphicsParticlesPainter : public QmlGraphicsItem -{ -public: - QmlGraphicsParticlesPainter(QmlGraphicsParticlesPrivate *p, QmlGraphicsItem* parent) - : QmlGraphicsItem(parent), d(p) - { - setFlag(QGraphicsItem::ItemHasNoContents, false); - maxX = minX = maxY = minY = 0; - } - - void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); - - void updateSize(); - - qreal maxX; - qreal minX; - qreal maxY; - qreal minY; - QmlGraphicsParticlesPrivate* d; -}; - -//--------------------------------------------------------------------------- -class QmlGraphicsParticlesPrivate : public QmlGraphicsItemPrivate -{ - Q_DECLARE_PUBLIC(QmlGraphicsParticles) -public: - QmlGraphicsParticlesPrivate() - : count(1), lifeSpan(1000), lifeSpanDev(1000), fadeInDur(200), fadeOutDur(300) - , angle(0), angleDev(0), velocity(0), velocityDev(0) - , addParticleTime(0), addParticleCount(0), lastAdvTime(0), stream(false), streamDelay(0) - , emitting(true), motion(0), pendingPixmapCache(false), clock(this) - { - } - - ~QmlGraphicsParticlesPrivate() - { - } - - void init() - { - Q_Q(QmlGraphicsParticles); - paintItem = new QmlGraphicsParticlesPainter(this, q); - } - - void tick(int time); - void createParticle(int time); - void updateOpacity(QmlGraphicsParticle &p, int age); - - QUrl url; - QPixmap image; - int count; - int lifeSpan; - int lifeSpanDev; - int fadeInDur; - int fadeOutDur; - qreal angle; - qreal angleDev; - qreal velocity; - qreal velocityDev; - int addParticleTime; - int addParticleCount; - int lastAdvTime; - bool stream; - int streamDelay; - bool emitting; - QmlGraphicsParticleMotion *motion; - QmlGraphicsParticlesPainter *paintItem; - - bool pendingPixmapCache; - - QList particles; - QTickAnimationProxy clock; - -}; - -void QmlGraphicsParticlesPrivate::tick(int time) -{ - Q_Q(QmlGraphicsParticles); - if (!motion) - motion = new QmlGraphicsParticleMotionLinear(q); - - int oldCount = particles.count(); - int removed = 0; - int interval = time - lastAdvTime; - for (int i = 0; i < particles.count(); ) { - QmlGraphicsParticle &particle = particles[i]; - int age = time - particle.birthTime; - if (age >= particle.lifeSpan) { - QmlGraphicsParticle part = particles.takeAt(i); - motion->destroy(part); - ++removed; - } else { - updateOpacity(particle, age); - motion->advance(particle, interval); - ++i; - } - } - - while(removed-- && particles.count() < count && emitting) - createParticle(time); - - if (!addParticleTime) - addParticleTime = time; - - if (particles.count() < count && emitting) { - qreal perc = (lifeSpanDev <= 0)?(1.):(qreal(time - addParticleTime) / qreal(lifeSpanDev)); - int percCount = addParticleCount + (int)perc * (count - addParticleCount); - int streamWidth = -1; - if (stream){ - if (streamDelay > time){ - streamWidth = 0; - }else{ - int missed = time - streamDelay; - qreal streamWidthReal = qreal(count)/qreal(lifeSpan); - if (streamWidthReal < 1){ - streamDelay = time + (int)(1.0/streamWidthReal); - streamWidth = 1; - streamWidth += missed/streamDelay; - }else{ - streamWidth = qRound(streamWidthReal * (time-lastAdvTime)); - } - } - } - while(particles.count() < count && - (!stream || (particles.count() < percCount && streamWidth--))) - createParticle(time); - } - - lastAdvTime = time; - paintItem->updateSize(); - paintItem->update(); - if (!(oldCount || particles.count()) && (!count || !emitting)) { - lastAdvTime = 0; - clock.stop(); - } -} - -void QmlGraphicsParticlesPrivate::createParticle(int time) -{ -#ifdef Q_ENABLE_PERFORMANCE_LOG - QmlPerfTimer x; -#endif - Q_Q(QmlGraphicsParticles); - QmlGraphicsParticle p(time); - p.x = q->x() + q->width() * qreal(rand()) / RAND_MAX - image.width()/2.0; - p.y = q->y() + q->height() * qreal(rand()) / RAND_MAX - image.height()/2.0; - p.lifeSpan = lifeSpan; - if (lifeSpanDev) - p.lifeSpan += int(lifeSpanDev/2 - lifeSpanDev * qreal(rand()) / RAND_MAX); - p.fadeOutAge = p.lifeSpan - fadeOutDur; - if (fadeInDur == 0.) { - p.state= QmlGraphicsParticle::Solid; - p.opacity = 1.0; - } - qreal a = angle; - if (angleDev) - a += angleDev/2 - angleDev * qreal(rand()) / RAND_MAX; - if (a > M_PI) - a = a - 2 * M_PI; - qreal v = velocity; - if (velocityDev) - v += velocityDev/2 - velocityDev * qreal(rand()) / RAND_MAX; - p.x_velocity = v * fastCos(a); - p.y_velocity = v * fastSin(a); - particles.append(p); - motion->created(particles.last()); -} - -void QmlGraphicsParticlesPrivate::updateOpacity(QmlGraphicsParticle &p, int age) -{ - switch (p.state) { - case QmlGraphicsParticle::FadeIn: - if (age <= fadeInDur) { - p.opacity = qreal(age) / fadeInDur; - break; - } else { - p.opacity = 1.0; - p.state = QmlGraphicsParticle::Solid; - // Fall through - } - case QmlGraphicsParticle::Solid: - if (age <= p.fadeOutAge) { - break; - } else { - p.state = QmlGraphicsParticle::FadeOut; - // Fall through - } - case QmlGraphicsParticle::FadeOut: - p.opacity = qreal(p.lifeSpan - age) / fadeOutDur; - break; - } -} - -QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Particles,QmlGraphicsParticles) - -/*! - \qmlclass Particles - \brief The Particles object generates and moves particles. - \inherits Item - - The particles created by this object cannot be dealt with directly, they can only be controlled through the parameters of the Particles object. The particles are all the same pixmap, specified by the user. - - The particles are painted relative to the parent of the Particles object. Moving the - Particles object will not move the particles already emitted. - - The below example creates two differently behaving particle sources. - The top one has particles falling from the top like snow, - the lower one has particles expelled up like a fountain. - - \qml -Rectangle { - width: 240 - height: 320 - color: "black" - Particles { - y: 0 - width: parent.width - height: 30 - source: "star.png" - lifeSpan: 5000 - count: 50 - angle: 70 - angleDeviation: 36 - velocity: 30 - velocityDeviation: 10 - ParticleMotionWander { - xvariance: 30 - pace: 100 - } - } - Particles { - y: 300 - x: 120 - width: 1 - height: 1 - source: "star.png" - lifeSpan: 5000 - count: 200 - angle: 270 - angleDeviation: 45 - velocity: 50 - velocityDeviation: 30 - ParticleMotionGravity { - yattractor: 1000 - xattractor: 0 - acceleration: 25 - } - } -} - \endqml - \image particles.gif -*/ - -/*! - \internal - \class QmlGraphicsParticles - \ingroup group_effects - \brief The QmlGraphicsParticles class generates and moves particles. -*/ - -QmlGraphicsParticles::QmlGraphicsParticles(QmlGraphicsItem *parent) - : QmlGraphicsItem(*(new QmlGraphicsParticlesPrivate), parent) -{ - Q_D(QmlGraphicsParticles); - d->init(); -} - -QmlGraphicsParticles::QmlGraphicsParticles(QmlGraphicsParticlesPrivate &dd, QmlGraphicsItem *parent) - : QmlGraphicsItem(dd, parent) -{ - Q_D(QmlGraphicsParticles); - d->init(); -} - -QmlGraphicsParticles::~QmlGraphicsParticles() -{ - Q_D(QmlGraphicsParticles); - if (d->pendingPixmapCache) - QmlPixmapCache::cancelGet(d->url, this); -} - -/*! - \qmlproperty string Particles::src - This property holds the URL of the particle image. -*/ - -/*! - \property QmlGraphicsParticles::source - \brief the URL of the particle image. -*/ -QUrl QmlGraphicsParticles::source() const -{ - Q_D(const QmlGraphicsParticles); - return d->url; -} - -void QmlGraphicsParticles::imageLoaded() -{ - Q_D(QmlGraphicsParticles); - d->pendingPixmapCache = false; - QmlPixmapCache::find(d->url, &d->image); - d->paintItem->updateSize(); - d->paintItem->update(); -} - -void QmlGraphicsParticles::setSource(const QUrl &name) -{ - Q_D(QmlGraphicsParticles); - - if ((d->url.isEmpty() == name.isEmpty()) && name == d->url) - return; - - if (d->pendingPixmapCache) { - QmlPixmapCache::cancelGet(d->url, this); - d->pendingPixmapCache = false; - } - if (name.isEmpty()) { - d->url = name; - d->image = QPixmap(); - d->paintItem->updateSize(); - d->paintItem->update(); - } else { - d->url = name; - Q_ASSERT(!name.isRelative()); - QNetworkReply *reply = QmlPixmapCache::get(qmlEngine(this), d->url, &d->image); - if (reply) { - connect(reply, SIGNAL(finished()), this, SLOT(imageLoaded())); - d->pendingPixmapCache = true; - } else { - //### unify with imageLoaded - d->paintItem->updateSize(); - d->paintItem->update(); - } - } -} - -/*! - \qmlproperty int Particles::count - This property holds the target number of particles -*/ - -/*! - \property QmlGraphicsParticles::count - \brief the target number of particles -*/ -int QmlGraphicsParticles::count() const -{ - Q_D(const QmlGraphicsParticles); - return d->count; -} - -void QmlGraphicsParticles::setCount(int cnt) -{ - Q_D(QmlGraphicsParticles); - if (cnt == d->count) - return; - - int oldCount = d->count; - d->count = cnt; - d->addParticleTime = 0; - d->addParticleCount = d->particles.count(); - if (!oldCount && d->clock.state() != QAbstractAnimation::Running && d->count) { - d->clock.start(); - } - d->paintItem->updateSize(); - d->paintItem->update(); -} - -/*! - \qmlproperty int Particles::lifeSpan - \qmlproperty int Particles::lifeSpanDeviation - - These properties describe the life span of each particle. - - The default lifespan for a particle is 1000ms. - - lifeSpanDeviation randomly varies the lifeSpan up to the specified variation. For - example, the following creates particles whose lifeSpan will vary - from 150ms to 250ms: - - \qml -Particles { - source: "star.png" - lifeSpan: 200 - lifeSpanDeviation: 100 -} - \endqml -*/ - -/*! - \property QmlGraphicsParticles::lifeSpan - \brief the life span of each particle. - - Default value is 1000ms. - - \sa QmlGraphicsParticles::lifeSpanDeviation -*/ -int QmlGraphicsParticles::lifeSpan() const -{ - Q_D(const QmlGraphicsParticles); - return d->lifeSpan; -} - -void QmlGraphicsParticles::setLifeSpan(int ls) -{ - Q_D(QmlGraphicsParticles); - d->lifeSpan = ls; -} - -/*! - \property QmlGraphicsParticles::lifeSpanDeviation - \brief the maximum possible deviation from the set lifeSpan. - - Randomly varies the lifeSpan up to the specified variation. For - example, the following creates particles whose lifeSpan will vary - from 150ms to 250ms: - -\qml -Particles { - source: "star.png" - lifeSpan: 200 - lifeSpanDeviation: 100 -} -\endqml - - \sa QmlGraphicsParticles::lifeSpan -*/ -int QmlGraphicsParticles::lifeSpanDeviation() const -{ - Q_D(const QmlGraphicsParticles); - return d->lifeSpanDev; -} - -void QmlGraphicsParticles::setLifeSpanDeviation(int dev) -{ - Q_D(QmlGraphicsParticles); - d->lifeSpanDev = dev; -} - -/*! - \qmlproperty int Particles::fadeInDuration - \qmlproperty int Particles::fadeOutDuration - These properties hold the time taken to fade the particles in and out. - - By default fade in is 200ms and fade out is 300ms. -*/ - -/*! - \property QmlGraphicsParticles::fadeInDuration - \brief the time taken to fade in the particles. - - Default value is 200ms. -*/ -int QmlGraphicsParticles::fadeInDuration() const -{ - Q_D(const QmlGraphicsParticles); - return d->fadeInDur; -} - -void QmlGraphicsParticles::setFadeInDuration(int dur) -{ - Q_D(QmlGraphicsParticles); - if (dur >= 0.0) - d->fadeInDur = dur; -} - -/*! - \property QmlGraphicsParticles::fadeOutDuration - \brief the time taken to fade out the particles. - - Default value is 300ms. -*/ -int QmlGraphicsParticles::fadeOutDuration() const -{ - Q_D(const QmlGraphicsParticles); - return d->fadeOutDur; -} - -void QmlGraphicsParticles::setFadeOutDuration(int dur) -{ - Q_D(QmlGraphicsParticles); - if (dur >= 0.0) - d->fadeOutDur = dur; -} - -/*! - \qmlproperty real Particles::angle - \qmlproperty real Particles::angleDeviation - - These properties control particle direction. - - angleDeviation randomly varies the direction up to the specified variation. For - example, the following creates particles whose initial direction will - vary from 15 degrees to 105 degrees: - - \qml -Particles { - source: "star.png" - angle: 60 - angleDeviation: 90 -} - \endqml -*/ - -/*! - \property QmlGraphicsParticles::angle - \brief the initial angle of direction. - - \sa QmlGraphicsParticles::angleDeviation -*/ -qreal QmlGraphicsParticles::angle() const -{ - Q_D(const QmlGraphicsParticles); - return d->angle * 180.0 / M_PI; -} - -void QmlGraphicsParticles::setAngle(qreal angle) -{ - Q_D(QmlGraphicsParticles); - d->angle = angle * M_PI / 180.0; -} - -/*! - \property QmlGraphicsParticles::angleDeviation - \brief the maximum possible deviation from the set angle. - - Randomly varies the direction up to the specified variation. For - example, the following creates particles whose initial direction will - vary from 15 degrees to 105 degrees: - -\qml -Particles { - source: "star.png" - angle: 60 - angleDeviation: 90 -} -\endqml - - \sa QmlGraphicsParticles::angle -*/ -qreal QmlGraphicsParticles::angleDeviation() const -{ - Q_D(const QmlGraphicsParticles); - return d->angleDev * 180.0 / M_PI; -} - -void QmlGraphicsParticles::setAngleDeviation(qreal dev) -{ - Q_D(QmlGraphicsParticles); - d->angleDev = dev * M_PI / 180.0;; -} - -/*! - \qmlproperty real Particles::velocity - \qmlproperty real Particles::velocityDeviation - - These properties control the velocity of the particles. - - velocityDeviation randomly varies the velocity up to the specified variation. For - example, the following creates particles whose initial velocity will - vary from 40 to 60. - - \qml -Particles { - source: "star.png" - velocity: 50 - velocityDeviation: 20 -} - \endqml -*/ - -/*! - \property QmlGraphicsParticles::velocity - \brief the initial velocity of the particles. - - \sa QmlGraphicsParticles::velocityDeviation -*/ -qreal QmlGraphicsParticles::velocity() const -{ - Q_D(const QmlGraphicsParticles); - return d->velocity * 1000.0; -} - -void QmlGraphicsParticles::setVelocity(qreal velocity) -{ - Q_D(QmlGraphicsParticles); - d->velocity = velocity / 1000.0; -} - -/*! - \property QmlGraphicsParticles::velocityDeviation - \brief the maximum possible deviation from the set velocity. - - Randomly varies the velocity up to the specified variation. For - example, the following creates particles whose initial velocity will - vary from 40 to 60. - -\qml -Particles { - source: "star.png" - velocity: 50 - velocityDeviation: 20 -} -\endqml - - \sa QmlGraphicsParticles::velocity -*/ -qreal QmlGraphicsParticles::velocityDeviation() const -{ - Q_D(const QmlGraphicsParticles); - return d->velocityDev * 1000.0; -} - -void QmlGraphicsParticles::setVelocityDeviation(qreal velocity) -{ - Q_D(QmlGraphicsParticles); - d->velocityDev = velocity / 1000.0; -} - -/*! - \qmlproperty bool Particles::streamIn - This property determines whether the particles stream in at a constant rate - - When stream is set to true the particles will stream in at a constant rate. - Otherwise the particles will appear as a clump. Note that this only affects the - start of the particle effect, variables such as lifespan deviation can cause the - particles to unclump over time. -*/ -/*! - \property QmlGraphicsParticles::streamIn - \brief determines whether the particles stream in at a constant rate - - When stream is set to true the particles will stream in at a constant rate. - Otherwise the particles will appear as a clump. Note that this only affects the - start of the particle effect, variables such as lifespan deviation can cause the - -*/ -//The name may need a rethink -bool QmlGraphicsParticles::streamIn() const -{ - Q_D(const QmlGraphicsParticles); - return d->stream; -} - -void QmlGraphicsParticles::setStreamIn(bool b) -{ - Q_D(QmlGraphicsParticles); - d->stream = b; -} - -/*! - \qmlproperty bool Particles::emitting - This property determines whether new particles are created - - If emitting is set to false no new particles will be created. This means that - when a particle reaches the end of its lifespan it is not replaced. This - property can be used to turn particles on and off with a more natural look. - - The default setting is true. Note that if it initialized to false no particles - will be produced until it is set to true. -*/ -/*! - \property QmlGraphicsParticles::emitting - If emitting is set to false no new particles will be created. This means that - when a particle reaches the end of its lifespan it is not replaced. This - property can be used to turn particles on and off with a more natural look. - - The default setting is true. Note that if it initialized to false no particles - will be produced until it is set to true. -*/ -bool QmlGraphicsParticles::emitting() const -{ - Q_D(const QmlGraphicsParticles); - return d->emitting; -} - -void QmlGraphicsParticles::setEmitting(bool r) -{ - Q_D(QmlGraphicsParticles); - d->emitting = r; - if (d->count && r) - d->clock.start(); -} -/*! - \qmlproperty ParticleMotion Particles::motion - This property sets the type of motion to apply to the particles. - - When a particle is created it will have an initial direction and velocity. - The motion of the particle during its lifeSpan is then influenced by the - motion property. - - Default motion is ParticleMotionLinear. -*/ - -/*! - \property QmlGraphicsParticles::motion - \brief sets the type of motion to apply to the particles. - - When a particle is created it will have an initial direction and velocity. - The motion of the particle during its lifeSpan is then influenced by the - motion property. - - Default motion is QmlGraphicsParticleMotionLinear. -*/ -QmlGraphicsParticleMotion *QmlGraphicsParticles::motion() const -{ - Q_D(const QmlGraphicsParticles); - return d->motion; -} - -void QmlGraphicsParticles::setMotion(QmlGraphicsParticleMotion *motion) -{ - Q_D(QmlGraphicsParticles); - d->motion = motion; -} - -void QmlGraphicsParticlesPainter::updateSize() -{ - if (!isComponentComplete()) - return; - - const int parentX = parentItem()->x(); - const int parentY = parentItem()->y(); - for (int i = 0; i < d->particles.count(); ++i) { - const QmlGraphicsParticle &particle = d->particles.at(i); - if(particle.x > maxX) - maxX = particle.x; - if(particle.x < minX) - minX = particle.x; - if(particle.y > maxY) - maxY = particle.y; - if(particle.y < minY) - minY = particle.y; - } - - int myWidth = (int)(maxX-minX+0.5)+d->image.width(); - int myX = (int)(minX - parentX); - int myHeight = (int)(maxY-minY+0.5)+d->image.height(); - int myY = (int)(minY - parentY); - setWidth(myWidth); - setHeight(myHeight); - setX(myX); - setY(myY); -} - -void QmlGraphicsParticles::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *) -{ - Q_UNUSED(p); - //painting is done by the ParticlesPainter, so it can have the right size -} - -void QmlGraphicsParticlesPainter::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *) -{ - if (d->image.isNull() || d->particles.isEmpty()) - return; - - const int myX = x() + parentItem()->x(); - const int myY = y() + parentItem()->y(); - - static QVarLengthArray pixmapData; - if (pixmapData.count() < d->particles.count()) - pixmapData.resize(d->particles.count()); - - const QRectF sourceRect = d->image.rect(); - for (int i = 0; i < d->particles.count(); ++i) { - const QmlGraphicsParticle &particle = d->particles.at(i); - pixmapData[i].point = QPointF(particle.x - myX, particle.y - myY); - pixmapData[i].opacity = particle.opacity; - - //these never change - pixmapData[i].rotation = 0; - pixmapData[i].scaleX = 1; - pixmapData[i].scaleY = 1; - pixmapData[i].source = sourceRect; - } - qDrawPixmaps(p, pixmapData.data(), d->particles.count(), d->image); -} - -void QmlGraphicsParticles::componentComplete() -{ - Q_D(QmlGraphicsParticles); - QmlGraphicsItem::componentComplete(); - if (d->count) { - d->paintItem->updateSize(); - d->clock.start(); - } - if (d->lifeSpanDev > d->lifeSpan) - d->lifeSpanDev = d->lifeSpan; -} - -QT_END_NAMESPACE diff --git a/src/declarative/extra/qmlgraphicsparticles_p.h b/src/declarative/extra/qmlgraphicsparticles_p.h deleted file mode 100644 index 9eca762..0000000 --- a/src/declarative/extra/qmlgraphicsparticles_p.h +++ /dev/null @@ -1,230 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the QtDeclarative module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QMLGRAPHICSPARTICLES_H -#define QMLGRAPHICSPARTICLES_H - -#include - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -class QmlGraphicsParticle; -class QmlGraphicsParticles; -class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotion : public QObject -{ - Q_OBJECT -public: - QmlGraphicsParticleMotion(QObject *parent=0); - - virtual void advance(QmlGraphicsParticle &, int interval); - virtual void created(QmlGraphicsParticle &); - virtual void destroy(QmlGraphicsParticle &); -}; - -class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotionLinear : public QmlGraphicsParticleMotion -{ - Q_OBJECT -public: - QmlGraphicsParticleMotionLinear(QObject *parent=0) - : QmlGraphicsParticleMotion(parent) {} - - virtual void advance(QmlGraphicsParticle &, int interval); -}; - -class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotionGravity : public QmlGraphicsParticleMotion -{ - Q_OBJECT - - Q_PROPERTY(int xattractor READ xAttractor WRITE setXAttractor) - Q_PROPERTY(int yattractor READ yAttractor WRITE setYAttractor) - Q_PROPERTY(int acceleration READ acceleration WRITE setAcceleration) -public: - QmlGraphicsParticleMotionGravity(QObject *parent=0) - : QmlGraphicsParticleMotion(parent), _xAttr(0), _yAttr(0), _accel(0.00005) {} - - int xAttractor() const { return _xAttr; } - void setXAttractor(int x) { _xAttr = x; } - - int yAttractor() const { return _yAttr; } - void setYAttractor(int y) { _yAttr = y; } - - int acceleration() const { return int(_accel * 1000000); } - void setAcceleration(int accel) { _accel = qreal(accel)/1000000.0; } - - virtual void advance(QmlGraphicsParticle &, int interval); - -private: - int _xAttr; - int _yAttr; - qreal _accel; -}; - -class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotionWander : public QmlGraphicsParticleMotion -{ - Q_OBJECT -public: - QmlGraphicsParticleMotionWander() - : QmlGraphicsParticleMotion(), particles(0), _xvariance(0), _yvariance(0) {} - - virtual void advance(QmlGraphicsParticle &, int interval); - virtual void created(QmlGraphicsParticle &); - virtual void destroy(QmlGraphicsParticle &); - - struct Data { - qreal x_targetV; - qreal y_targetV; - qreal x_peak; - qreal y_peak; - qreal x_var; - qreal y_var; - }; - - Q_PROPERTY(int xvariance READ xVariance WRITE setXVariance) - int xVariance() const { return int(_xvariance * 1000); } - void setXVariance(int var) { _xvariance = var / 1000.0; } - - Q_PROPERTY(int yvariance READ yVariance WRITE setYVariance) - int yVariance() const { return int(_yvariance * 1000); } - void setYVariance(int var) { _yvariance = var / 1000.0; } - - Q_PROPERTY(int pace READ pace WRITE setPace) - int pace() const { return int(_pace * 1000); } - void setPace(int pace) { _pace = pace / 1000.0; } - -private: - QmlGraphicsParticles *particles; - qreal _xvariance; - qreal _yvariance; - qreal _pace; -}; - -class QmlGraphicsParticlesPrivate; -class Q_DECLARATIVE_EXPORT QmlGraphicsParticles : public QmlGraphicsItem -{ - Q_OBJECT - - Q_PROPERTY(QUrl source READ source WRITE setSource) - Q_PROPERTY(int count READ count WRITE setCount) - Q_PROPERTY(int lifeSpan READ lifeSpan WRITE setLifeSpan) - Q_PROPERTY(int lifeSpanDeviation READ lifeSpanDeviation WRITE setLifeSpanDeviation) - Q_PROPERTY(int fadeInDuration READ fadeInDuration WRITE setFadeInDuration) - Q_PROPERTY(int fadeOutDuration READ fadeOutDuration WRITE setFadeOutDuration) - Q_PROPERTY(qreal angle READ angle WRITE setAngle) - Q_PROPERTY(qreal angleDeviation READ angleDeviation WRITE setAngleDeviation) - Q_PROPERTY(qreal velocity READ velocity WRITE setVelocity) - Q_PROPERTY(qreal velocityDeviation READ velocityDeviation WRITE setVelocityDeviation) - Q_PROPERTY(bool streamIn READ streamIn WRITE setStreamIn) - Q_PROPERTY(bool emitting READ emitting WRITE setEmitting) - Q_PROPERTY(QmlGraphicsParticleMotion *motion READ motion WRITE setMotion) - Q_CLASSINFO("DefaultProperty", "motion") - -public: - QmlGraphicsParticles(QmlGraphicsItem *parent=0); - ~QmlGraphicsParticles(); - - QUrl source() const; - void setSource(const QUrl &); - - int count() const; - void setCount(int cnt); - - int lifeSpan() const; - void setLifeSpan(int); - - int lifeSpanDeviation() const; - void setLifeSpanDeviation(int); - - int fadeInDuration() const; - void setFadeInDuration(int); - - int fadeOutDuration() const; - void setFadeOutDuration(int); - - qreal angle() const; - void setAngle(qreal); - - qreal angleDeviation() const; - void setAngleDeviation(qreal); - - qreal velocity() const; - void setVelocity(qreal); - - qreal velocityDeviation() const; - void setVelocityDeviation(qreal); - - bool streamIn() const; - void setStreamIn(bool); - - bool emitting() const; - void setEmitting(bool); - - QmlGraphicsParticleMotion *motion() const; - void setMotion(QmlGraphicsParticleMotion *); - - void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); - -protected: - virtual void componentComplete(); - QmlGraphicsParticles(QmlGraphicsParticlesPrivate &dd, QmlGraphicsItem *parent); - -private Q_SLOTS: - void imageLoaded(); - -private: - Q_DISABLE_COPY(QmlGraphicsParticles) - Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsParticles) -}; - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QmlGraphicsParticleMotion) -QML_DECLARE_TYPE(QmlGraphicsParticleMotionLinear) -QML_DECLARE_TYPE(QmlGraphicsParticleMotionGravity) -QML_DECLARE_TYPE(QmlGraphicsParticleMotionWander) -QML_DECLARE_TYPE(QmlGraphicsParticles) - -QT_END_HEADER - -#endif diff --git a/src/declarative/graphicsitems/graphicsitems.pri b/src/declarative/graphicsitems/graphicsitems.pri index cf71451..3c4e39a 100644 --- a/src/declarative/graphicsitems/graphicsitems.pri +++ b/src/declarative/graphicsitems/graphicsitems.pri @@ -42,6 +42,7 @@ HEADERS += \ graphicsitems/qmlgraphicsvisualitemmodel_p.h \ graphicsitems/qmlgraphicslistview_p.h \ graphicsitems/qmlgraphicsgraphicsobjectcontainer_p.h \ + graphicsitems/qmlgraphicsparticles_p.h \ graphicsitems/qmlgraphicslayoutitem_p.h \ graphicsitems/qmlgraphicseffects.cpp @@ -72,6 +73,7 @@ SOURCES += \ graphicsitems/qmlgraphicsvisualitemmodel.cpp \ graphicsitems/qmlgraphicslistview.cpp \ graphicsitems/qmlgraphicsgraphicsobjectcontainer.cpp \ + graphicsitems/qmlgraphicsparticles.cpp \ graphicsitems/qmlgraphicslayoutitem.cpp \ contains(QT_CONFIG, webkit) { diff --git a/src/declarative/graphicsitems/qmlgraphicsparticles.cpp b/src/declarative/graphicsitems/qmlgraphicsparticles.cpp new file mode 100644 index 0000000..d906fd3 --- /dev/null +++ b/src/declarative/graphicsitems/qmlgraphicsparticles.cpp @@ -0,0 +1,1278 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "private/qmlgraphicsitem_p.h" + +#include +#include +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#define M_PI_2 (M_PI / 2.) +#endif +#ifndef INT_MAX +#define INT_MAX 2147483647 +#endif +#include +#include +#include +#include + +#include "qmlgraphicsparticles_p.h" +#include +#include +#include + +QT_BEGIN_NAMESPACE +#define PI_SQR 9.8696044 +// parabolic approximation +inline qreal fastSin(qreal theta) +{ + const qreal b = 4 / M_PI; + const qreal c = -4 / PI_SQR; + + qreal y = b * theta + c * theta * qAbs(theta); + return y; +} + +inline qreal fastCos(qreal theta) +{ + theta += M_PI_2; + if (theta > M_PI) + theta -= 2 * M_PI; + + return fastSin(theta); +} + +class QmlGraphicsParticle +{ +public: + QmlGraphicsParticle(int time) : lifeSpan(1000), fadeOutAge(800) + , opacity(0), birthTime(time), x_velocity(0), y_velocity(0) + , state(FadeIn), data(0) + { + } + + int lifeSpan; + int fadeOutAge; + qreal x; + qreal y; + qreal opacity; + int birthTime; + qreal x_velocity; + qreal y_velocity; + enum State { FadeIn, Solid, FadeOut }; + State state; + void *data; +}; + +//--------------------------------------------------------------------------- + +QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotion,QmlGraphicsParticleMotion) + +/*! + \class QmlGraphicsParticleMotion + \ingroup group_effects + \brief The QmlGraphicsParticleMotion class is the base class for particle motion. + \internal + + This class causes the particles to remain static. +*/ + +/*! + Constructs a QmlGraphicsParticleMotion with parent object \a parent. +*/ +QmlGraphicsParticleMotion::QmlGraphicsParticleMotion(QObject *parent) : + QObject(parent) +{ +} + +/*! + Move the \a particle to its new position. \a interval is the number of + milliseconds elapsed since it was last moved. +*/ +void QmlGraphicsParticleMotion::advance(QmlGraphicsParticle &particle, int interval) +{ + Q_UNUSED(particle); + Q_UNUSED(interval); +} + +/*! + The \a particle has just been created. Some motion strategies require + additional state information. This can be allocated by this function. +*/ +void QmlGraphicsParticleMotion::created(QmlGraphicsParticle &particle) +{ + Q_UNUSED(particle); +} + +/*! + The \a particle is about to be destroyed. Any additional memory + that has been allocated for the particle should be freed. +*/ +void QmlGraphicsParticleMotion::destroy(QmlGraphicsParticle &particle) +{ + Q_UNUSED(particle); +} + +/*! + \qmlclass ParticleMotionLinear + \brief The ParticleMotionLinear object moves particles linearly. + + \sa Particles +*/ + +/*! + \internal + \class QmlGraphicsParticleMotionLinear + \ingroup group_effects + \brief The QmlGraphicsParticleMotionLinear class moves the particles linearly. +*/ + +QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotionLinear,QmlGraphicsParticleMotionLinear) + +void QmlGraphicsParticleMotionLinear::advance(QmlGraphicsParticle &p, int interval) +{ + p.x += interval * p.x_velocity; + p.y += interval * p.y_velocity; +} + +/*! + \qmlclass ParticleMotionGravity + \brief The ParticleMotionGravity object moves particles towards a point. + + \sa Particles +*/ + +/*! + \internal + \class QmlGraphicsParticleMotionGravity + \ingroup group_effects + \brief The QmlGraphicsParticleMotionGravity class moves the particles towards a point. +*/ + +QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotionGravity,QmlGraphicsParticleMotionGravity) + +/*! + \qmlproperty int ParticleMotionGravity::xattractor + \qmlproperty int ParticleMotionGravity::yattractor + These properties hold the x and y coordinates of the point attracting the particles. +*/ + +/*! + \qmlproperty int ParticleMotionGravity::acceleration + This property holds the acceleration to apply to the particles. +*/ + +/*! + \property QmlGraphicsParticleMotionGravity::xattractor + \brief the x coordinate of the point attracting the particles. +*/ + +/*! + \property QmlGraphicsParticleMotionGravity::yattractor + \brief the y coordinate of the point attracting the particles. +*/ + +/*! + \property QmlGraphicsParticleMotionGravity::acceleration + \brief the acceleration to apply to the particles. +*/ + +void QmlGraphicsParticleMotionGravity::advance(QmlGraphicsParticle &p, int interval) +{ + qreal xdiff = p.x - _xAttr; + qreal ydiff = p.y - _yAttr; + + qreal xcomp = xdiff / (xdiff + ydiff); + qreal ycomp = ydiff / (xdiff + ydiff); + + p.x_velocity += xcomp * _accel * interval; + p.y_velocity += ycomp * _accel * interval; + + p.x += interval * p.x_velocity; + p.y += interval * p.y_velocity; +} + +/*! + \qmlclass ParticleMotionWander + \brief The ParticleMotionWander object moves particles in a somewhat random fashion. + + The particles will continue roughly in the original direction, however will randomly + drift to each side. + + The code below produces an effect similar to falling snow. + + \qml +Rectangle { + width: 240 + height: 320 + color: "black" + + Particles { + y: 0 + width: parent.width + height: 30 + source: "star.png" + lifeSpan: 5000 + count: 50 + angle: 70 + angleDeviation: 36 + velocity: 30 + velocityDeviation: 10 + ParticleMotionWander { + xvariance: 30 + pace: 100 + } + } +} + \endqml + + \sa Particles +*/ + +/*! + \internal + \class QmlGraphicsParticleMotionWander + \ingroup group_effects + \brief The QmlGraphicsParticleMotionWander class moves particles in a somewhat random fashion. + + The particles will continue roughly in the original direction, however will randomly + drift to each side. +*/ + +/*! + \qmlproperty int QmlGraphicsParticleMotionWander::xvariance + \qmlproperty int QmlGraphicsParticleMotionWander::yvariance + + These properties set the amount to wander in the x and y directions. +*/ + +/*! + \qmlproperty int QmlGraphicsParticleMotionWander::pace + This property holds how quickly the paricles will move from side to side. +*/ + +QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotionWander,QmlGraphicsParticleMotionWander) + +void QmlGraphicsParticleMotionWander::advance(QmlGraphicsParticle &p, int interval) +{ + if (!particles) + particles = qobject_cast(parent()); + if (particles) { + Data *d = (Data*)p.data; + if (_xvariance != 0.) { + qreal xdiff = p.x_velocity - d->x_targetV; + if ((xdiff > d->x_peak && d->x_var > 0.0) || (xdiff < -d->x_peak && d->x_var < 0.0)) { + d->x_var = -d->x_var; + d->x_peak = _xvariance + _xvariance * qreal(rand()) / RAND_MAX; + } + p.x_velocity += d->x_var * interval; + } + p.x += interval * p.x_velocity; + + if (_yvariance != 0.) { + qreal ydiff = p.y_velocity - d->y_targetV; + if ((ydiff > d->y_peak && d->y_var > 0.0) || (ydiff < -d->y_peak && d->y_var < 0.0)) { + d->y_var = -d->y_var; + d->y_peak = _yvariance + _yvariance * qreal(rand()) / RAND_MAX; + } + p.y_velocity += d->y_var * interval; + } + p.y += interval * p.y_velocity; + } +} + +void QmlGraphicsParticleMotionWander::created(QmlGraphicsParticle &p) +{ + if (!p.data) { + Data *d = new Data; + p.data = (void*)d; + d->x_targetV = p.x_velocity; + d->y_targetV = p.y_velocity; + d->x_peak = _xvariance; + d->y_peak = _yvariance; + d->x_var = _pace * qreal(rand()) / RAND_MAX / 1000.0; + d->y_var = _pace * qreal(rand()) / RAND_MAX / 1000.0; + } +} + +void QmlGraphicsParticleMotionWander::destroy(QmlGraphicsParticle &p) +{ + if (p.data) + delete (Data*)p.data; +} + +//--------------------------------------------------------------------------- +class QmlGraphicsParticlesPainter : public QmlGraphicsItem +{ +public: + QmlGraphicsParticlesPainter(QmlGraphicsParticlesPrivate *p, QmlGraphicsItem* parent) + : QmlGraphicsItem(parent), d(p) + { + setFlag(QGraphicsItem::ItemHasNoContents, false); + maxX = minX = maxY = minY = 0; + } + + void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); + + void updateSize(); + + qreal maxX; + qreal minX; + qreal maxY; + qreal minY; + QmlGraphicsParticlesPrivate* d; +}; + +//--------------------------------------------------------------------------- +class QmlGraphicsParticlesPrivate : public QmlGraphicsItemPrivate +{ + Q_DECLARE_PUBLIC(QmlGraphicsParticles) +public: + QmlGraphicsParticlesPrivate() + : count(1), emissionRate(-1), emissionVariance(0.5), lifeSpan(1000) + , lifeSpanDev(1000), fadeInDur(200), fadeOutDur(300) + , angle(0), angleDev(0), velocity(0), velocityDev(0), emissionCarry(0.) + , addParticleTime(0), addParticleCount(0), lastAdvTime(0) + , emitting(true), motion(0), pendingPixmapCache(false), clock(this) + { + } + + ~QmlGraphicsParticlesPrivate() + { + } + + void init() + { + Q_Q(QmlGraphicsParticles); + paintItem = new QmlGraphicsParticlesPainter(this, q); + } + + void tick(int time); + void createParticle(int time); + void updateOpacity(QmlGraphicsParticle &p, int age); + + QUrl url; + QPixmap image; + int count; + int emissionRate; + qreal emissionVariance; + int lifeSpan; + int lifeSpanDev; + int fadeInDur; + int fadeOutDur; + qreal angle; + qreal angleDev; + qreal velocity; + qreal velocityDev; + qreal emissionCarry; + int addParticleTime; + int addParticleCount; + int lastAdvTime; + bool emitting; + QmlGraphicsParticleMotion *motion; + QmlGraphicsParticlesPainter *paintItem; + + bool pendingPixmapCache; + + QList > bursts;//countLeft, emissionRate pairs + QList particles; + QTickAnimationProxy clock; + +}; + +void QmlGraphicsParticlesPrivate::tick(int time) +{ + Q_Q(QmlGraphicsParticles); + if (!motion) + motion = new QmlGraphicsParticleMotionLinear(q); + + int oldCount = particles.count(); + int removed = 0; + int interval = time - lastAdvTime; + for (int i = 0; i < particles.count(); ) { + QmlGraphicsParticle &particle = particles[i]; + int age = time - particle.birthTime; + if (age >= particle.lifeSpan) { + QmlGraphicsParticle part = particles.takeAt(i); + motion->destroy(part); + ++removed; + } else { + updateOpacity(particle, age); + motion->advance(particle, interval); + ++i; + } + } + + if(emissionRate == -1)//Otherwise leave emission to the emission rate + while(removed-- && ((count == -1) || particles.count() < count) && emitting) + createParticle(time); + + if (!addParticleTime) + addParticleTime = time; + + //Possibly emit new particles + if (((count == -1) || particles.count() < count) && emitting + && !(count==-1 && emissionRate==-1)) { + int emissionCount = -1; + if (emissionRate != -1){ + qreal variance = 1.; + if (emissionVariance > 0.){ + variance += (qreal(rand())/RAND_MAX) * emissionVariance * (rand()%2?-1.:1.); + } + qreal emission = emissionRate * (qreal(interval)/1000.); + emission = emission * variance + emissionCarry; + double tmpDbl; + emissionCarry = modf(emission, &tmpDbl); + emissionCount = (int)tmpDbl; + emissionCount = qMax(0,emissionCount); + } + while(((count == -1) || particles.count() < count) && + (emissionRate==-1 || emissionCount--)) + createParticle(time); + } + + //Deal with emissions from requested bursts + for(int i=0; i 0.){ + variance += (qreal(rand())/RAND_MAX) * emissionVariance * (rand()%2?-1.:1.); + } + qreal workingEmission = bursts[i].second * (qreal(interval)/1000.); + workingEmission *= variance; + emission = (int)workingEmission; + emission = qMax(emission, 0); + } + emission = qMin(emission, bursts[i].first); + bursts[i].first -= emission; + while(emission--) + createParticle(time); + } + for(int i=bursts.size()-1; i>=0; i--) + if(bursts[i].first <= 0) + bursts.removeAt(i); + + lastAdvTime = time; + paintItem->updateSize(); + paintItem->update(); + if (!(oldCount || particles.count()) && (!count || !emitting) && bursts.isEmpty()) { + lastAdvTime = 0; + clock.stop(); + } +} + +void QmlGraphicsParticlesPrivate::createParticle(int time) +{ +#ifdef Q_ENABLE_PERFORMANCE_LOG + QmlPerfTimer x; +#endif + Q_Q(QmlGraphicsParticles); + QmlGraphicsParticle p(time); + p.x = q->x() + q->width() * qreal(rand()) / RAND_MAX - image.width()/2.0; + p.y = q->y() + q->height() * qreal(rand()) / RAND_MAX - image.height()/2.0; + p.lifeSpan = lifeSpan; + if (lifeSpanDev) + p.lifeSpan += int(lifeSpanDev/2 - lifeSpanDev * qreal(rand()) / RAND_MAX); + p.fadeOutAge = p.lifeSpan - fadeOutDur; + if (fadeInDur == 0.) { + p.state= QmlGraphicsParticle::Solid; + p.opacity = 1.0; + } + qreal a = angle; + if (angleDev) + a += angleDev/2 - angleDev * qreal(rand()) / RAND_MAX; + if (a > M_PI) + a = a - 2 * M_PI; + qreal v = velocity; + if (velocityDev) + v += velocityDev/2 - velocityDev * qreal(rand()) / RAND_MAX; + p.x_velocity = v * fastCos(a); + p.y_velocity = v * fastSin(a); + particles.append(p); + motion->created(particles.last()); +} + +void QmlGraphicsParticlesPrivate::updateOpacity(QmlGraphicsParticle &p, int age) +{ + switch (p.state) { + case QmlGraphicsParticle::FadeIn: + if (age <= fadeInDur) { + p.opacity = qreal(age) / fadeInDur; + break; + } else { + p.opacity = 1.0; + p.state = QmlGraphicsParticle::Solid; + // Fall through + } + case QmlGraphicsParticle::Solid: + if (age <= p.fadeOutAge) { + break; + } else { + p.state = QmlGraphicsParticle::FadeOut; + // Fall through + } + case QmlGraphicsParticle::FadeOut: + p.opacity = qreal(p.lifeSpan - age) / fadeOutDur; + break; + } +} + +QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Particles,QmlGraphicsParticles) + +/*! + \qmlclass Particles + \brief The Particles object generates and moves particles. + \inherits Item + + This element provides preliminary support for particles in QML, and may be heavily changed or removed in later versions. + + The particles created by this object cannot be dealt with directly, they can only be controlled through the parameters of the Particles object. The particles are all the same pixmap, specified by the user. + + The particles are painted relative to the parent of the Particles object. Moving the + Particles object will not move the particles already emitted. + + The below example creates two differently behaving particle sources. + The top one has particles falling from the top like snow, + the lower one has particles expelled up like a fountain. + + \qml +Rectangle { + width: 240 + height: 320 + color: "black" + Particles { + y: 0 + width: parent.width + height: 30 + source: "star.png" + lifeSpan: 5000 + count: 50 + angle: 70 + angleDeviation: 36 + velocity: 30 + velocityDeviation: 10 + ParticleMotionWander { + xvariance: 30 + pace: 100 + } + } + Particles { + y: 300 + x: 120 + width: 1 + height: 1 + source: "star.png" + lifeSpan: 5000 + count: 200 + angle: 270 + angleDeviation: 45 + velocity: 50 + velocityDeviation: 30 + ParticleMotionGravity { + yattractor: 1000 + xattractor: 0 + acceleration: 25 + } + } +} + \endqml + \image particles.gif +*/ + +/*! + \internal + \class QmlGraphicsParticles + \ingroup group_effects + \brief The QmlGraphicsParticles class generates and moves particles. +*/ + +QmlGraphicsParticles::QmlGraphicsParticles(QmlGraphicsItem *parent) + : QmlGraphicsItem(*(new QmlGraphicsParticlesPrivate), parent) +{ + Q_D(QmlGraphicsParticles); + d->init(); +} + +QmlGraphicsParticles::QmlGraphicsParticles(QmlGraphicsParticlesPrivate &dd, QmlGraphicsItem *parent) + : QmlGraphicsItem(dd, parent) +{ + Q_D(QmlGraphicsParticles); + d->init(); +} + +QmlGraphicsParticles::~QmlGraphicsParticles() +{ + Q_D(QmlGraphicsParticles); + if (d->pendingPixmapCache) + QmlPixmapCache::cancelGet(d->url, this); +} + +/*! + \qmlproperty string Particles::src + This property holds the URL of the particle image. +*/ + +/*! + \property QmlGraphicsParticles::source + \brief the URL of the particle image. +*/ +QUrl QmlGraphicsParticles::source() const +{ + Q_D(const QmlGraphicsParticles); + return d->url; +} + +void QmlGraphicsParticles::imageLoaded() +{ + Q_D(QmlGraphicsParticles); + d->pendingPixmapCache = false; + QmlPixmapCache::find(d->url, &d->image); + d->paintItem->updateSize(); + d->paintItem->update(); +} + +void QmlGraphicsParticles::setSource(const QUrl &name) +{ + Q_D(QmlGraphicsParticles); + + if ((d->url.isEmpty() == name.isEmpty()) && name == d->url) + return; + + if (d->pendingPixmapCache) { + QmlPixmapCache::cancelGet(d->url, this); + d->pendingPixmapCache = false; + } + if (name.isEmpty()) { + d->url = name; + d->image = QPixmap(); + d->paintItem->updateSize(); + d->paintItem->update(); + } else { + d->url = name; + Q_ASSERT(!name.isRelative()); + QNetworkReply *reply = QmlPixmapCache::get(qmlEngine(this), d->url, &d->image); + if (reply) { + connect(reply, SIGNAL(finished()), this, SLOT(imageLoaded())); + d->pendingPixmapCache = true; + } else { + //### unify with imageLoaded + d->paintItem->updateSize(); + d->paintItem->update(); + } + } + emit sourceChanged(); +} + +/*! + \qmlproperty int Particles::count + This property holds the maximum number of particles + + The particles element emits particles until it has count active + particles. When this number is reached, new particles are not emitted until + some of the current particles reach theend of their lifespan. + + If count is -1 then there is no maximum number of active particles, and + particles will be constantly emitted at the rate specified by emissionRate. + + If both count and emissionRate are set to -1, nothing will be emitted. + +*/ + +/*! + \property QmlGraphicsParticles::count + \brief the maximum number of particles +*/ +int QmlGraphicsParticles::count() const +{ + Q_D(const QmlGraphicsParticles); + return d->count; +} + +void QmlGraphicsParticles::setCount(int cnt) +{ + Q_D(QmlGraphicsParticles); + if (cnt == d->count) + return; + + int oldCount = d->count; + d->count = cnt; + d->addParticleTime = 0; + d->addParticleCount = d->particles.count(); + if (!oldCount && d->clock.state() != QAbstractAnimation::Running && d->count && d->emitting) { + d->clock.start(); + } + d->paintItem->updateSize(); + d->paintItem->update(); + emit countChanged(); +} + + +/*! + \qmlproperty int Particles::emissionRate + This property holds the target number of particles to emit every second. + + The particles element will emit up to emissionRate particles every + second. Fewer particles may be emitted per second if the maximum number of + particles has been reached. + + If emissionRate is set to -1 there is no limit to the number of + particles emitted per second, and particles will be instantly emitted to + reach the maximum number of particles specified by count. + + The default value for emissionRate is -1. + + If both count and emissionRate are set to -1, nothing will be emitted. +*/ + +/*! + \property QmlGraphicsParticles::emissionRate + \brief the emission rate of particles +*/ +int QmlGraphicsParticles::emissionRate() const +{ + Q_D(const QmlGraphicsParticles); + return d->emissionRate; +} +void QmlGraphicsParticles::setEmissionRate(int er) +{ + Q_D(QmlGraphicsParticles); + if(er == d->emissionRate) + return; + d->emissionRate = er; + emit emissionRateChanged(); +} + +/*! + \qmlproperty qreal Particles::emissionVariance + This property holds how inconsistent the rate of particle emissions are. + It is a number between 0 (no variance) and 1 (some variance). + + The expected number of particles emitted per second is emissionRate. If + emissionVariance is 0 then particles will be emitted consistently throughout + each second to reach that number. If emissionVariance is greater than 0 the + rate of particle emission will vary randomly throughout the second, with the + consequence that the actual number of particles emitted in one second will + vary randomly as well. + + emissionVariance is the maximum deviation from emitting + emissionRate particles per second. An emissionVariance of 0 means you should + get exactly emissionRate particles emitted per second, + and an emissionVariance of 1 means you will get between zero and two times + emissionRate particles per second, but you should get emissionRate particles + per second on average. + + Note that even with an emissionVariance of 0 there may be some variance due + to performance and hardware constraints. + + The default value of emissionVariance is 0.5 +*/ + +/*! + \property QmlGraphicsParticles::emissionVariance + \brief how much the particle emission amounts vary per tick +*/ + +qreal QmlGraphicsParticles::emissionVariance() const +{ + Q_D(const QmlGraphicsParticles); + return d->emissionVariance; +} + +void QmlGraphicsParticles::setEmissionVariance(qreal ev) +{ + Q_D(QmlGraphicsParticles); + if(d->emissionVariance == ev) + return; + d->emissionVariance = ev; + emit emissionVarianceChanged(); +} + +/*! + \qmlproperty int Particles::lifeSpan + \qmlproperty int Particles::lifeSpanDeviation + + These properties describe the life span of each particle. + + The default lifespan for a particle is 1000ms. + + lifeSpanDeviation randomly varies the lifeSpan up to the specified variation. For + example, the following creates particles whose lifeSpan will vary + from 150ms to 250ms: + + \qml +Particles { + source: "star.png" + lifeSpan: 200 + lifeSpanDeviation: 100 +} + \endqml +*/ + +/*! + \property QmlGraphicsParticles::lifeSpan + \brief the life span of each particle. + + Default value is 1000ms. + + \sa QmlGraphicsParticles::lifeSpanDeviation +*/ +int QmlGraphicsParticles::lifeSpan() const +{ + Q_D(const QmlGraphicsParticles); + return d->lifeSpan; +} + +void QmlGraphicsParticles::setLifeSpan(int ls) +{ + Q_D(QmlGraphicsParticles); + if(d->lifeSpan == ls) + return; + d->lifeSpan = ls; + emit lifeSpanChanged(); +} + +/*! + \property QmlGraphicsParticles::lifeSpanDeviation + \brief the maximum possible deviation from the set lifeSpan. + + Randomly varies the lifeSpan up to the specified variation. For + example, the following creates particles whose lifeSpan will vary + from 150ms to 250ms: + +\qml +Particles { + source: "star.png" + lifeSpan: 200 + lifeSpanDeviation: 100 +} +\endqml + + \sa QmlGraphicsParticles::lifeSpan +*/ +int QmlGraphicsParticles::lifeSpanDeviation() const +{ + Q_D(const QmlGraphicsParticles); + return d->lifeSpanDev; +} + +void QmlGraphicsParticles::setLifeSpanDeviation(int dev) +{ + Q_D(QmlGraphicsParticles); + if(d->lifeSpanDev == dev) + return; + d->lifeSpanDev = dev; + emit lifeSpanDeviationChanged(); +} + +/*! + \qmlproperty int Particles::fadeInDuration + \qmlproperty int Particles::fadeOutDuration + These properties hold the time taken to fade the particles in and out. + + By default fade in is 200ms and fade out is 300ms. +*/ + +/*! + \property QmlGraphicsParticles::fadeInDuration + \brief the time taken to fade in the particles. + + Default value is 200ms. +*/ +int QmlGraphicsParticles::fadeInDuration() const +{ + Q_D(const QmlGraphicsParticles); + return d->fadeInDur; +} + +void QmlGraphicsParticles::setFadeInDuration(int dur) +{ + Q_D(QmlGraphicsParticles); + if (dur < 0.0 || dur == d->fadeInDur) + return; + d->fadeInDur = dur; + emit fadeInDurationChanged(); +} + +/*! + \property QmlGraphicsParticles::fadeOutDuration + \brief the time taken to fade out the particles. + + Default value is 300ms. +*/ +int QmlGraphicsParticles::fadeOutDuration() const +{ + Q_D(const QmlGraphicsParticles); + return d->fadeOutDur; +} + +void QmlGraphicsParticles::setFadeOutDuration(int dur) +{ + Q_D(QmlGraphicsParticles); + if (dur < 0.0 || d->fadeOutDur == dur) + return; + d->fadeOutDur = dur; + emit fadeOutDurationChanged(); +} + +/*! + \qmlproperty real Particles::angle + \qmlproperty real Particles::angleDeviation + + These properties control particle direction. + + angleDeviation randomly varies the direction up to the specified variation. For + example, the following creates particles whose initial direction will + vary from 15 degrees to 105 degrees: + + \qml +Particles { + source: "star.png" + angle: 60 + angleDeviation: 90 +} + \endqml +*/ + +/*! + \property QmlGraphicsParticles::angle + \brief the initial angle of direction. + + \sa QmlGraphicsParticles::angleDeviation +*/ +qreal QmlGraphicsParticles::angle() const +{ + Q_D(const QmlGraphicsParticles); + return d->angle * 180.0 / M_PI; +} + +void QmlGraphicsParticles::setAngle(qreal angle) +{ + Q_D(QmlGraphicsParticles); + qreal radAngle = angle * M_PI / 180.0; + if(radAngle == d->angle) + return; + d->angle = radAngle; + emit angleChanged(); +} + +/*! + \property QmlGraphicsParticles::angleDeviation + \brief the maximum possible deviation from the set angle. + + Randomly varies the direction up to the specified variation. For + example, the following creates particles whose initial direction will + vary from 15 degrees to 105 degrees: + +\qml +Particles { + source: "star.png" + angle: 60 + angleDeviation: 90 +} +\endqml + + \sa QmlGraphicsParticles::angle +*/ +qreal QmlGraphicsParticles::angleDeviation() const +{ + Q_D(const QmlGraphicsParticles); + return d->angleDev * 180.0 / M_PI; +} + +void QmlGraphicsParticles::setAngleDeviation(qreal dev) +{ + Q_D(QmlGraphicsParticles); + qreal radDev = dev * M_PI / 180.0; + if(radDev == d->angleDev) + return; + d->angleDev = radDev; + emit angleDeviationChanged(); +} + +/*! + \qmlproperty real Particles::velocity + \qmlproperty real Particles::velocityDeviation + + These properties control the velocity of the particles. + + velocityDeviation randomly varies the velocity up to the specified variation. For + example, the following creates particles whose initial velocity will + vary from 40 to 60. + + \qml +Particles { + source: "star.png" + velocity: 50 + velocityDeviation: 20 +} + \endqml +*/ + +/*! + \property QmlGraphicsParticles::velocity + \brief the initial velocity of the particles. + + \sa QmlGraphicsParticles::velocityDeviation +*/ +qreal QmlGraphicsParticles::velocity() const +{ + Q_D(const QmlGraphicsParticles); + return d->velocity * 1000.0; +} + +void QmlGraphicsParticles::setVelocity(qreal velocity) +{ + Q_D(QmlGraphicsParticles); + qreal realVel = velocity / 1000.0; + if(realVel == d->velocity) + return; + d->velocity = realVel; + emit velocityChanged(); +} + +/*! + \property QmlGraphicsParticles::velocityDeviation + \brief the maximum possible deviation from the set velocity. + + Randomly varies the velocity up to the specified variation. For + example, the following creates particles whose initial velocity will + vary from 40 to 60. + +\qml +Particles { + source: "star.png" + velocity: 50 + velocityDeviation: 20 +} +\endqml + + \sa QmlGraphicsParticles::velocity +*/ +qreal QmlGraphicsParticles::velocityDeviation() const +{ + Q_D(const QmlGraphicsParticles); + return d->velocityDev * 1000.0; +} + +void QmlGraphicsParticles::setVelocityDeviation(qreal velocity) +{ + Q_D(QmlGraphicsParticles); + qreal realDev = velocity / 1000.0; + if(realDev == d->velocityDev) + return; + d->velocityDev = realDev; + emit velocityDeviationChanged(); +} + +/*! + \qmlproperty bool Particles::emitting + This property determines whether new particles are created + + If emitting is set to false no new particles will be created. This means that + when a particle reaches the end of its lifespan it is not replaced. This + property can be used to turn particles on and off with a more natural look. + + The default setting is true. Note that if it initialized to false no particles + will be produced until it is set to true. +*/ +/*! + \property QmlGraphicsParticles::emitting + If emitting is set to false no new particles will be created. This means that + when a particle reaches the end of its lifespan it is not replaced. This + property can be used to turn particles on and off with a more natural look. + + The default setting is true. Note that if it initialized to false no particles + will be produced until it is set to true. +*/ +bool QmlGraphicsParticles::emitting() const +{ + Q_D(const QmlGraphicsParticles); + return d->emitting; +} + +void QmlGraphicsParticles::setEmitting(bool r) +{ + Q_D(QmlGraphicsParticles); + if(d->emitting == r) + return; + d->emitting = r; + if (d->count && r) + d->clock.start(); + emit emittingChanged(); +} +/*! + \qmlproperty ParticleMotion Particles::motion + This property sets the type of motion to apply to the particles. + + When a particle is created it will have an initial direction and velocity. + The motion of the particle during its lifeSpan is then influenced by the + motion property. + + Default motion is ParticleMotionLinear. +*/ + +/*! + \property QmlGraphicsParticles::motion + \brief sets the type of motion to apply to the particles. + + When a particle is created it will have an initial direction and velocity. + The motion of the particle during its lifeSpan is then influenced by the + motion property. + + Default motion is QmlGraphicsParticleMotionLinear. +*/ +QmlGraphicsParticleMotion *QmlGraphicsParticles::motion() const +{ + Q_D(const QmlGraphicsParticles); + return d->motion; +} + +void QmlGraphicsParticles::setMotion(QmlGraphicsParticleMotion *motion) +{ + Q_D(QmlGraphicsParticles); + d->motion = motion; +} + +/*! + \qmlmethod Particles::burst + + Initiates a burst of particles. + + This method takes two arguments. The first argument is the number + of particles to emit and the second argument is the emissionRate for the + burst. If the second argument is omitted, it is treated as -1. The burst + of particles has a separate emissionRate and count to the normal emission of + particles. The burst uses the same values as normal emission for all other + properties, including emissionVariance and emitting. + + The normal emission of particles will continue during the burst, however + the particles created by the burst count towards the maximum number used by + normal emission. To avoid this behavior, use two Particles elements. + +*/ +void QmlGraphicsParticles::burst(int count, int emissionRate) +{ + Q_D(QmlGraphicsParticles); + d->bursts << qMakePair(count, emissionRate); + if (d->clock.state() != QAbstractAnimation::Running && d->emitting) + d->clock.start(); +} + +void QmlGraphicsParticlesPainter::updateSize() +{ + if (!isComponentComplete()) + return; + + const int parentX = parentItem()->x(); + const int parentY = parentItem()->y(); + for (int i = 0; i < d->particles.count(); ++i) { + const QmlGraphicsParticle &particle = d->particles.at(i); + if(particle.x > maxX) + maxX = particle.x; + if(particle.x < minX) + minX = particle.x; + if(particle.y > maxY) + maxY = particle.y; + if(particle.y < minY) + minY = particle.y; + } + + int myWidth = (int)(maxX-minX+0.5)+d->image.width(); + int myX = (int)(minX - parentX); + int myHeight = (int)(maxY-minY+0.5)+d->image.height(); + int myY = (int)(minY - parentY); + setWidth(myWidth); + setHeight(myHeight); + setX(myX); + setY(myY); +} + +void QmlGraphicsParticles::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *) +{ + Q_UNUSED(p); + //painting is done by the ParticlesPainter, so it can have the right size +} + +void QmlGraphicsParticlesPainter::paint(QPainter *p, const QStyleOptionGraphicsItem *, QWidget *) +{ + if (d->image.isNull() || d->particles.isEmpty()) + return; + + const int myX = x() + parentItem()->x(); + const int myY = y() + parentItem()->y(); + + QVarLengthArray pixmapData; + pixmapData.resize(d->particles.count()); + + const QRectF sourceRect = d->image.rect(); + qreal halfPWidth = sourceRect.width()/2.; + qreal halfPHeight = sourceRect.height()/2.; + for (int i = 0; i < d->particles.count(); ++i) { + const QmlGraphicsParticle &particle = d->particles.at(i); + pixmapData[i].point = QPointF(particle.x - myX + halfPWidth, particle.y - myY + halfPHeight); + pixmapData[i].opacity = particle.opacity; + + //these never change + pixmapData[i].rotation = 0; + pixmapData[i].scaleX = 1; + pixmapData[i].scaleY = 1; + pixmapData[i].source = sourceRect; + } + qDrawPixmaps(p, pixmapData.data(), d->particles.count(), d->image); +} + +void QmlGraphicsParticles::componentComplete() +{ + Q_D(QmlGraphicsParticles); + QmlGraphicsItem::componentComplete(); + if (d->count) { + d->paintItem->updateSize(); + d->clock.start(); + } + if (d->lifeSpanDev > d->lifeSpan) + d->lifeSpanDev = d->lifeSpan; +} + +QT_END_NAMESPACE diff --git a/src/declarative/graphicsitems/qmlgraphicsparticles_p.h b/src/declarative/graphicsitems/qmlgraphicsparticles_p.h new file mode 100644 index 0000000..851edd7 --- /dev/null +++ b/src/declarative/graphicsitems/qmlgraphicsparticles_p.h @@ -0,0 +1,252 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLGRAPHICSPARTICLES_H +#define QMLGRAPHICSPARTICLES_H + +#include + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class QmlGraphicsParticle; +class QmlGraphicsParticles; +class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotion : public QObject +{ + Q_OBJECT +public: + QmlGraphicsParticleMotion(QObject *parent=0); + + virtual void advance(QmlGraphicsParticle &, int interval); + virtual void created(QmlGraphicsParticle &); + virtual void destroy(QmlGraphicsParticle &); +}; + +class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotionLinear : public QmlGraphicsParticleMotion +{ + Q_OBJECT +public: + QmlGraphicsParticleMotionLinear(QObject *parent=0) + : QmlGraphicsParticleMotion(parent) {} + + virtual void advance(QmlGraphicsParticle &, int interval); +}; + +class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotionGravity : public QmlGraphicsParticleMotion +{ + Q_OBJECT + + Q_PROPERTY(int xattractor READ xAttractor WRITE setXAttractor) + Q_PROPERTY(int yattractor READ yAttractor WRITE setYAttractor) + Q_PROPERTY(int acceleration READ acceleration WRITE setAcceleration) +public: + QmlGraphicsParticleMotionGravity(QObject *parent=0) + : QmlGraphicsParticleMotion(parent), _xAttr(0), _yAttr(0), _accel(0.00005) {} + + int xAttractor() const { return _xAttr; } + void setXAttractor(int x) { _xAttr = x; } + + int yAttractor() const { return _yAttr; } + void setYAttractor(int y) { _yAttr = y; } + + int acceleration() const { return int(_accel * 1000000); } + void setAcceleration(int accel) { _accel = qreal(accel)/1000000.0; } + + virtual void advance(QmlGraphicsParticle &, int interval); + +private: + int _xAttr; + int _yAttr; + qreal _accel; +}; + +class Q_DECLARATIVE_EXPORT QmlGraphicsParticleMotionWander : public QmlGraphicsParticleMotion +{ + Q_OBJECT +public: + QmlGraphicsParticleMotionWander() + : QmlGraphicsParticleMotion(), particles(0), _xvariance(0), _yvariance(0) {} + + virtual void advance(QmlGraphicsParticle &, int interval); + virtual void created(QmlGraphicsParticle &); + virtual void destroy(QmlGraphicsParticle &); + + struct Data { + qreal x_targetV; + qreal y_targetV; + qreal x_peak; + qreal y_peak; + qreal x_var; + qreal y_var; + }; + + Q_PROPERTY(int xvariance READ xVariance WRITE setXVariance) + int xVariance() const { return int(_xvariance * 1000); } + void setXVariance(int var) { _xvariance = var / 1000.0; } + + Q_PROPERTY(int yvariance READ yVariance WRITE setYVariance) + int yVariance() const { return int(_yvariance * 1000); } + void setYVariance(int var) { _yvariance = var / 1000.0; } + + Q_PROPERTY(int pace READ pace WRITE setPace) + int pace() const { return int(_pace * 1000); } + void setPace(int pace) { _pace = pace / 1000.0; } + +private: + QmlGraphicsParticles *particles; + qreal _xvariance; + qreal _yvariance; + qreal _pace; +}; + +class QmlGraphicsParticlesPrivate; +class Q_DECLARATIVE_EXPORT QmlGraphicsParticles : public QmlGraphicsItem +{ + Q_OBJECT + + Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged) + Q_PROPERTY(int count READ count WRITE setCount NOTIFY countChanged) + Q_PROPERTY(int emissionRate READ emissionRate WRITE setEmissionRate NOTIFY emissionRateChanged) + Q_PROPERTY(qreal emissionVariance READ emissionVariance WRITE setEmissionVariance NOTIFY emissionVarianceChanged) + Q_PROPERTY(int lifeSpan READ lifeSpan WRITE setLifeSpan NOTIFY lifeSpanChanged) + Q_PROPERTY(int lifeSpanDeviation READ lifeSpanDeviation WRITE setLifeSpanDeviation NOTIFY lifeSpanDeviationChanged) + Q_PROPERTY(int fadeInDuration READ fadeInDuration WRITE setFadeInDuration NOTIFY fadeInDurationChanged) + Q_PROPERTY(int fadeOutDuration READ fadeOutDuration WRITE setFadeOutDuration NOTIFY fadeOutDurationChanged) + Q_PROPERTY(qreal angle READ angle WRITE setAngle NOTIFY angleChanged) + Q_PROPERTY(qreal angleDeviation READ angleDeviation WRITE setAngleDeviation NOTIFY angleDeviationChanged) + Q_PROPERTY(qreal velocity READ velocity WRITE setVelocity NOTIFY velocityChanged) + Q_PROPERTY(qreal velocityDeviation READ velocityDeviation WRITE setVelocityDeviation NOTIFY velocityDeviationChanged) + Q_PROPERTY(bool emitting READ emitting WRITE setEmitting NOTIFY emittingChanged) + Q_PROPERTY(QmlGraphicsParticleMotion *motion READ motion WRITE setMotion) + Q_CLASSINFO("DefaultProperty", "motion") + +public: + QmlGraphicsParticles(QmlGraphicsItem *parent=0); + ~QmlGraphicsParticles(); + + QUrl source() const; + void setSource(const QUrl &); + + int count() const; + void setCount(int cnt); + + int emissionRate() const; + void setEmissionRate(int); + + qreal emissionVariance() const; + void setEmissionVariance(qreal); + + int lifeSpan() const; + void setLifeSpan(int); + + int lifeSpanDeviation() const; + void setLifeSpanDeviation(int); + + int fadeInDuration() const; + void setFadeInDuration(int); + + int fadeOutDuration() const; + void setFadeOutDuration(int); + + qreal angle() const; + void setAngle(qreal); + + qreal angleDeviation() const; + void setAngleDeviation(qreal); + + qreal velocity() const; + void setVelocity(qreal); + + qreal velocityDeviation() const; + void setVelocityDeviation(qreal); + + bool emitting() const; + void setEmitting(bool); + + QmlGraphicsParticleMotion *motion() const; + void setMotion(QmlGraphicsParticleMotion *); + + void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); + +public Q_SLOTS: + void burst(int count, int emissionRate=-1); + +protected: + virtual void componentComplete(); + QmlGraphicsParticles(QmlGraphicsParticlesPrivate &dd, QmlGraphicsItem *parent); + +Q_SIGNALS: + void sourceChanged(); + void countChanged(); + void emissionRateChanged(); + void emissionVarianceChanged(); + void lifeSpanChanged(); + void lifeSpanDeviationChanged(); + void fadeInDurationChanged(); + void fadeOutDurationChanged(); + void angleChanged(); + void angleDeviationChanged(); + void velocityChanged(); + void velocityDeviationChanged(); + void emittingChanged(); + +private Q_SLOTS: + void imageLoaded(); + +private: + Q_DISABLE_COPY(QmlGraphicsParticles) + Q_DECLARE_PRIVATE_D(QGraphicsItem::d_ptr.data(), QmlGraphicsParticles) +}; + +QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlGraphicsParticleMotion) +QML_DECLARE_TYPE(QmlGraphicsParticleMotionLinear) +QML_DECLARE_TYPE(QmlGraphicsParticleMotionGravity) +QML_DECLARE_TYPE(QmlGraphicsParticleMotionWander) +QML_DECLARE_TYPE(QmlGraphicsParticles) + +QT_END_HEADER + +#endif diff --git a/tests/auto/declarative/qmlgraphicsparticles/data/particles.qml b/tests/auto/declarative/qmlgraphicsparticles/data/particles.qml index dccd2c7..c58927e 100644 --- a/tests/auto/declarative/qmlgraphicsparticles/data/particles.qml +++ b/tests/auto/declarative/qmlgraphicsparticles/data/particles.qml @@ -8,7 +8,7 @@ Rectangle{ objectName: "particles" width:1; height:1; anchors.centerIn: parent; opacity: 1 lifeSpan: 100; lifeSpanDeviation: 20; count:1000; - fadeInDuration: 20; fadeOutDuration: 20; + fadeInDuration: 20; fadeOutDuration: 20; count: -1; emissionRate: 1000 angle: 0; angleDeviation: 360; velocity: 500; velocityDeviation:30 source: "particle.png" } diff --git a/tests/auto/declarative/qmlgraphicsparticles/tst_qmlgraphicsparticles.cpp b/tests/auto/declarative/qmlgraphicsparticles/tst_qmlgraphicsparticles.cpp index e50437a..ed68eaf 100644 --- a/tests/auto/declarative/qmlgraphicsparticles/tst_qmlgraphicsparticles.cpp +++ b/tests/auto/declarative/qmlgraphicsparticles/tst_qmlgraphicsparticles.cpp @@ -91,8 +91,11 @@ void tst_QmlGraphicsParticles::properties() particles->setVelocityDeviation(100.0); QCOMPARE(particles->velocityDeviation(), 100.0); - particles->setEmitting(false); - QCOMPARE(particles->emitting(), false); + particles->setEmissionVariance(0.5); + QCOMPARE(particles->emissionVariance(),0.5); + + particles->setEmissionRate(12); + QCOMPARE(particles->emissionRate(), 12); } void tst_QmlGraphicsParticles::runs() -- cgit v0.12 From 656870157932a0b44de69927faa003c71eeb2a47 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Thu, 5 Nov 2009 13:56:56 +1000 Subject: Fix signal overriding. --- src/declarative/util/qmlpropertychanges.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/util/qmlpropertychanges.cpp b/src/declarative/util/qmlpropertychanges.cpp index dbf2bc4..3cc6ca9 100644 --- a/src/declarative/util/qmlpropertychanges.cpp +++ b/src/declarative/util/qmlpropertychanges.cpp @@ -307,7 +307,7 @@ QmlPropertyChangesPrivate::property(const QByteArray &property) if (!prop.isValid()) { qmlInfo(QmlPropertyChanges::tr("Cannot assign to non-existant property \"%1\"").arg(QString::fromUtf8(property)), q); return QmlMetaProperty(); - } else if (!prop.isWritable()) { + } else if (prop.type() != QmlMetaProperty::SignalProperty && !prop.isWritable()) { qmlInfo(QmlPropertyChanges::tr("Cannot assign to read-only property \"%1\"").arg(QString::fromUtf8(property)), q); return QmlMetaProperty(); } -- cgit v0.12 From 21ccecb582b251b9f7f3850b294868854ddac478 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 5 Nov 2009 14:49:30 +1000 Subject: qmlgraphicstext visual tests --- .../visual/qfxtext/font/data-MAC/plaintext.0.png | Bin 0 -> 94120 bytes .../visual/qfxtext/font/data-MAC/plaintext.qml | 351 ++++++++++++++++++++ .../visual/qfxtext/font/data-MAC/richtext.0.png | Bin 0 -> 121122 bytes .../visual/qfxtext/font/data-MAC/richtext.qml | 359 +++++++++++++++++++++ .../visual/qfxtext/font/data/plaintext.0.png | Bin 0 -> 94120 bytes .../visual/qfxtext/font/data/plaintext.qml | 351 ++++++++++++++++++++ .../visual/qfxtext/font/data/richtext.0.png | Bin 0 -> 121122 bytes .../visual/qfxtext/font/data/richtext.qml | 359 +++++++++++++++++++++ .../declarative/visual/qfxtext/font/plaintext.qml | 76 +++++ .../declarative/visual/qfxtext/font/richtext.qml | 76 +++++ 10 files changed, 1572 insertions(+) create mode 100644 tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.0.png create mode 100644 tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.qml create mode 100644 tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.0.png create mode 100644 tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.qml create mode 100644 tests/auto/declarative/visual/qfxtext/font/data/plaintext.0.png create mode 100644 tests/auto/declarative/visual/qfxtext/font/data/plaintext.qml create mode 100644 tests/auto/declarative/visual/qfxtext/font/data/richtext.0.png create mode 100644 tests/auto/declarative/visual/qfxtext/font/data/richtext.qml create mode 100644 tests/auto/declarative/visual/qfxtext/font/plaintext.qml create mode 100644 tests/auto/declarative/visual/qfxtext/font/richtext.qml diff --git a/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.0.png b/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.0.png new file mode 100644 index 0000000..50d56dc Binary files /dev/null and b/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.0.png differ diff --git a/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.qml b/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.qml new file mode 100644 index 0000000..63e20d4 --- /dev/null +++ b/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.qml @@ -0,0 +1,351 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 32 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 48 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 64 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 80 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 96 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 112 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 128 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 144 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 160 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 176 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 192 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 208 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 224 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 240 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 256 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 272 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 288 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 304 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 320 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 336 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 352 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 368 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 384 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 400 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 416 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 432 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 448 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 464 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 480 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 496 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 512 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 528 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 544 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 560 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 576 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 592 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 608 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 624 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 640 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 656 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 672 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 688 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 704 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 720 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 736 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 752 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 768 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 784 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 800 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 816 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 832 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 848 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 864 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 880 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 896 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 912 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 928 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 944 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 960 + image: "plaintext.0.png" + } + Frame { + msec: 976 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 992 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1008 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1024 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1040 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1056 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1072 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1088 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1104 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1120 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1136 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1152 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1168 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1184 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Key { + type: 6 + key: 16777249 + modifiers: 0 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 1200 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1216 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1232 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1248 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1264 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1280 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1296 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1312 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1328 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1344 + hash: "d553014bc56a46787e30459b0f44f57a" + } +} diff --git a/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.0.png b/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.0.png new file mode 100644 index 0000000..2910670 Binary files /dev/null and b/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.0.png differ diff --git a/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.qml b/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.qml new file mode 100644 index 0000000..d55ad90 --- /dev/null +++ b/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.qml @@ -0,0 +1,359 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 32 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 48 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 64 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 80 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 96 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 112 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 128 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 144 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 160 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 176 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 192 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 208 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 224 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 240 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 256 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 272 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 288 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 304 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 320 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 336 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 352 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 368 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 384 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 400 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 416 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 432 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 448 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 464 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 480 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 496 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 512 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 528 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 544 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 560 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 576 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 592 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 608 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 624 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 640 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 656 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 672 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 688 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 704 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 720 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 736 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 752 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 768 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 784 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 800 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 816 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 832 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 848 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 864 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 880 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 896 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 912 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 928 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 944 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 960 + image: "richtext.0.png" + } + Frame { + msec: 976 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 992 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1008 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1024 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1040 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1056 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1072 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1088 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1104 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1120 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1136 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1152 + hash: "dfea78484b840b8cab690e277b960723" + } + Key { + type: 6 + key: 16777249 + modifiers: 0 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 1168 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1184 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1200 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1216 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1232 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1248 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1264 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1280 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1296 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1312 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1328 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1344 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1360 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1376 + hash: "dfea78484b840b8cab690e277b960723" + } +} diff --git a/tests/auto/declarative/visual/qfxtext/font/data/plaintext.0.png b/tests/auto/declarative/visual/qfxtext/font/data/plaintext.0.png new file mode 100644 index 0000000..50d56dc Binary files /dev/null and b/tests/auto/declarative/visual/qfxtext/font/data/plaintext.0.png differ diff --git a/tests/auto/declarative/visual/qfxtext/font/data/plaintext.qml b/tests/auto/declarative/visual/qfxtext/font/data/plaintext.qml new file mode 100644 index 0000000..f4cbcbd --- /dev/null +++ b/tests/auto/declarative/visual/qfxtext/font/data/plaintext.qml @@ -0,0 +1,351 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 32 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 48 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 64 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 80 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 96 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 112 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 128 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 144 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 160 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 176 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 192 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 208 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 224 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 240 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 256 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 272 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 288 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 304 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 320 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 336 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 352 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 368 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 384 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 400 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 416 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 432 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 448 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 464 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 480 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 496 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 512 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 528 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 544 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 560 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 576 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 592 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 608 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 624 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 640 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 656 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 672 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 688 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 704 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 720 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 736 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 752 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 768 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 784 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 800 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 816 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 832 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 848 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 864 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 880 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 896 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 912 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 928 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 944 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 960 + image: "plaintext.0.png" + } + Frame { + msec: 976 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 992 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1008 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1024 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1040 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1056 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1072 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1088 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1104 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1120 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1136 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1152 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1168 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1184 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 1200 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1216 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1232 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1248 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1264 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1280 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1296 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1312 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1328 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1344 + hash: "d553014bc56a46787e30459b0f44f57a" + } +} diff --git a/tests/auto/declarative/visual/qfxtext/font/data/richtext.0.png b/tests/auto/declarative/visual/qfxtext/font/data/richtext.0.png new file mode 100644 index 0000000..2910670 Binary files /dev/null and b/tests/auto/declarative/visual/qfxtext/font/data/richtext.0.png differ diff --git a/tests/auto/declarative/visual/qfxtext/font/data/richtext.qml b/tests/auto/declarative/visual/qfxtext/font/data/richtext.qml new file mode 100644 index 0000000..9f396c2 --- /dev/null +++ b/tests/auto/declarative/visual/qfxtext/font/data/richtext.qml @@ -0,0 +1,359 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 32 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 48 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 64 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 80 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 96 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 112 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 128 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 144 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 160 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 176 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 192 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 208 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 224 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 240 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 256 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 272 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 288 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 304 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 320 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 336 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 352 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 368 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 384 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 400 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 416 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 432 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 448 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 464 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 480 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 496 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 512 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 528 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 544 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 560 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 576 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 592 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 608 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 624 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 640 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 656 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 672 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 688 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 704 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 720 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 736 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 752 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 768 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 784 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 800 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 816 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 832 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 848 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 864 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 880 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 896 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 912 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 928 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 944 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 960 + image: "richtext.0.png" + } + Frame { + msec: 976 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 992 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1008 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1024 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1040 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1056 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1072 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1088 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1104 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1120 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1136 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1152 + hash: "dfea78484b840b8cab690e277b960723" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 1168 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1184 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1200 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1216 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1232 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1248 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1264 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1280 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1296 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1312 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1328 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1344 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1360 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1376 + hash: "dfea78484b840b8cab690e277b960723" + } +} diff --git a/tests/auto/declarative/visual/qfxtext/font/plaintext.qml b/tests/auto/declarative/visual/qfxtext/font/plaintext.qml new file mode 100644 index 0000000..c58b95c --- /dev/null +++ b/tests/auto/declarative/visual/qfxtext/font/plaintext.qml @@ -0,0 +1,76 @@ +import Qt 4.6 + +Rectangle { + id: s; width: 800; height: 800; color: "lightsteelblue" + property string text: "The quick brown fox jumps over the lazy dog." + + Column { + spacing: 10 + Text { + text: s.text + } + Text { + text: s.text; font.pixelSize: 18 + } + Text { + text: s.text; font.pointSize: 25 + } + Text { + text: s.text; color: "red" + } + Text { + text: s.text; font.capitalization: "AllUppercase" + } + Text { + text: s.text; font.underline: true + } + Text { + text: s.text; font.overline: true + } + Text { + text: s.text; font.strikeout: true + } + Text { + text: s.text; font.underline: true; font.overline: true; font.strikeout: true + } + Text { + text: s.text; font.letterSpacing: 200 + } + Text { + text: s.text; font.underline: true; font.letterSpacing: 200; font.capitalization: "AllUppercase"; color: "blue" + } + Text { + text: s.text; font.overline: true; font.wordSpacing: 25; font.capitalization: "Capitalize"; color: "green" + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white" + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Sunken; styleColor: "gray" + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Raised; styleColor: "yellow" + } + Text { + text: s.text; horizontalAlignment: Text.AlignLeft; width: 800 + } + Text { + text: s.text; horizontalAlignment: Text.AlignHCenter; width: 800 + } + Text { + text: s.text; horizontalAlignment: Text.AlignRight; width: 800 + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white"; wrap: true; width: 200 + } + Text { + text: s.text; elide: Text.ElideLeft; width: 200 + } + Text { + text: s.text; elide: Text.ElideMiddle; width: 200 + } + Text { + text: s.text; elide: Text.ElideRight; width: 200 + } + } +} diff --git a/tests/auto/declarative/visual/qfxtext/font/richtext.qml b/tests/auto/declarative/visual/qfxtext/font/richtext.qml new file mode 100644 index 0000000..390527a --- /dev/null +++ b/tests/auto/declarative/visual/qfxtext/font/richtext.qml @@ -0,0 +1,76 @@ +import Qt 4.6 + +Rectangle { + id: s; width: 800; height: 800; color: "lightsteelblue" + property string text: "The quick brown fox jumps over the lazy dog." + + Column { + spacing: 10 + Text { + text: s.text + } + Text { + text: s.text; font.pixelSize: 18 + } + Text { + text: s.text; font.pointSize: 25 + } + Text { + text: s.text; color: "red" + } + Text { + text: s.text; font.capitalization: "AllUppercase" + } + Text { + text: s.text; font.underline: true + } + Text { + text: s.text; font.overline: true + } + Text { + text: s.text; font.strikeout: true + } + Text { + text: s.text; font.underline: true; font.overline: true; font.strikeout: true + } + Text { + text: s.text; font.letterSpacing: 200 + } + Text { + text: s.text; font.underline: true; font.letterSpacing: 200; font.capitalization: "AllUppercase"; color: "blue" + } + Text { + text: s.text; font.overline: true; font.wordSpacing: 25; font.capitalization: "Capitalize"; color: "green" + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white" + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Sunken; styleColor: "gray" + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Raised; styleColor: "yellow" + } + Text { + text: s.text; horizontalAlignment: Text.AlignLeft; width: 800 + } + Text { + text: s.text; horizontalAlignment: Text.AlignHCenter; width: 800 + } + Text { + text: s.text; horizontalAlignment: Text.AlignRight; width: 800 + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white"; wrap: true; width: 200 + } + Text { + text: s.text; elide: Text.ElideLeft; width: 200 + } + Text { + text: s.text; elide: Text.ElideMiddle; width: 200 + } + Text { + text: s.text; elide: Text.ElideRight; width: 200 + } + } +} -- cgit v0.12 From 7d290c0a38f325a3c024a38bcd5da94877d7fd64 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 5 Nov 2009 14:51:40 +1000 Subject: Loader cleanup and testing. --- .../graphicsitems/qmlgraphicsloader.cpp | 89 ++++++++++++---------- .../graphicsitems/qmlgraphicsloader_p.h | 1 - .../graphicsitems/qmlgraphicsloader_p_p.h | 5 +- tests/auto/declarative/qfxloader/tst_qfxloader.cpp | 13 +++- 4 files changed, 63 insertions(+), 45 deletions(-) diff --git a/src/declarative/graphicsitems/qmlgraphicsloader.cpp b/src/declarative/graphicsitems/qmlgraphicsloader.cpp index 4d463ab..d42e559 100644 --- a/src/declarative/graphicsitems/qmlgraphicsloader.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsloader.cpp @@ -45,7 +45,8 @@ QT_BEGIN_NAMESPACE QmlGraphicsLoaderPrivate::QmlGraphicsLoaderPrivate() -: item(0), component(0), ownComponent(false), resizeMode(QmlGraphicsLoader::SizeLoaderToItem) + : item(0), component(0), ownComponent(false) + , resizeMode(QmlGraphicsLoader::SizeLoaderToItem) { } @@ -53,6 +54,36 @@ QmlGraphicsLoaderPrivate::~QmlGraphicsLoaderPrivate() { } +void QmlGraphicsLoaderPrivate::clear() +{ + if (ownComponent) { + delete component; + component = 0; + ownComponent = false; + } + source = QUrl(); + + delete item; + item = 0; +} + +void QmlGraphicsLoaderPrivate::initResize() +{ + Q_Q(QmlGraphicsLoader); + + QmlGraphicsItem *resizeItem = 0; + if (resizeMode == QmlGraphicsLoader::SizeLoaderToItem) + resizeItem = item; + else if (resizeMode == QmlGraphicsLoader::SizeItemToLoader) + resizeItem = q; + if (resizeItem) { + QObject::connect(resizeItem, SIGNAL(widthChanged()), q, SLOT(_q_updateSize())); + QObject::connect(resizeItem, SIGNAL(heightChanged()), q, SLOT(_q_updateSize())); + } + _q_updateSize(); +} + + QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Loader,QmlGraphicsLoader) /*! @@ -74,6 +105,17 @@ QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Loader,QmlGraphicsLoader) MouseRegion { anchors.fill: parent; onClicked: pageLoader.source = "Page1.qml" } } \endcode + + If the Loader source is changed, any previous items instantiated + will be destroyed. Setting \c source to an empty string + will destroy the currently instantiated items, freeing resources + and leaving the Loader empty. For example: + + \code + pageLoader.source = "" + \endcode + + unloads "Page1.qml" and frees resources consumed by it. */ /*! @@ -102,7 +144,7 @@ QmlGraphicsLoader::~QmlGraphicsLoader() This property holds the URL of the QML component to instantiate. - \sa status, progress + \sa sourceComponent, status, progress */ QUrl QmlGraphicsLoader::source() const { @@ -116,12 +158,7 @@ void QmlGraphicsLoader::setSource(const QUrl &url) if (d->source == url) return; - if (d->ownComponent) { - delete d->component; - d->component = 0; - } - delete d->item; - d->item = 0; + d->clear(); d->source = url; if (d->source.isEmpty()) { @@ -164,7 +201,7 @@ void QmlGraphicsLoader::setSource(const QUrl &url) } \endqml - \sa source + \sa source, progress */ QmlComponent *QmlGraphicsLoader::sourceComponent() const @@ -179,13 +216,7 @@ void QmlGraphicsLoader::setSourceComponent(QmlComponent *comp) if (comp == d->component) return; - d->source = QUrl(); - if (d->ownComponent) { - delete d->component; - d->component = 0; - } - delete d->item; - d->item = 0; + d->clear(); d->component = comp; d->ownComponent = false; @@ -233,16 +264,7 @@ void QmlGraphicsLoaderPrivate::_q_sourceLoaded() if (item) { item->setParentItem(q); // item->setFocus(true); - QmlGraphicsItem *resizeItem = 0; - if (resizeMode == QmlGraphicsLoader::SizeLoaderToItem) - resizeItem = item; - else if (resizeMode == QmlGraphicsLoader::SizeItemToLoader) - resizeItem = q; - if (resizeItem) { - QObject::connect(resizeItem, SIGNAL(widthChanged()), q, SLOT(_q_updateSize())); - QObject::connect(resizeItem, SIGNAL(heightChanged()), q, SLOT(_q_updateSize())); - } - _q_updateSize(); + initResize(); } } else { delete obj; @@ -340,20 +362,7 @@ void QmlGraphicsLoader::setResizeMode(ResizeMode mode) } d->resizeMode = mode; - - if (d->item) { - QmlGraphicsItem *resizeItem = 0; - if (d->resizeMode == SizeLoaderToItem) - resizeItem = d->item; - else if (d->resizeMode == SizeItemToLoader) - resizeItem = this; - if (resizeItem) { - connect(resizeItem, SIGNAL(widthChanged()), this, SLOT(_q_updateSize())); - connect(resizeItem, SIGNAL(heightChanged()), this, SLOT(_q_updateSize())); - } - - d->_q_updateSize(); - } + d->initResize(); } void QmlGraphicsLoaderPrivate::_q_updateSize() diff --git a/src/declarative/graphicsitems/qmlgraphicsloader_p.h b/src/declarative/graphicsitems/qmlgraphicsloader_p.h index 8cd1819..ad516b4 100644 --- a/src/declarative/graphicsitems/qmlgraphicsloader_p.h +++ b/src/declarative/graphicsitems/qmlgraphicsloader_p.h @@ -63,7 +63,6 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsLoader : public QmlGraphicsItem Q_PROPERTY(QmlGraphicsItem *item READ item NOTIFY itemChanged) Q_PROPERTY(Status status READ status NOTIFY statusChanged) Q_PROPERTY(qreal progress READ progress NOTIFY progressChanged) - //### sourceItem public: QmlGraphicsLoader(QmlGraphicsItem *parent=0); diff --git a/src/declarative/graphicsitems/qmlgraphicsloader_p_p.h b/src/declarative/graphicsitems/qmlgraphicsloader_p_p.h index 23fedb7..cd7316d 100644 --- a/src/declarative/graphicsitems/qmlgraphicsloader_p_p.h +++ b/src/declarative/graphicsitems/qmlgraphicsloader_p_p.h @@ -67,10 +67,13 @@ public: QmlGraphicsLoaderPrivate(); ~QmlGraphicsLoaderPrivate(); + void clear(); + void initResize(); + QUrl source; QmlGraphicsItem *item; QmlComponent *component; - bool ownComponent; + bool ownComponent : 1; QmlGraphicsLoader::ResizeMode resizeMode; void _q_sourceLoaded(); diff --git a/tests/auto/declarative/qfxloader/tst_qfxloader.cpp b/tests/auto/declarative/qfxloader/tst_qfxloader.cpp index 9a8f8f1..9a3da90 100644 --- a/tests/auto/declarative/qfxloader/tst_qfxloader.cpp +++ b/tests/auto/declarative/qfxloader/tst_qfxloader.cpp @@ -110,14 +110,21 @@ void tst_qfxloader::component() void tst_qfxloader::clear() { - QmlComponent component(&engine, QByteArray("import Qt 4.6\nLoader { source: \"Rect120x60.qml\" }"), QUrl("file://" SRCDIR "/")); + QmlComponent component(&engine, QByteArray( + "import Qt 4.6\n" + " Loader { id: loader\n" + " source: 'Rect120x60.qml'\n" + " Timer { interval: 200; running: true; onTriggered: loader.source = '' }\n" + " }") + , QUrl("file://" SRCDIR "/")); QmlGraphicsLoader *loader = qobject_cast(component.create()); QVERIFY(loader != 0); QVERIFY(loader->item()); QCOMPARE(loader->progress(), 1.0); QCOMPARE(static_cast(loader)->children().count(), 1); - loader->setSource(QUrl("")); + QTest::qWait(500); + QVERIFY(loader->item() == 0); QCOMPARE(loader->progress(), 0.0); QCOMPARE(static_cast(loader)->children().count(), 0); @@ -136,7 +143,7 @@ void tst_qfxloader::urlToComponent() "}" ) , QUrl("file://" SRCDIR "/")); QmlGraphicsLoader *loader = qobject_cast(component.create()); - QTest::qWait(1000); + QTest::qWait(500); QVERIFY(loader != 0); QVERIFY(loader->item()); QCOMPARE(loader->progress(), 1.0); -- cgit v0.12 From 5343b49bbff4d813da1faf3fc4fc406441faccf0 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 5 Nov 2009 14:55:39 +1000 Subject: Fix flicking endpoint adjustment with variable height items. --- .../graphicsitems/qmlgraphicsflickable.cpp | 98 ++++++++++++---------- .../graphicsitems/qmlgraphicslistview.cpp | 6 +- 2 files changed, 56 insertions(+), 48 deletions(-) diff --git a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp index 19c5abc..aa3de26 100644 --- a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp @@ -185,17 +185,17 @@ void QmlGraphicsFlickablePrivate::flickX(qreal velocity) { Q_Q(QmlGraphicsFlickable); qreal maxDistance = -1; - if (qAbs(velocity) < minimumFlickVelocity) // Minimum velocity to avoid annoyingly slow flicks. - velocity = velocity < 0 ? -minimumFlickVelocity : minimumFlickVelocity; // -ve velocity means list is moving up if (velocity > 0) { - if (_moveX.value() < q->minXExtent()) - maxDistance = qAbs(q->minXExtent() -_moveX.value() + (overShoot?30:0)); - flickTargetX = q->minXExtent(); + const qreal minX = q->minXExtent(); + if (_moveX.value() < minX) + maxDistance = qAbs(minX -_moveX.value() + (overShoot?30:0)); + flickTargetX = minX; } else { - if (_moveX.value() > q->maxXExtent()) - maxDistance = qAbs(q->maxXExtent() - _moveX.value()) + (overShoot?30:0); - flickTargetX = q->maxXExtent(); + const qreal maxX = q->maxXExtent(); + if (_moveX.value() > maxX) + maxDistance = qAbs(maxX - _moveX.value()) + (overShoot?30:0); + flickTargetX = maxX; } if (maxDistance > 0) { qreal v = velocity; @@ -225,13 +225,15 @@ void QmlGraphicsFlickablePrivate::flickY(qreal velocity) qreal maxDistance = -1; // -ve velocity means list is moving up if (velocity > 0) { - if (_moveY.value() < q->minYExtent()) - maxDistance = qAbs(q->minYExtent() -_moveY.value() + (overShoot?30:0)); - flickTargetY = q->minYExtent(); + const qreal minY = q->minYExtent(); + if (_moveY.value() < minY) + maxDistance = qAbs(minY -_moveY.value() + (overShoot?30:0)); + flickTargetY = minY; } else { - if (_moveY.value() > q->maxYExtent()) - maxDistance = qAbs(q->maxYExtent() - _moveY.value()) + (overShoot?30:0); - flickTargetY = q->maxYExtent(); + const qreal maxY = q->maxYExtent(); + if (_moveY.value() > maxY) + maxDistance = qAbs(maxY - _moveY.value()) + (overShoot?30:0); + flickTargetY = maxY; } if (maxDistance > 0) { qreal v = velocity; @@ -261,8 +263,6 @@ void QmlGraphicsFlickablePrivate::fixupX() if (!q->xflick() || _moveX.timeLine()) return; - vTime = timeline.time(); - if (_moveX.value() > q->minXExtent() || (q->maxXExtent() > q->minXExtent())) { timeline.reset(_moveX); if (_moveX.value() != q->minXExtent()) @@ -275,6 +275,8 @@ void QmlGraphicsFlickablePrivate::fixupX() } else { flicked = false; } + + vTime = timeline.time(); } void QmlGraphicsFlickablePrivate::fixupY() @@ -283,8 +285,6 @@ void QmlGraphicsFlickablePrivate::fixupY() if (!q->yflick() || _moveY.timeLine()) return; - vTime = timeline.time(); - if (_moveY.value() > q->minYExtent() || (q->maxYExtent() > q->minYExtent())) { timeline.reset(_moveY); if (_moveY.value() != q->minYExtent()) @@ -297,6 +297,8 @@ void QmlGraphicsFlickablePrivate::fixupY() } else { flicked = false; } + + vTime = timeline.time(); } void QmlGraphicsFlickablePrivate::updateBeginningEnd() @@ -447,6 +449,7 @@ void QmlGraphicsFlickable::setViewportX(qreal pos) Q_D(QmlGraphicsFlickable); pos = qRound(pos); d->timeline.reset(d->_moveX); + d->vTime = d->timeline.time(); if (-pos != d->_moveX.value()) { d->_moveX.setValue(-pos); viewportMoved(); @@ -464,6 +467,7 @@ void QmlGraphicsFlickable::setViewportY(qreal pos) Q_D(QmlGraphicsFlickable); pos = qRound(pos); d->timeline.reset(d->_moveY); + d->vTime = d->timeline.time(); if (-pos != d->_moveY.value()) { d->_moveY.setValue(-pos); viewportMoved(); @@ -491,6 +495,7 @@ void QmlGraphicsFlickable::setInteractive(bool interactive) d->interactive = interactive; if (!interactive && d->flicked) { d->timeline.clear(); + d->vTime = d->timeline.time(); d->flicked = false; emit flickingChanged(); emit flickEnded(); @@ -837,56 +842,57 @@ void QmlGraphicsFlickable::viewportMoved() Q_D(QmlGraphicsFlickable); int elapsed = QmlGraphicsItemPrivate::elapsed(d->velocityTime); + if (!elapsed) + return; - if (elapsed) { - qreal prevY = d->lastFlickablePosition.x(); - qreal prevX = d->lastFlickablePosition.y(); - d->velocityTimeline.clear(); - if (d->pressed) { - qreal horizontalVelocity = (prevX - d->_moveX.value()) * 1000 / elapsed; - qreal verticalVelocity = (prevY - d->_moveY.value()) * 1000 / elapsed; - d->velocityTimeline.move(d->horizontalVelocity, horizontalVelocity, d->reportedVelocitySmoothing); - d->velocityTimeline.move(d->horizontalVelocity, 0, d->reportedVelocitySmoothing); - d->velocityTimeline.move(d->verticalVelocity, verticalVelocity, d->reportedVelocitySmoothing); - d->velocityTimeline.move(d->verticalVelocity, 0, d->reportedVelocitySmoothing); - } else { - if (d->timeline.time() != d->vTime) { - qreal horizontalVelocity = (prevX - d->_moveX.value()) * 1000 / (d->timeline.time() - d->vTime); - qreal verticalVelocity = (prevY - d->_moveY.value()) * 1000 / (d->timeline.time() - d->vTime); - d->horizontalVelocity.setValue(horizontalVelocity); - d->verticalVelocity.setValue(verticalVelocity); - } - d->vTime = d->timeline.time(); + qreal prevY = d->lastFlickablePosition.x(); + qreal prevX = d->lastFlickablePosition.y(); + d->velocityTimeline.clear(); + if (d->pressed) { + qreal horizontalVelocity = (prevX - d->_moveX.value()) * 1000 / elapsed; + qreal verticalVelocity = (prevY - d->_moveY.value()) * 1000 / elapsed; + d->velocityTimeline.move(d->horizontalVelocity, horizontalVelocity, d->reportedVelocitySmoothing); + d->velocityTimeline.move(d->horizontalVelocity, 0, d->reportedVelocitySmoothing); + d->velocityTimeline.move(d->verticalVelocity, verticalVelocity, d->reportedVelocitySmoothing); + d->velocityTimeline.move(d->verticalVelocity, 0, d->reportedVelocitySmoothing); + } else { + if (d->timeline.time() > d->vTime) { + qreal horizontalVelocity = (prevX - d->_moveX.value()) * 1000 / (d->timeline.time() - d->vTime); + qreal verticalVelocity = (prevY - d->_moveY.value()) * 1000 / (d->timeline.time() - d->vTime); + d->horizontalVelocity.setValue(horizontalVelocity); + d->verticalVelocity.setValue(verticalVelocity); } } - d->lastFlickablePosition = QPointF(d->_moveY.value(), d->_moveX.value()); QmlGraphicsItemPrivate::restart(d->velocityTime); - d->updateBeginningEnd(); + d->lastFlickablePosition = QPointF(d->_moveY.value(), d->_moveX.value()); - if (d->flicked) { + if (d->flicked && d->timeline.time() > d->vTime) { // Near an end and it seems that the extent has changed? // Recalculate the flick so that we don't end up in an odd position. if (d->velocityY > 0) { const qreal minY = minYExtent(); - if (minY - d->_moveY.value() < height()/3 && minY != d->flickTargetY) + if (minY - d->_moveY.value() < height()/2 && minY != d->flickTargetY) d->flickY(-d->verticalVelocity.value()); - } else { + } else if (d->velocityY < 0) { const qreal maxY = maxYExtent(); - if (d->_moveY.value() - maxY < height()/3 && maxY != d->flickTargetY) + if (d->_moveY.value() - maxY < height()/2 && maxY != d->flickTargetY) d->flickY(-d->verticalVelocity.value()); } if (d->velocityX > 0) { const qreal minX = minXExtent(); - if (minX - d->_moveX.value() < height()/3 && minX != d->flickTargetX) + if (minX - d->_moveX.value() < height()/2 && minX != d->flickTargetX) d->flickX(-d->horizontalVelocity.value()); - } else { + } else if (d->velocityX < 0) { const qreal maxX = maxXExtent(); - if (d->_moveX.value() - maxX < height()/3 && maxX != d->flickTargetX) + if (d->_moveX.value() - maxX < height()/2 && maxX != d->flickTargetX) d->flickX(-d->horizontalVelocity.value()); } } + + d->vTime = d->timeline.time(); + d->updateBeginningEnd(); } void QmlGraphicsFlickable::cancelFlick() diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp index efe047a..5adb9cf 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp @@ -815,8 +815,9 @@ void QmlGraphicsListViewPrivate::fixupY() if (haveHighlightRange && highlightRange == QmlGraphicsListView::StrictlyEnforceRange) { if (currentItem && highlight && currentItem->position() != highlight->position()) { moveReason = Mouse; - timeline.clear(); + timeline.reset(_moveY); timeline.move(_moveY, -(currentItem->position() - highlightRangeStart), QEasingCurve(QEasingCurve::InOutQuad), 200); + vTime = timeline.time(); } } } @@ -830,8 +831,9 @@ void QmlGraphicsListViewPrivate::fixupX() if (haveHighlightRange && highlightRange == QmlGraphicsListView::StrictlyEnforceRange) { if (currentItem && highlight && currentItem->position() != highlight->position()) { moveReason = Mouse; - timeline.clear(); + timeline.reset(_moveX); timeline.move(_moveX, -(currentItem->position() - highlightRangeStart), QEasingCurve(QEasingCurve::InOutQuad), 200); + vTime = timeline.time(); } } } -- cgit v0.12 From b8e788865cae90122e51ad1a2649d0891370fb3d Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 5 Nov 2009 15:05:03 +1000 Subject: use FreeMono.ttf --- examples/declarative/fonts/fonts.qml | 3 +-- examples/declarative/fonts/fonts/Fontin-Bold.ttf | Bin 30916 -> 0 bytes examples/declarative/fonts/fonts/FreeMono.ttf | Bin 0 -> 267400 bytes .../declarative/qmlfontloader/data/Fontin-Bold.ttf | Bin 30916 -> 0 bytes tests/auto/declarative/qmlfontloader/data/FreeMono.ttf | Bin 0 -> 267400 bytes .../declarative/qmlfontloader/tst_qmlfontloader.cpp | 4 ++-- 6 files changed, 3 insertions(+), 4 deletions(-) delete mode 100644 examples/declarative/fonts/fonts/Fontin-Bold.ttf create mode 100644 examples/declarative/fonts/fonts/FreeMono.ttf delete mode 100644 tests/auto/declarative/qmlfontloader/data/Fontin-Bold.ttf create mode 100644 tests/auto/declarative/qmlfontloader/data/FreeMono.ttf diff --git a/examples/declarative/fonts/fonts.qml b/examples/declarative/fonts/fonts.qml index 80d82ad..c7af666 100644 --- a/examples/declarative/fonts/fonts.qml +++ b/examples/declarative/fonts/fonts.qml @@ -8,8 +8,7 @@ Rectangle { FontLoader { id: fixedFont; name: "Courier" } - FontLoader { id: localFont; source: "fonts/Fontin-Bold.ttf" } - /* A font by Jos Buivenga (exljbris) -> www.exljbris.nl */ + FontLoader { id: localFont; source: "fonts/FreeMono.ttf" } FontLoader { id: webFont; source: "http://www.princexml.com/fonts/steffmann/Starburst.ttf" } FontLoader { id: webFont2; source: "http://wrong.address.org" } diff --git a/examples/declarative/fonts/fonts/Fontin-Bold.ttf b/examples/declarative/fonts/fonts/Fontin-Bold.ttf deleted file mode 100644 index f6a33b0..0000000 Binary files a/examples/declarative/fonts/fonts/Fontin-Bold.ttf and /dev/null differ diff --git a/examples/declarative/fonts/fonts/FreeMono.ttf b/examples/declarative/fonts/fonts/FreeMono.ttf new file mode 100644 index 0000000..d7ce52d Binary files /dev/null and b/examples/declarative/fonts/fonts/FreeMono.ttf differ diff --git a/tests/auto/declarative/qmlfontloader/data/Fontin-Bold.ttf b/tests/auto/declarative/qmlfontloader/data/Fontin-Bold.ttf deleted file mode 100644 index f6a33b0..0000000 Binary files a/tests/auto/declarative/qmlfontloader/data/Fontin-Bold.ttf and /dev/null differ diff --git a/tests/auto/declarative/qmlfontloader/data/FreeMono.ttf b/tests/auto/declarative/qmlfontloader/data/FreeMono.ttf new file mode 100644 index 0000000..d7ce52d Binary files /dev/null and b/tests/auto/declarative/qmlfontloader/data/FreeMono.ttf differ diff --git a/tests/auto/declarative/qmlfontloader/tst_qmlfontloader.cpp b/tests/auto/declarative/qmlfontloader/tst_qmlfontloader.cpp index 23f7025..a5ab13d 100644 --- a/tests/auto/declarative/qmlfontloader/tst_qmlfontloader.cpp +++ b/tests/auto/declarative/qmlfontloader/tst_qmlfontloader.cpp @@ -97,13 +97,13 @@ void tst_qmlfontloader::namedFont() void tst_qmlfontloader::localFont() { - QString componentStr = "import Qt 4.6\nFontLoader { source: \"" SRCDIR "/data/Fontin-Bold.ttf\" }"; + QString componentStr = "import Qt 4.6\nFontLoader { source: \"" SRCDIR "/data/FreeMono.ttf\" }"; QmlComponent component(&engine, componentStr.toLatin1(), QUrl("file://")); QmlFontLoader *fontObject = qobject_cast(component.create()); QVERIFY(fontObject != 0); QVERIFY(fontObject->source() != QUrl("")); - QTRY_COMPARE(fontObject->name(), QString("Fontin")); + QTRY_COMPARE(fontObject->name(), QString("FreeMono")); QTRY_VERIFY(fontObject->status() == QmlFontLoader::Ready); } -- cgit v0.12 From 5c488b43a87cfdb146bcc5564faa229c979b8292 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 5 Nov 2009 15:15:18 +1000 Subject: update text visuals --- .../visual/qfxtext/font/data-MAC/plaintext.0.png | Bin 94120 -> 103016 bytes .../visual/qfxtext/font/data-MAC/plaintext.qml | 166 ++++++++++---------- .../visual/qfxtext/font/data-MAC/richtext.0.png | Bin 121122 -> 136499 bytes .../visual/qfxtext/font/data-MAC/richtext.qml | 170 ++++++++++----------- .../declarative/visual/qfxtext/font/plaintext.qml | 15 +- .../declarative/visual/qfxtext/font/richtext.qml | 15 +- 6 files changed, 192 insertions(+), 174 deletions(-) diff --git a/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.0.png b/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.0.png index 50d56dc..a54a327 100644 Binary files a/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.0.png and b/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.0.png differ diff --git a/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.qml b/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.qml index 63e20d4..266c9a3 100644 --- a/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.qml +++ b/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.qml @@ -6,239 +6,239 @@ VisualTest { } Frame { msec: 16 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 32 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 48 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 64 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 80 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 96 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 112 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 128 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 144 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 160 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 176 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 192 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 208 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 224 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 240 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 256 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 272 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 288 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 304 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 320 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 336 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 352 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 368 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 384 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 400 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 416 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 432 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 448 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 464 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 480 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 496 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 512 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 528 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 544 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 560 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 576 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 592 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 608 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 624 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 640 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 656 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 672 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 688 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 704 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 720 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 736 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 752 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 768 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 784 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 800 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 816 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 832 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 848 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 864 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 880 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 896 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 912 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 928 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 944 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 960 @@ -246,59 +246,59 @@ VisualTest { } Frame { msec: 976 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 992 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1008 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1024 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1040 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1056 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1072 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1088 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1104 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1120 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1136 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1152 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1168 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1184 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Key { type: 6 @@ -310,42 +310,42 @@ VisualTest { } Frame { msec: 1200 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1216 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1232 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1248 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1264 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1280 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1296 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1312 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1328 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } Frame { msec: 1344 - hash: "d553014bc56a46787e30459b0f44f57a" + hash: "9f3d0a505dec1982d9b405be72c265f8" } } diff --git a/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.0.png b/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.0.png index 2910670..c2ddee1 100644 Binary files a/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.0.png and b/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.0.png differ diff --git a/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.qml b/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.qml index d55ad90..e971809 100644 --- a/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.qml +++ b/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.qml @@ -6,239 +6,239 @@ VisualTest { } Frame { msec: 16 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 32 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 48 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 64 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 80 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 96 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 112 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 128 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 144 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 160 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 176 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 192 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 208 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 224 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 240 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 256 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 272 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 288 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 304 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 320 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 336 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 352 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 368 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 384 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 400 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 416 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 432 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 448 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 464 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 480 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 496 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 512 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 528 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 544 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 560 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 576 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 592 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 608 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 624 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 640 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 656 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 672 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 688 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 704 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 720 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 736 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 752 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 768 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 784 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 800 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 816 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 832 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 848 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 864 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 880 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 896 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 912 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 928 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 944 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 960 @@ -246,51 +246,51 @@ VisualTest { } Frame { msec: 976 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 992 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1008 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1024 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1040 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1056 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1072 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1088 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1104 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1120 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1136 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1152 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Key { type: 6 @@ -302,58 +302,58 @@ VisualTest { } Frame { msec: 1168 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1184 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1200 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1216 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1232 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1248 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1264 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1280 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1296 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1312 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1328 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1344 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1360 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } Frame { msec: 1376 - hash: "dfea78484b840b8cab690e277b960723" + hash: "259cc9829171ea866dac4ffe8ef6b489" } } diff --git a/tests/auto/declarative/visual/qfxtext/font/plaintext.qml b/tests/auto/declarative/visual/qfxtext/font/plaintext.qml index c58b95c..f219e09 100644 --- a/tests/auto/declarative/visual/qfxtext/font/plaintext.qml +++ b/tests/auto/declarative/visual/qfxtext/font/plaintext.qml @@ -1,7 +1,7 @@ import Qt 4.6 Rectangle { - id: s; width: 800; height: 800; color: "lightsteelblue" + id: s; width: 800; height: 1000; color: "lightsteelblue" property string text: "The quick brown fox jumps over the lazy dog." Column { @@ -16,7 +16,7 @@ Rectangle { text: s.text; font.pointSize: 25 } Text { - text: s.text; color: "red" + text: s.text; color: "red"; smooth: true } Text { text: s.text; font.capitalization: "AllUppercase" @@ -25,7 +25,7 @@ Rectangle { text: s.text; font.underline: true } Text { - text: s.text; font.overline: true + text: s.text; font.overline: true; smooth: true } Text { text: s.text; font.strikeout: true @@ -72,5 +72,14 @@ Rectangle { Text { text: s.text; elide: Text.ElideRight; width: 200 } + Text { + text: s.text; elide: Text.ElideLeft; width: 200; wrap: true + } + Text { + text: s.text; elide: Text.ElideMiddle; width: 200; wrap: true + } + Text { + text: s.text; elide: Text.ElideRight; width: 200; wrap: true + } } } diff --git a/tests/auto/declarative/visual/qfxtext/font/richtext.qml b/tests/auto/declarative/visual/qfxtext/font/richtext.qml index 390527a..00a9749 100644 --- a/tests/auto/declarative/visual/qfxtext/font/richtext.qml +++ b/tests/auto/declarative/visual/qfxtext/font/richtext.qml @@ -1,7 +1,7 @@ import Qt 4.6 Rectangle { - id: s; width: 800; height: 800; color: "lightsteelblue" + id: s; width: 800; height: 1000; color: "lightsteelblue" property string text: "The quick brown fox jumps over the lazy dog." Column { @@ -16,7 +16,7 @@ Rectangle { text: s.text; font.pointSize: 25 } Text { - text: s.text; color: "red" + text: s.text; color: "red"; smooth: true } Text { text: s.text; font.capitalization: "AllUppercase" @@ -25,7 +25,7 @@ Rectangle { text: s.text; font.underline: true } Text { - text: s.text; font.overline: true + text: s.text; font.overline: true; smooth: true } Text { text: s.text; font.strikeout: true @@ -72,5 +72,14 @@ Rectangle { Text { text: s.text; elide: Text.ElideRight; width: 200 } + Text { + text: s.text; elide: Text.ElideLeft; width: 200; wrap: true + } + Text { + text: s.text; elide: Text.ElideMiddle; width: 200; wrap: true + } + Text { + text: s.text; elide: Text.ElideRight; width: 200; wrap: true + } } } -- cgit v0.12 From e1f01000ec127dd5a949eabf9b436f649597bf01 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 5 Nov 2009 15:16:51 +1000 Subject: Add listview test file. --- .../listview/data/listview-sections.qml | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 tests/auto/declarative/listview/data/listview-sections.qml diff --git a/tests/auto/declarative/listview/data/listview-sections.qml b/tests/auto/declarative/listview/data/listview-sections.qml new file mode 100644 index 0000000..56700be --- /dev/null +++ b/tests/auto/declarative/listview/data/listview-sections.qml @@ -0,0 +1,59 @@ +import Qt 4.6 + +Rectangle { + width: 240 + height: 320 + color: "#ffffff" + resources: [ + Component { + id: myDelegate + Item { + id: wrapper + objectName: "wrapper" + height: ListView.prevSection != ListView.section ? 40 : 20; + width: 240 + Rectangle { + y: wrapper.ListView.prevSection != wrapper.ListView.section ? 20 : 0 + height: 20 + width: parent.width + color: wrapper.ListView.isCurrentItem ? "lightsteelblue" : "white" + Text { + text: index + } + Text { + x: 30 + id: textName + objectName: "textName" + text: name + } + Text { + x: 120 + id: textNumber + objectName: "textNumber" + text: number + } + Text { + x: 200 + text: wrapper.y + } + } + Rectangle { + color: "#99bb99" + height: wrapper.ListView.prevSection != wrapper.ListView.section ? 20 : 0 + width: parent.width + visible: wrapper.ListView.prevSection != wrapper.ListView.section ? true : false + Text { text: wrapper.ListView.section } + } + } + } + ] + ListView { + id: list + objectName: "list" + width: 240 + height: 320 + model: testModel + delegate: myDelegate + sectionExpression: "Math.floor(index/5)" + } +} -- cgit v0.12 From 34dcd4a715ca3f43901c245322e7c42dea646b8d Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 5 Nov 2009 15:41:40 +1000 Subject: fillmode visual test --- .../visual/fillmode/data-MAC/fillmode.0.png | Bin 0 -> 26099 bytes .../visual/fillmode/data-MAC/fillmode.qml | 279 +++++++++++++++++++++ .../visual/fillmode/data/fillmode.0.png | Bin 0 -> 26099 bytes .../declarative/visual/fillmode/data/fillmode.qml | 279 +++++++++++++++++++++ tests/auto/declarative/visual/fillmode/face.png | Bin 0 -> 905 bytes .../auto/declarative/visual/fillmode/fillmode.qml | 16 ++ 6 files changed, 574 insertions(+) create mode 100644 tests/auto/declarative/visual/fillmode/data-MAC/fillmode.0.png create mode 100644 tests/auto/declarative/visual/fillmode/data-MAC/fillmode.qml create mode 100644 tests/auto/declarative/visual/fillmode/data/fillmode.0.png create mode 100644 tests/auto/declarative/visual/fillmode/data/fillmode.qml create mode 100644 tests/auto/declarative/visual/fillmode/face.png create mode 100644 tests/auto/declarative/visual/fillmode/fillmode.qml diff --git a/tests/auto/declarative/visual/fillmode/data-MAC/fillmode.0.png b/tests/auto/declarative/visual/fillmode/data-MAC/fillmode.0.png new file mode 100644 index 0000000..9c9ceae Binary files /dev/null and b/tests/auto/declarative/visual/fillmode/data-MAC/fillmode.0.png differ diff --git a/tests/auto/declarative/visual/fillmode/data-MAC/fillmode.qml b/tests/auto/declarative/visual/fillmode/data-MAC/fillmode.qml new file mode 100644 index 0000000..7ac6f51 --- /dev/null +++ b/tests/auto/declarative/visual/fillmode/data-MAC/fillmode.qml @@ -0,0 +1,279 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 32 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 48 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 64 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 80 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 96 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 112 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 128 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 144 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 160 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 176 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 192 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 208 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 224 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 240 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 256 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 272 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 288 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 304 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 320 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 336 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 352 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 368 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 384 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 400 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 416 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 432 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 448 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 464 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 480 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 496 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 512 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 528 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 544 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 560 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 576 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 592 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 608 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 624 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 640 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 656 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 672 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 688 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 704 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Key { + type: 6 + key: 16777249 + modifiers: 0 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 720 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 736 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 752 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 768 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 784 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 800 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 816 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 832 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 848 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 864 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 880 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 896 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 912 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 928 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 944 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 960 + image: "fillmode.0.png" + } + Frame { + msec: 976 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 992 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 1008 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 1024 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 1040 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 1056 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } +} diff --git a/tests/auto/declarative/visual/fillmode/data/fillmode.0.png b/tests/auto/declarative/visual/fillmode/data/fillmode.0.png new file mode 100644 index 0000000..9c9ceae Binary files /dev/null and b/tests/auto/declarative/visual/fillmode/data/fillmode.0.png differ diff --git a/tests/auto/declarative/visual/fillmode/data/fillmode.qml b/tests/auto/declarative/visual/fillmode/data/fillmode.qml new file mode 100644 index 0000000..58af8e8 --- /dev/null +++ b/tests/auto/declarative/visual/fillmode/data/fillmode.qml @@ -0,0 +1,279 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 32 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 48 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 64 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 80 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 96 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 112 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 128 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 144 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 160 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 176 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 192 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 208 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 224 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 240 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 256 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 272 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 288 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 304 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 320 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 336 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 352 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 368 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 384 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 400 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 416 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 432 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 448 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 464 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 480 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 496 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 512 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 528 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 544 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 560 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 576 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 592 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 608 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 624 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 640 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 656 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 672 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 688 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 704 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 720 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 736 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 752 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 768 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 784 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 800 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 816 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 832 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 848 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 864 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 880 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 896 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 912 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 928 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 944 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 960 + image: "fillmode.0.png" + } + Frame { + msec: 976 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 992 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 1008 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 1024 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 1040 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } + Frame { + msec: 1056 + hash: "c8cb8d51ca04231dc272133faaf2fb6d" + } +} diff --git a/tests/auto/declarative/visual/fillmode/face.png b/tests/auto/declarative/visual/fillmode/face.png new file mode 100644 index 0000000..9623b1a Binary files /dev/null and b/tests/auto/declarative/visual/fillmode/face.png differ diff --git a/tests/auto/declarative/visual/fillmode/fillmode.qml b/tests/auto/declarative/visual/fillmode/fillmode.qml new file mode 100644 index 0000000..8450bf2 --- /dev/null +++ b/tests/auto/declarative/visual/fillmode/fillmode.qml @@ -0,0 +1,16 @@ +import Qt 4.6 + +Rectangle { + id: screen; width: 750; height: 600; color: "gray" + property string source: "face.png" + + Grid { + columns: 3 + Image { width: 250; height: 300; source: screen.source; fillMode: Image.Stretch } + Image { width: 250; height: 300; source: screen.source; fillMode: Image.PreserveAspectFit; smooth: true } + Image { width: 250; height: 300; source: screen.source; fillMode: Image.PreserveAspectCrop } + Image { width: 250; height: 300; source: screen.source; fillMode: Image.Tile; smooth: true } + Image { width: 250; height: 300; source: screen.source; fillMode: Image.TileHorizontally } + Image { width: 250; height: 300; source: screen.source; fillMode: Image.TileVertically } + } +} -- cgit v0.12 From cec070f3905bcf6127e4e14236d5c61f09e3a61f Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Thu, 5 Nov 2009 15:59:53 +1000 Subject: Document the vector3d type in QML Task-number: QTBUG-5334 Reviewed-by: Aaron Kennedy --- doc/src/declarative/basictypes.qdoc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/doc/src/declarative/basictypes.qdoc b/doc/src/declarative/basictypes.qdoc index 80ec211..0551443 100644 --- a/doc/src/declarative/basictypes.qdoc +++ b/doc/src/declarative/basictypes.qdoc @@ -233,4 +233,25 @@ \endqml \c Child1, \c Child2 and \c Child3 will all be added to the children list in the order in which they appear. + + \target basicqmlvector3d + \section1 vector3d + + A \c vector3d is specified in \c "x,y,z" format: + + \qml + Rotation { angle: 60; axis: "0,1,0" } + \endqml + + or with the \c{Qt.vector3d()} helper function: + + \qml + Rotation { angle: 60; axis: Qt.vector3d(0, 1, 0) } + \endqml + + or as separate \c x, \c y, and \c z components: + + \qml + Rotation { angle: 60; axis.x: 0; axis.y: 1; axis.z: 0 } + \endqml */ -- cgit v0.12 From a1f47211146629f702457150235da4475c1163ed Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 5 Nov 2009 16:46:17 +1000 Subject: qmlsystempalette autotests --- src/declarative/util/qmlsystempalette.cpp | 26 +--- src/declarative/util/qmlsystempalette_p.h | 13 +- tests/auto/declarative/declarative.pro | 1 + .../qmlsystempalette/qmlsystempalette.pro | 5 + .../qmlsystempalette/tst_qmlsystempalette.cpp | 154 +++++++++++++++++++++ 5 files changed, 171 insertions(+), 28 deletions(-) create mode 100644 tests/auto/declarative/qmlsystempalette/qmlsystempalette.pro create mode 100644 tests/auto/declarative/qmlsystempalette/tst_qmlsystempalette.cpp diff --git a/src/declarative/util/qmlsystempalette.cpp b/src/declarative/util/qmlsystempalette.cpp index bb3ec70..4ddc82d 100644 --- a/src/declarative/util/qmlsystempalette.cpp +++ b/src/declarative/util/qmlsystempalette.cpp @@ -256,39 +256,23 @@ QColor QmlSystemPalette::highlightedText() const } /*! - \qmlproperty color SystemPalette::lighter -*/ -QColor QmlSystemPalette::lighter(const QColor& color) const -{ - return color.lighter(); -} - -/*! - \qmlproperty color SystemPalette::darker -*/ -QColor QmlSystemPalette::darker(const QColor& color) const -{ - return color.darker(); -} - -/*! - \qmlproperty QPalette::ColorGroup SystemPalette::colorGroup + \qmlproperty QmlSystemPalette::ColorGroup SystemPalette::colorGroup The color group of the palette. It can be Active, Inactive or Disabled. Active is the default. \sa QPalette::ColorGroup */ -QPalette::ColorGroup QmlSystemPalette::colorGroup() const +QmlSystemPalette::ColorGroup QmlSystemPalette::colorGroup() const { Q_D(const QmlSystemPalette); - return d->group; + return (QmlSystemPalette::ColorGroup)d->group; } -void QmlSystemPalette::setColorGroup(QPalette::ColorGroup colorGroup) +void QmlSystemPalette::setColorGroup(QmlSystemPalette::ColorGroup colorGroup) { Q_D(QmlSystemPalette); - d->group = colorGroup; + d->group = (QPalette::ColorGroup)colorGroup; emit paletteChanged(); } diff --git a/src/declarative/util/qmlsystempalette_p.h b/src/declarative/util/qmlsystempalette_p.h index e87534e..6abbfe0 100644 --- a/src/declarative/util/qmlsystempalette_p.h +++ b/src/declarative/util/qmlsystempalette_p.h @@ -56,9 +56,10 @@ class QmlSystemPalettePrivate; class Q_DECLARATIVE_EXPORT QmlSystemPalette : public QObject { Q_OBJECT + Q_ENUMS(ColorGroup) Q_DECLARE_PRIVATE(QmlSystemPalette) - Q_PROPERTY(QPalette::ColorGroup colorGroup READ colorGroup WRITE setColorGroup NOTIFY paletteChanged) + Q_PROPERTY(QmlSystemPalette::ColorGroup colorGroup READ colorGroup WRITE setColorGroup NOTIFY paletteChanged) Q_PROPERTY(QColor window READ window NOTIFY paletteChanged) Q_PROPERTY(QColor windowText READ windowText NOTIFY paletteChanged) Q_PROPERTY(QColor base READ base NOTIFY paletteChanged) @@ -78,6 +79,8 @@ public: QmlSystemPalette(QObject *parent=0); ~QmlSystemPalette(); + enum ColorGroup { Active = QPalette::Active, Inactive = QPalette::Inactive, Disabled = QPalette::Disabled }; + QColor window() const; QColor windowText() const; @@ -97,12 +100,8 @@ public: QColor highlight() const; QColor highlightedText() const; - QPalette::ColorGroup colorGroup() const; - void setColorGroup(QPalette::ColorGroup); - - // FIXME: Move to utility class? - Q_INVOKABLE QColor lighter(const QColor&) const; - Q_INVOKABLE QColor darker(const QColor&) const; + QmlSystemPalette::ColorGroup colorGroup() const; + void setColorGroup(QmlSystemPalette::ColorGroup); Q_SIGNALS: void paletteChanged(); diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index b9f59d6..1625a15 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -30,6 +30,7 @@ SUBDIRS += \ qmlpixmapcache \ # Cover qmlpropertymap \ # Cover qmlqt \ # Cover + qmlsystempalette \ # Cover qmltimer \ # Cover qmlxmllistmodel \ # Cover repeater \ # Cover diff --git a/tests/auto/declarative/qmlsystempalette/qmlsystempalette.pro b/tests/auto/declarative/qmlsystempalette/qmlsystempalette.pro new file mode 100644 index 0000000..4d55b46 --- /dev/null +++ b/tests/auto/declarative/qmlsystempalette/qmlsystempalette.pro @@ -0,0 +1,5 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + +SOURCES += tst_qmlsystempalette.cpp diff --git a/tests/auto/declarative/qmlsystempalette/tst_qmlsystempalette.cpp b/tests/auto/declarative/qmlsystempalette/tst_qmlsystempalette.cpp new file mode 100644 index 0000000..039eaa8 --- /dev/null +++ b/tests/auto/declarative/qmlsystempalette/tst_qmlsystempalette.cpp @@ -0,0 +1,154 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include +#include +#include +#include +#include "../../../shared/util.h" + +class tst_qmlsystempalette : public QObject + +{ + Q_OBJECT +public: + tst_qmlsystempalette(); + +private slots: + void activePalette(); + void inactivePalette(); + void disabledPalette(); + +private: + QmlEngine engine; +}; + +tst_qmlsystempalette::tst_qmlsystempalette() +{ +} + +void tst_qmlsystempalette::activePalette() +{ + QString componentStr = "import Qt 4.6\nSystemPalette { }"; + QmlComponent component(&engine, componentStr.toLatin1(), QUrl("file://")); + QmlSystemPalette *object = qobject_cast(component.create()); + + QVERIFY(object != 0); + + QPalette palette; + palette.setCurrentColorGroup(QPalette::Active); + QCOMPARE(palette.window().color(), object->window()); + QCOMPARE(palette.windowText().color(), object->windowText()); + QCOMPARE(palette.base().color(), object->base()); + QCOMPARE(palette.text().color(), object->text()); + QCOMPARE(palette.alternateBase().color(), object->alternateBase()); + QCOMPARE(palette.button().color(), object->button()); + QCOMPARE(palette.buttonText().color(), object->buttonText()); + QCOMPARE(palette.light().color(), object->light()); + QCOMPARE(palette.midlight().color(), object->midlight()); + QCOMPARE(palette.dark().color(), object->dark()); + QCOMPARE(palette.mid().color(), object->mid()); + QCOMPARE(palette.shadow().color(), object->shadow()); + QCOMPARE(palette.highlight().color(), object->highlight()); + QCOMPARE(palette.highlightedText().color(), object->highlightedText()); + + delete object; +} + +void tst_qmlsystempalette::inactivePalette() +{ + QString componentStr = "import Qt 4.6\nSystemPalette { colorGroup: SystemPalette.Inactive }"; + QmlComponent component(&engine, componentStr.toLatin1(), QUrl("file://")); + QmlSystemPalette *object = qobject_cast(component.create()); + + QVERIFY(object != 0); + + QPalette palette; + palette.setCurrentColorGroup(QPalette::Inactive); + QCOMPARE(palette.window().color(), object->window()); + QCOMPARE(palette.windowText().color(), object->windowText()); + QCOMPARE(palette.base().color(), object->base()); + QCOMPARE(palette.text().color(), object->text()); + QCOMPARE(palette.alternateBase().color(), object->alternateBase()); + QCOMPARE(palette.button().color(), object->button()); + QCOMPARE(palette.buttonText().color(), object->buttonText()); + QCOMPARE(palette.light().color(), object->light()); + QCOMPARE(palette.midlight().color(), object->midlight()); + QCOMPARE(palette.dark().color(), object->dark()); + QCOMPARE(palette.mid().color(), object->mid()); + QCOMPARE(palette.shadow().color(), object->shadow()); + QCOMPARE(palette.highlight().color(), object->highlight()); + QCOMPARE(palette.highlightedText().color(), object->highlightedText()); + + delete object; +} + +void tst_qmlsystempalette::disabledPalette() +{ + QString componentStr = "import Qt 4.6\nSystemPalette { colorGroup: SystemPalette.Disabled }"; + QmlComponent component(&engine, componentStr.toLatin1(), QUrl("file://")); + QmlSystemPalette *object = qobject_cast(component.create()); + + QVERIFY(object != 0); + + QPalette palette; + palette.setCurrentColorGroup(QPalette::Disabled); + QCOMPARE(palette.window().color(), object->window()); + QCOMPARE(palette.windowText().color(), object->windowText()); + QCOMPARE(palette.base().color(), object->base()); + QCOMPARE(palette.text().color(), object->text()); + QCOMPARE(palette.alternateBase().color(), object->alternateBase()); + QCOMPARE(palette.button().color(), object->button()); + QCOMPARE(palette.buttonText().color(), object->buttonText()); + QCOMPARE(palette.light().color(), object->light()); + QCOMPARE(palette.midlight().color(), object->midlight()); + QCOMPARE(palette.dark().color(), object->dark()); + QCOMPARE(palette.mid().color(), object->mid()); + QCOMPARE(palette.shadow().color(), object->shadow()); + QCOMPARE(palette.highlight().color(), object->highlight()); + QCOMPARE(palette.highlightedText().color(), object->highlightedText()); + + delete object; +} + +QTEST_MAIN(tst_qmlsystempalette) + +#include "tst_qmlsystempalette.moc" -- cgit v0.12 From 01d7ae66da344f9aaef039310ac241015ec4cad5 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 5 Nov 2009 16:56:14 +1000 Subject: Use darker() and lighter() functions from global Qt object rather than from SystemPalette. --- demos/declarative/calculator/CalcButton.qml | 2 +- demos/declarative/calculator/calculator.qml | 2 +- demos/declarative/samegame/content/Button.qml | 2 +- demos/declarative/samegame/samegame.qml | 2 +- examples/declarative/dynamic/dynamic.qml | 2 +- examples/declarative/dynamic/qml/Button.qml | 2 +- examples/declarative/loader/Browser.qml | 4 ++-- examples/declarative/tutorials/samegame/samegame1/Button.qml | 2 +- examples/declarative/tutorials/samegame/samegame1/samegame.qml | 2 +- examples/declarative/tutorials/samegame/samegame2/Button.qml | 2 +- examples/declarative/tutorials/samegame/samegame2/samegame.qml | 2 +- examples/declarative/tutorials/samegame/samegame3/Button.qml | 2 +- examples/declarative/tutorials/samegame/samegame3/samegame.qml | 2 +- examples/declarative/tutorials/samegame/samegame4/content/Button.qml | 2 +- examples/declarative/tutorials/samegame/samegame4/samegame.qml | 2 +- 15 files changed, 16 insertions(+), 16 deletions(-) diff --git a/demos/declarative/calculator/CalcButton.qml b/demos/declarative/calculator/CalcButton.qml index c2e3a81..03ede9c 100644 --- a/demos/declarative/calculator/CalcButton.qml +++ b/demos/declarative/calculator/CalcButton.qml @@ -9,7 +9,7 @@ Rectangle { id: button; width: 50; height: 30 border.color: palette.mid; radius: 6 gradient: Gradient { - GradientStop { id: G1; position: 0.0; color: palette.lighter(palette.button) } + GradientStop { id: G1; position: 0.0; color: Qt.lighter(palette.button) } GradientStop { id: G2; position: 1.0; color: palette.button } } diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml index 8041025..18ee5b9 100644 --- a/demos/declarative/calculator/calculator.qml +++ b/demos/declarative/calculator/calculator.qml @@ -3,7 +3,7 @@ import Qt 4.6 Rectangle { width: 320; height: 270; color: palette.window - SystemPalette { id: palette; colorGroup: Qt.Active } + SystemPalette { id: palette } Script { source: "calculator.js" } Column { diff --git a/demos/declarative/samegame/content/Button.qml b/demos/declarative/samegame/content/Button.qml index 301124e..63cd555 100644 --- a/demos/declarative/samegame/content/Button.qml +++ b/demos/declarative/samegame/content/Button.qml @@ -8,7 +8,7 @@ Rectangle { color: activePalette.button; smooth: true width: txtItem.width + 20; height: txtItem.height + 6 - border.width: 1; border.color: activePalette.darker(activePalette.button); radius: 8; + border.width: 1; border.color: Qt.darker(activePalette.button); radius: 8; gradient: Gradient { GradientStop { diff --git a/demos/declarative/samegame/samegame.qml b/demos/declarative/samegame/samegame.qml index 4560b56..19b929f 100644 --- a/demos/declarative/samegame/samegame.qml +++ b/demos/declarative/samegame/samegame.qml @@ -5,7 +5,7 @@ Rectangle { id: screen width: 490; height: 720 - SystemPalette { id: activePalette; colorGroup: Qt.Active } + SystemPalette { id: activePalette } Item { width: parent.width; anchors.top: parent.top; anchors.bottom: toolBar.top diff --git a/examples/declarative/dynamic/dynamic.qml b/examples/declarative/dynamic/dynamic.qml index 0166b4c..f420a1c 100644 --- a/examples/declarative/dynamic/dynamic.qml +++ b/examples/declarative/dynamic/dynamic.qml @@ -46,7 +46,7 @@ Item { ColorAnimation { duration: 3000 } } - SystemPalette { id: activePalette; colorGroup: Qt.Active } + SystemPalette { id: activePalette } // toolbox Rectangle { diff --git a/examples/declarative/dynamic/qml/Button.qml b/examples/declarative/dynamic/qml/Button.qml index 2769cd8..cf2ffa7 100644 --- a/examples/declarative/dynamic/qml/Button.qml +++ b/examples/declarative/dynamic/qml/Button.qml @@ -6,7 +6,7 @@ Rectangle { property var text signal clicked - SystemPalette { id: activePalette; colorGroup: Qt.Active } + SystemPalette { id: activePalette } height: text.height + 10 width: text.width + 20 border.width: 1 diff --git a/examples/declarative/loader/Browser.qml b/examples/declarative/loader/Browser.qml index f2cbd3d..9139346 100644 --- a/examples/declarative/loader/Browser.qml +++ b/examples/declarative/loader/Browser.qml @@ -19,7 +19,7 @@ Rectangle { folder: "file:///E:/" // Documents on your S60 phone (or Windows E: drive) } - SystemPalette { id: palette; colorGroup: Qt.Active } + SystemPalette { id: palette } Script { function down(path) { @@ -72,7 +72,7 @@ Rectangle { anchors.fill: parent gradient: Gradient { GradientStop { id: t1; position: 0.0; color: palette.highlight } - GradientStop { id: t2; position: 1.0; color: palette.lighter(palette.highlight) } + GradientStop { id: t2; position: 1.0; color: Qt.lighter(palette.highlight) } } } Item { diff --git a/examples/declarative/tutorials/samegame/samegame1/Button.qml b/examples/declarative/tutorials/samegame/samegame1/Button.qml index 3846cf7..9792a22 100644 --- a/examples/declarative/tutorials/samegame/samegame1/Button.qml +++ b/examples/declarative/tutorials/samegame/samegame1/Button.qml @@ -9,7 +9,7 @@ Rectangle { color: activePalette.button; smooth: true width: txtItem.width + 20; height: txtItem.height + 6 - border.width: 1; border.color: activePalette.darker(activePalette.button); radius: 8; + border.width: 1; border.color: Qt.darker(activePalette.button); radius: 8; gradient: Gradient { GradientStop { diff --git a/examples/declarative/tutorials/samegame/samegame1/samegame.qml b/examples/declarative/tutorials/samegame/samegame1/samegame.qml index b5546d0..289579a 100644 --- a/examples/declarative/tutorials/samegame/samegame1/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame1/samegame.qml @@ -5,7 +5,7 @@ Rectangle { id: Screen width: 490; height: 720 - SystemPalette { id: activePalette; colorGroup: Qt.Active } + SystemPalette { id: activePalette } Item { width: parent.width; anchors.top: parent.top; anchors.bottom: ToolBar.top diff --git a/examples/declarative/tutorials/samegame/samegame2/Button.qml b/examples/declarative/tutorials/samegame/samegame2/Button.qml index 2354218..9e515e0 100644 --- a/examples/declarative/tutorials/samegame/samegame2/Button.qml +++ b/examples/declarative/tutorials/samegame/samegame2/Button.qml @@ -8,7 +8,7 @@ Rectangle { color: activePalette.button; smooth: true width: txtItem.width + 20; height: txtItem.height + 6 - border.width: 1; border.color: activePalette.darker(activePalette.button); radius: 8; + border.width: 1; border.color: Qt.darker(activePalette.button); radius: 8; gradient: Gradient { GradientStop { diff --git a/examples/declarative/tutorials/samegame/samegame2/samegame.qml b/examples/declarative/tutorials/samegame/samegame2/samegame.qml index 257e0de..e0e467a 100644 --- a/examples/declarative/tutorials/samegame/samegame2/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame2/samegame.qml @@ -4,7 +4,7 @@ Rectangle { id: Screen width: 490; height: 720 - SystemPalette { id: activePalette; colorGroup: Qt.Active } + SystemPalette { id: activePalette } //![2] Script { source: "samegame.js" } //![2] diff --git a/examples/declarative/tutorials/samegame/samegame3/Button.qml b/examples/declarative/tutorials/samegame/samegame3/Button.qml index 2354218..9e515e0 100644 --- a/examples/declarative/tutorials/samegame/samegame3/Button.qml +++ b/examples/declarative/tutorials/samegame/samegame3/Button.qml @@ -8,7 +8,7 @@ Rectangle { color: activePalette.button; smooth: true width: txtItem.width + 20; height: txtItem.height + 6 - border.width: 1; border.color: activePalette.darker(activePalette.button); radius: 8; + border.width: 1; border.color: Qt.darker(activePalette.button); radius: 8; gradient: Gradient { GradientStop { diff --git a/examples/declarative/tutorials/samegame/samegame3/samegame.qml b/examples/declarative/tutorials/samegame/samegame3/samegame.qml index 0a7ec0f..e1eb542 100644 --- a/examples/declarative/tutorials/samegame/samegame3/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame3/samegame.qml @@ -5,7 +5,7 @@ Rectangle { id: Screen width: 490; height: 720 - SystemPalette { id: activePalette; colorGroup: Qt.Active } + SystemPalette { id: activePalette } Script { source: "samegame.js" } Item { diff --git a/examples/declarative/tutorials/samegame/samegame4/content/Button.qml b/examples/declarative/tutorials/samegame/samegame4/content/Button.qml index 2354218..9e515e0 100644 --- a/examples/declarative/tutorials/samegame/samegame4/content/Button.qml +++ b/examples/declarative/tutorials/samegame/samegame4/content/Button.qml @@ -8,7 +8,7 @@ Rectangle { color: activePalette.button; smooth: true width: txtItem.width + 20; height: txtItem.height + 6 - border.width: 1; border.color: activePalette.darker(activePalette.button); radius: 8; + border.width: 1; border.color: Qt.darker(activePalette.button); radius: 8; gradient: Gradient { GradientStop { diff --git a/examples/declarative/tutorials/samegame/samegame4/samegame.qml b/examples/declarative/tutorials/samegame/samegame4/samegame.qml index e519912..89dc945 100644 --- a/examples/declarative/tutorials/samegame/samegame4/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame4/samegame.qml @@ -7,7 +7,7 @@ Rectangle { Script { source: "content/samegame.js" } - SystemPalette { id: activePalette; colorGroup: Qt.Active } + SystemPalette { id: activePalette } Item { width: parent.width; anchors.top: parent.top; anchors.bottom: ToolBar.top -- cgit v0.12 From e6a682189c4cd7f291648b9190b68cce79106b86 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 5 Nov 2009 16:58:20 +1000 Subject: Add test for GridView, and fix bug. --- .../graphicsitems/qmlgraphicsgridview.cpp | 46 +- .../graphicsitems/qmlgraphicslistview.cpp | 7 +- tests/auto/declarative/declarative.pro | 1 + .../qmlgraphicsgridview/data/gridview.qml | 49 ++ .../qmlgraphicsgridview/qmlgraphicsgridview.pro | 8 + .../tst_qmlgraphicsgridview.cpp | 585 +++++++++++++++++++++ 6 files changed, 672 insertions(+), 24 deletions(-) create mode 100644 tests/auto/declarative/qmlgraphicsgridview/data/gridview.qml create mode 100644 tests/auto/declarative/qmlgraphicsgridview/qmlgraphicsgridview.pro create mode 100644 tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp diff --git a/src/declarative/graphicsitems/qmlgraphicsgridview.cpp b/src/declarative/graphicsitems/qmlgraphicsgridview.cpp index 9f9b336..7427266 100644 --- a/src/declarative/graphicsitems/qmlgraphicsgridview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsgridview.cpp @@ -578,29 +578,35 @@ void QmlGraphicsGridViewPrivate::createHighlight() highlightYAnimator = 0; } - if (!highlightComponent) - return; - if (currentItem) { - QmlContext *highlightContext = new QmlContext(qmlContext(q)); - QObject *nobj = highlightComponent->create(highlightContext); - if (nobj) { - highlightContext->setParent(nobj); - QmlGraphicsItem *item = qobject_cast(nobj); - if (item) { - item->setParent(q->viewport()); - highlight = new FxGridItem(item, q); - highlightXAnimator = new QmlEaseFollow(q); - highlightXAnimator->setTarget(QmlMetaProperty(highlight->item, QLatin1String("x"))); - highlightXAnimator->setDuration(150); - highlightXAnimator->setEnabled(autoHighlight); - highlightYAnimator = new QmlEaseFollow(q); - highlightYAnimator->setTarget(QmlMetaProperty(highlight->item, QLatin1String("y"))); - highlightYAnimator->setDuration(150); - highlightYAnimator->setEnabled(autoHighlight); + QmlGraphicsItem *item = 0; + if (highlightComponent) { + QmlContext *highlightContext = new QmlContext(qmlContext(q)); + QObject *nobj = highlightComponent->create(highlightContext); + if (nobj) { + highlightContext->setParent(nobj); + item = qobject_cast(nobj); + if (!item) + delete nobj; } else { delete highlightContext; } + } else { + item = new QmlGraphicsItem; + item->setParent(q->viewport()); + } + if (item) { + item->setZValue(0); + item->setParent(q->viewport()); + highlight = new FxGridItem(item, q); + highlightXAnimator = new QmlEaseFollow(q); + highlightXAnimator->setTarget(QmlMetaProperty(highlight->item, QLatin1String("x"))); + highlightXAnimator->setDuration(150); + highlightXAnimator->setEnabled(autoHighlight); + highlightYAnimator = new QmlEaseFollow(q); + highlightYAnimator->setTarget(QmlMetaProperty(highlight->item, QLatin1String("y"))); + highlightYAnimator->setDuration(150); + highlightYAnimator->setEnabled(autoHighlight); } } } @@ -1500,6 +1506,8 @@ void QmlGraphicsGridView::itemsMoved(int from, int to, int count) if (item->index > from && item->index != -1) { // move everything after the moved items. item->index -= count; + if (item->index < d->visibleIndex) + d->visibleIndex = item->index; } ++it; } diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp index fc1ec4a..f9d4190 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp @@ -662,19 +662,16 @@ void QmlGraphicsListViewPrivate::createHighlight() if (nobj) { highlightContext->setParent(nobj); item = qobject_cast(nobj); - if (!item) { + if (!item) delete nobj; - } else { - item->setParent(q->viewport()); - } } else { delete highlightContext; } } else { item = new QmlGraphicsItem; - item->setParent(q->viewport()); } if (item) { + item->setParent(q->viewport()); item->setZValue(0); highlight = new FxListItem(item, q); if (orient == QmlGraphicsListView::Vertical) diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index b9f59d6..e586925 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -8,6 +8,7 @@ SUBDIRS += \ examples \ layouts \ # Cover listview \ # Cover + qmlgraphicsgridview \ # Cover numberformatter \ # Cover pathview \ # Cover qfxloader \ # Cover diff --git a/tests/auto/declarative/qmlgraphicsgridview/data/gridview.qml b/tests/auto/declarative/qmlgraphicsgridview/data/gridview.qml new file mode 100644 index 0000000..37eb622 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicsgridview/data/gridview.qml @@ -0,0 +1,49 @@ +import Qt 4.6 + +Rectangle { + width: 240 + height: 320 + color: "#ffffff" + resources: [ + Component { + id: myDelegate + Rectangle { + id: wrapper + objectName: "wrapper" + width: 80 + height: 60 + border.color: "blue" + Text { + text: index + } + Text { + x: 40 + text: wrapper.x + ", " + wrapper.y + } + Text { + y: 20 + id: textName + objectName: "textName" + text: name + } + Text { + y: 40 + id: textNumber + objectName: "textNumber" + text: number + } + color: GridView.isCurrentItem ? "lightsteelblue" : "white" + } + } + ] + GridView { + id: grid + objectName: "grid" + width: 240 + height: 320 + cellWidth: 80 + cellHeight: 60 + model: testModel + delegate: myDelegate + } +} diff --git a/tests/auto/declarative/qmlgraphicsgridview/qmlgraphicsgridview.pro b/tests/auto/declarative/qmlgraphicsgridview/qmlgraphicsgridview.pro new file mode 100644 index 0000000..8eae8ae --- /dev/null +++ b/tests/auto/declarative/qmlgraphicsgridview/qmlgraphicsgridview.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + +SOURCES += tst_qmlgraphicsgridview.cpp + +# Define SRCDIR equal to test's source directory +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp b/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp new file mode 100644 index 0000000..c6ea25a --- /dev/null +++ b/tests/auto/declarative/qmlgraphicsgridview/tst_qmlgraphicsgridview.cpp @@ -0,0 +1,585 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include + +class tst_QmlGraphicsGridView : public QObject +{ + Q_OBJECT +public: + tst_QmlGraphicsGridView(); + +private slots: + void items(); + void changed(); + void inserted(); + void removed(); + void moved(); + +private: + QmlView *createView(const QString &filename); + template + T *findItem(QmlGraphicsItem *parent, const QString &id, int index=-1); + template + QList findItems(QmlGraphicsItem *parent, const QString &objectName); +}; + +class TestModel : public QAbstractListModel +{ +public: + enum Roles { Name = Qt::UserRole+1, Number = Qt::UserRole+2 }; + + TestModel(QObject *parent=0) : QAbstractListModel(parent) { + QHash roles; + roles[Name] = "name"; + roles[Number] = "number"; + setRoleNames(roles); + } + + int rowCount(const QModelIndex &parent=QModelIndex()) const { return list.count(); } + QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const { + QVariant rv; + if (role == Name) + rv = list.at(index.row()).first; + else if (role == Number) + rv = list.at(index.row()).second; + + return rv; + } + + int count() const { return rowCount(); } + QString name(int index) const { return list.at(index).first; } + QString number(int index) const { return list.at(index).second; } + + void addItem(const QString &name, const QString &number) { + emit beginInsertRows(QModelIndex(), list.count(), list.count()); + list.append(QPair(name, number)); + emit endInsertRows(); + } + + void insertItem(int index, const QString &name, const QString &number) { + emit beginInsertRows(QModelIndex(), index, index); + list.insert(index, QPair(name, number)); + emit endInsertRows(); + } + + void removeItem(int index) { + emit beginRemoveRows(QModelIndex(), index, index); + list.removeAt(index); + emit endRemoveRows(); + } + + void moveItem(int from, int to) { + emit beginMoveRows(QModelIndex(), from, from, QModelIndex(), to); + list.move(from, to); + emit endMoveRows(); + } + + void modifyItem(int idx, const QString &name, const QString &number) { + list[idx] = QPair(name, number); + emit dataChanged(index(idx,0), index(idx,0)); + } + +private: + QList > list; +}; + +tst_QmlGraphicsGridView::tst_QmlGraphicsGridView() +{ +} + +void tst_QmlGraphicsGridView::items() +{ + QmlView *canvas = createView(SRCDIR "/data/gridview.qml"); + + TestModel model; + model.addItem("Fred", "12345"); + model.addItem("John", "2345"); + model.addItem("Bob", "54321"); + model.addItem("Billy", "22345"); + model.addItem("Sam", "2945"); + model.addItem("Ben", "04321"); + model.addItem("Jim", "0780"); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsGridView *gridview = findItem(canvas->root(), "grid"); + QVERIFY(gridview != 0); + + QmlGraphicsItem *viewport = gridview->viewport(); + QVERIFY(viewport != 0); + + QCOMPARE(gridview->count(), model.count()); + QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item + + for (int i = 0; i < model.count(); ++i) { + QmlGraphicsText *name = findItem(viewport, "textName", i); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(i)); + QmlGraphicsText *number = findItem(viewport, "textNumber", i); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(i)); + } + + gridview->moveCurrentIndexRight(); + QCOMPARE(gridview->currentIndex(), 1); + gridview->moveCurrentIndexDown(); + QCOMPARE(gridview->currentIndex(), 4); + gridview->moveCurrentIndexUp(); + QCOMPARE(gridview->currentIndex(), 1); + gridview->moveCurrentIndexLeft(); + QCOMPARE(gridview->currentIndex(), 0); + + // set an empty model and confirm that items are destroyed + TestModel model2; + ctxt->setContextProperty("testModel", &model2); + + int itemCount = findItems(viewport, "wrapper").count(); + QVERIFY(itemCount == 0); + + delete canvas; +} + +void tst_QmlGraphicsGridView::changed() +{ + QmlView *canvas = createView(SRCDIR "/data/gridview.qml"); + + TestModel model; + model.addItem("Fred", "12345"); + model.addItem("John", "2345"); + model.addItem("Bob", "54321"); + model.addItem("Billy", "22345"); + model.addItem("Sam", "2945"); + model.addItem("Ben", "04321"); + model.addItem("Jim", "0780"); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsFlickable *gridview = findItem(canvas->root(), "grid"); + QVERIFY(gridview != 0); + + QmlGraphicsItem *viewport = gridview->viewport(); + QVERIFY(viewport != 0); + + model.modifyItem(1, "Will", "9876"); + QmlGraphicsText *name = findItem(viewport, "textName", 1); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(1)); + QmlGraphicsText *number = findItem(viewport, "textNumber", 1); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(1)); + + delete canvas; +} + +void tst_QmlGraphicsGridView::inserted() +{ + QmlView *canvas = createView(SRCDIR "/data/gridview.qml"); + + TestModel model; + model.addItem("Fred", "12345"); + model.addItem("John", "2345"); + model.addItem("Bob", "54321"); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsGridView *gridview = findItem(canvas->root(), "grid"); + QVERIFY(gridview != 0); + + QmlGraphicsItem *viewport = gridview->viewport(); + QVERIFY(viewport != 0); + + model.insertItem(1, "Will", "9876"); + + // let transitions settle. + QTest::qWait(300); + + QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item + + QmlGraphicsText *name = findItem(viewport, "textName", 1); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(1)); + QmlGraphicsText *number = findItem(viewport, "textNumber", 1); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(1)); + + // Confirm items positioned correctly + for (int i = 0; i < model.count(); ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + QVERIFY(item->x() == (i%3)*80); + QVERIFY(item->y() == (i/3)*60); + } + + model.insertItem(0, "Foo", "1111"); // zero index, and current item + + // let transitions settle. + QTest::qWait(300); + + QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item + + name = findItem(viewport, "textName", 0); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(0)); + number = findItem(viewport, "textNumber", 0); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(0)); + + QCOMPARE(gridview->currentIndex(), 1); + + // Confirm items positioned correctly + for (int i = 0; i < model.count(); ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + QVERIFY(item->x() == (i%3)*80); + QVERIFY(item->y() == (i/3)*60); + } + + for (int i = model.count(); i < 30; ++i) + model.insertItem(i, "Hello", QString::number(i)); + QTest::qWait(300); + + gridview->setViewportY(120); + QTest::qWait(300); + + // Insert item outside visible area + model.insertItem(1, "Hello", "1324"); + QTest::qWait(300); + + QVERIFY(gridview->viewportY() == 120); + + delete canvas; +} + +void tst_QmlGraphicsGridView::removed() +{ + QmlView *canvas = createView(SRCDIR "/data/gridview.qml"); + + TestModel model; + for (int i = 0; i < 30; i++) + model.addItem("Item" + QString::number(i), ""); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsGridView *gridview = findItem(canvas->root(), "grid"); + QVERIFY(gridview != 0); + + QmlGraphicsItem *viewport = gridview->viewport(); + QVERIFY(viewport != 0); + + model.removeItem(1); + + // let transitions settle. + QTest::qWait(300); + + QmlGraphicsText *name = findItem(viewport, "textName", 1); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(1)); + QmlGraphicsText *number = findItem(viewport, "textNumber", 1); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(1)); + + // Confirm items positioned correctly + int itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->x() == (i%3)*80); + QVERIFY(item->y() == (i/3)*60); + } + + // Remove first item (which is the current item); + model.removeItem(0); + + // let transitions settle. + QTest::qWait(300); + + name = findItem(viewport, "textName", 0); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(0)); + number = findItem(viewport, "textNumber", 0); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(0)); + + // Confirm items positioned correctly + itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->x() == (i%3)*80); + QVERIFY(item->y() == (i/3)*60); + } + + // Remove items not visible + model.removeItem(25); + // let transitions settle. + QTest::qWait(300); + + // Confirm items positioned correctly + itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->x() == (i%3)*80); + QVERIFY(item->y() == (i/3)*60); + } + + // Remove items before visible + gridview->setViewportY(120); + gridview->setCurrentIndex(10); + + model.removeItem(1); + // let transitions settle. + QTest::qWait(300); + + // Confirm items positioned correctly + for (int i = 6; i < 18; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->x() == (i%3)*80); + QVERIFY(item->y() == (i/3)*60); + } + + gridview->setViewportY(0); + // let transitions settle. + QTest::qWait(300); + + // Confirm items positioned correctly + itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->x() == (i%3)*80); + QVERIFY(item->y() == (i/3)*60); + } + + delete canvas; +} + +void tst_QmlGraphicsGridView::moved() +{ + QmlView *canvas = createView(SRCDIR "/data/gridview.qml"); + + TestModel model; + for (int i = 0; i < 30; i++) + model.addItem("Item" + QString::number(i), ""); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsGridView *gridview = findItem(canvas->root(), "grid"); + QVERIFY(gridview != 0); + + QmlGraphicsItem *viewport = gridview->viewport(); + QVERIFY(viewport != 0); + + model.moveItem(1, 8); + + // let transitions settle. + QTest::qWait(300); + + QmlGraphicsText *name = findItem(viewport, "textName", 1); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(1)); + QmlGraphicsText *number = findItem(viewport, "textNumber", 1); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(1)); + + name = findItem(viewport, "textName", 8); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(8)); + number = findItem(viewport, "textNumber", 8); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(8)); + + // Confirm items positioned correctly + int itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->x() == (i%3)*80); + QVERIFY(item->y() == (i/3)*60); + } + + gridview->setViewportY(120); + + // move outside visible area + model.moveItem(1, 25); + + // let transitions settle. + QTest::qWait(300); + + // Confirm items positioned correctly and indexes correct + itemCount = findItems(viewport, "wrapper").count(); + for (int i = 3; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QCOMPARE(item->x(), qreal((i%3)*80)); + QCOMPARE(item->y(), qreal((i/3)*60 + 60)); + name = findItem(viewport, "textName", i); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(i)); + number = findItem(viewport, "textNumber", i); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(i)); + } + + // move from outside visible into visible + model.moveItem(28, 8); + + // let transitions settle. + QTest::qWait(300); + + // Confirm items positioned correctly and indexes correct + for (int i = 3; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->x() == (i%3)*80); + QVERIFY(item->y() == (i/3)*60 + 60); + name = findItem(viewport, "textName", i); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(i)); + number = findItem(viewport, "textNumber", i); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(i)); + } + + delete canvas; +} + +QmlView *tst_QmlGraphicsGridView::createView(const QString &filename) +{ + QmlView *canvas = new QmlView(0); + canvas->setFixedSize(240,320); + + QFile file(filename); + file.open(QFile::ReadOnly); + QString qml = file.readAll(); + canvas->setQml(qml, filename); + + return canvas; +} + +/* + Find an item with the specified objectName. If index is supplied then the + item must also evaluate the {index} expression equal to index +*/ +template +T *tst_QmlGraphicsGridView::findItem(QmlGraphicsItem *parent, const QString &objectName, int index) +{ + const QMetaObject &mo = T::staticMetaObject; + //qDebug() << parent->QGraphicsObject::children().count() << "children"; + for (int i = 0; i < parent->QGraphicsObject::children().count(); ++i) { + QmlGraphicsItem *item = qobject_cast(parent->QGraphicsObject::children().at(i)); + if(!item) + continue; + //qDebug() << "try" << item; + if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { + if (index != -1) { + QmlExpression e(qmlContext(item), "index", item); + e.setTrackChange(false); + if (e.value().toInt() == index) + return static_cast(item); + } else { + return static_cast(item); + } + } + item = findItem(item, objectName, index); + if (item) + return static_cast(item); + } + + return 0; +} + +template +QList tst_QmlGraphicsGridView::findItems(QmlGraphicsItem *parent, const QString &objectName) +{ + QList items; + const QMetaObject &mo = T::staticMetaObject; + //qDebug() << parent->QGraphicsObject::children().count() << "children"; + for (int i = 0; i < parent->QGraphicsObject::children().count(); ++i) { + QmlGraphicsItem *item = qobject_cast(parent->QGraphicsObject::children().at(i)); + if(!item) + continue; + //qDebug() << "try" << item; + if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) + items.append(static_cast(item)); + items += findItems(item, objectName); + } + + return items; +} + + +QTEST_MAIN(tst_QmlGraphicsGridView) + +#include "tst_qmlgraphicsgridview.moc" -- cgit v0.12 From 26cae0653332caf0b4e315fd35fd59469c66bac9 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 5 Nov 2009 16:59:33 +1000 Subject: Compile. --- tests/auto/declarative/valuetypes/testtypes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/declarative/valuetypes/testtypes.cpp b/tests/auto/declarative/valuetypes/testtypes.cpp index d57afaf..f0fdaf8 100644 --- a/tests/auto/declarative/valuetypes/testtypes.cpp +++ b/tests/auto/declarative/valuetypes/testtypes.cpp @@ -40,4 +40,4 @@ ****************************************************************************/ #include "testtypes.h" -QML_DEFINE_TYPE(Test, 1, 0, 0, MyTypeObject, MyTypeObject); +QML_DEFINE_TYPE(Test, 1, 0, MyTypeObject, MyTypeObject); -- cgit v0.12 From 8b40fac7e97a629ddaf1c0f6de2ebb504f004060 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 5 Nov 2009 17:03:08 +1000 Subject: value types autotest --- src/declarative/qml/qmlvaluetype_p.h | 20 +- tests/auto/declarative/valuetypes/testtypes.cpp | 4 +- tests/auto/declarative/valuetypes/testtypes.h | 40 +++- .../auto/declarative/valuetypes/tst_valuetypes.cpp | 207 ++++++++++++++++++++- 4 files changed, 244 insertions(+), 27 deletions(-) diff --git a/src/declarative/qml/qmlvaluetype_p.h b/src/declarative/qml/qmlvaluetype_p.h index 0af3813..e7566f9 100644 --- a/src/declarative/qml/qmlvaluetype_p.h +++ b/src/declarative/qml/qmlvaluetype_p.h @@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE -class QmlValueType : public QObject +class Q_AUTOTEST_EXPORT QmlValueType : public QObject { Q_OBJECT public: @@ -73,7 +73,7 @@ public: virtual void setValue(QVariant) = 0; }; -class QmlValueTypeFactory +class Q_AUTOTEST_EXPORT QmlValueTypeFactory { public: QmlValueTypeFactory(); @@ -84,7 +84,7 @@ public: QmlValueType *operator[](int idx) const { return valueTypes[idx]; } }; -class QmlPointFValueType : public QmlValueType +class Q_AUTOTEST_EXPORT QmlPointFValueType : public QmlValueType { Q_PROPERTY(qreal x READ x WRITE setX) Q_PROPERTY(qreal y READ y WRITE setY) @@ -106,7 +106,7 @@ private: QPointF point; }; -class QmlPointValueType : public QmlValueType +class Q_AUTOTEST_EXPORT QmlPointValueType : public QmlValueType { Q_PROPERTY(int x READ x WRITE setX) Q_PROPERTY(int y READ y WRITE setY) @@ -128,7 +128,7 @@ private: QPoint point; }; -class QmlSizeFValueType : public QmlValueType +class Q_AUTOTEST_EXPORT QmlSizeFValueType : public QmlValueType { Q_PROPERTY(qreal width READ width WRITE setWidth) Q_PROPERTY(qreal height READ height WRITE setHeight) @@ -150,7 +150,7 @@ private: QSizeF size; }; -class QmlSizeValueType : public QmlValueType +class Q_AUTOTEST_EXPORT QmlSizeValueType : public QmlValueType { Q_PROPERTY(int width READ width WRITE setWidth) Q_PROPERTY(int height READ height WRITE setHeight) @@ -172,7 +172,7 @@ private: QSize size; }; -class QmlRectFValueType : public QmlValueType +class Q_AUTOTEST_EXPORT QmlRectFValueType : public QmlValueType { Q_PROPERTY(qreal x READ x WRITE setX) Q_PROPERTY(qreal y READ y WRITE setY) @@ -201,7 +201,7 @@ private: QRectF rect; }; -class QmlRectValueType : public QmlValueType +class Q_AUTOTEST_EXPORT QmlRectValueType : public QmlValueType { Q_PROPERTY(int x READ x WRITE setX) Q_PROPERTY(int y READ y WRITE setY) @@ -230,7 +230,7 @@ private: QRect rect; }; -class QmlVector3DValueType : public QmlValueType +class Q_AUTOTEST_EXPORT QmlVector3DValueType : public QmlValueType { Q_PROPERTY(qreal x READ x WRITE setX) Q_PROPERTY(qreal y READ y WRITE setY) @@ -255,7 +255,7 @@ private: QVector3D vector; }; -class QmlFontValueType : public QmlValueType +class Q_AUTOTEST_EXPORT QmlFontValueType : public QmlValueType { Q_OBJECT Q_ENUMS(FontWeight) diff --git a/tests/auto/declarative/valuetypes/testtypes.cpp b/tests/auto/declarative/valuetypes/testtypes.cpp index d57afaf..565eb1c 100644 --- a/tests/auto/declarative/valuetypes/testtypes.cpp +++ b/tests/auto/declarative/valuetypes/testtypes.cpp @@ -40,4 +40,6 @@ ****************************************************************************/ #include "testtypes.h" -QML_DEFINE_TYPE(Test, 1, 0, 0, MyTypeObject, MyTypeObject); +QML_DEFINE_TYPE(Test, 1, 0, MyTypeObject, MyTypeObject); +QML_DEFINE_TYPE(Test, 1, 0, MyConstantValueSource, MyConstantValueSource); +QML_DEFINE_TYPE(Test, 1, 0, MyOffsetValueInterceptor, MyOffsetValueInterceptor); diff --git a/tests/auto/declarative/valuetypes/testtypes.h b/tests/auto/declarative/valuetypes/testtypes.h index cc98d7c..67e32f5 100644 --- a/tests/auto/declarative/valuetypes/testtypes.h +++ b/tests/auto/declarative/valuetypes/testtypes.h @@ -51,6 +51,7 @@ #include #include #include +#include class MyTypeObject : public QObject { @@ -90,39 +91,62 @@ public: QPoint m_point; QPoint point() const { return m_point; } - void setPoint(const QPoint &v) { m_point = v; } + void setPoint(const QPoint &v) { m_point = v; emit changed(); } QPointF m_pointf; QPointF pointf() const { return m_pointf; } - void setPointf(const QPointF &v) { m_pointf = v; } + void setPointf(const QPointF &v) { m_pointf = v; emit changed(); } QSize m_size; QSize size() const { return m_size; } - void setSize(const QSize &v) { m_size = v; } + void setSize(const QSize &v) { m_size = v; emit changed(); } QSizeF m_sizef; QSizeF sizef() const { return m_sizef; } - void setSizef(const QSizeF &v) { m_sizef = v; } + void setSizef(const QSizeF &v) { m_sizef = v; emit changed(); } QRect m_rect; QRect rect() const { return m_rect; } - void setRect(const QRect &v) { m_rect = v; } + void setRect(const QRect &v) { m_rect = v; emit changed(); } QRectF m_rectf; QRectF rectf() const { return m_rectf; } - void setRectf(const QRectF &v) { m_rectf = v; } + void setRectf(const QRectF &v) { m_rectf = v; emit changed(); } QVector3D m_vector; QVector3D vector() const { return m_vector; } - void setVector(const QVector3D &v) { m_vector = v; } + void setVector(const QVector3D &v) { m_vector = v; emit changed(); } QFont m_font; QFont font() const { return m_font; } - void setFont(const QFont &v) { m_font = v; } + void setFont(const QFont &v) { m_font = v; emit changed(); } + + void emitRunScript() { emit runScript(); } signals: void changed(); + void runScript(); }; QML_DECLARE_TYPE(MyTypeObject); +class MyConstantValueSource : public QObject, public QmlPropertyValueSource +{ + Q_OBJECT +public: + virtual void setTarget(const QmlMetaProperty &p) { p.write(3345); } +}; +QML_DECLARE_TYPE(MyConstantValueSource); + +class MyOffsetValueInterceptor : public QObject, public QmlPropertyValueInterceptor +{ + Q_OBJECT +public: + virtual void setTarget(const QmlMetaProperty &p) { prop = p; } + virtual void write(const QVariant &value) { prop.write(value.toInt() + 13, QmlMetaProperty::BypassInterceptor); } + +private: + QmlMetaProperty prop; +}; +QML_DECLARE_TYPE(MyOffsetValueInterceptor); + #endif // TESTTYPES_H diff --git a/tests/auto/declarative/valuetypes/tst_valuetypes.cpp b/tests/auto/declarative/valuetypes/tst_valuetypes.cpp index a338e47..d09bdf5 100644 --- a/tests/auto/declarative/valuetypes/tst_valuetypes.cpp +++ b/tests/auto/declarative/valuetypes/tst_valuetypes.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include "testtypes.h" class tst_valuetypes : public QObject @@ -61,14 +62,16 @@ private slots: void vector3d(); void font(); - // ### - // Test binding assignment - // Test static assignment - // Test JS assignment - // Test "font.x: blah; font: blah2;" conflict - // Test constant binding removal - // Test value sources - // Test behaviours + void bindingAssignment(); + void bindingRead(); + void staticAssignment(); + void scriptAccess(); + void autoBindingRemoval(); + void valueSources(); + void valueInterceptors(); + void bindingConflict(); + void cppClasses(); + private: QmlEngine engine; }; @@ -312,6 +315,8 @@ void tst_valuetypes::font() QVERIFY(object != 0); QCOMPARE(object->font().pixelSize(), 10); + + delete object; } // Test pixelSize and pointSize @@ -322,9 +327,195 @@ void tst_valuetypes::font() QVERIFY(object != 0); QCOMPARE(object->font().pixelSize(), 10); + + delete object; } } +// Test bindings can write to value types +void tst_valuetypes::bindingAssignment() +{ + QmlComponent component(&engine, TEST_FILE("bindingAssignment.qml")); + MyTypeObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + + QCOMPARE(object->rect().x(), 10); + + object->setProperty("value", QVariant(92)); + + QCOMPARE(object->rect().x(), 92); + + delete object; +} + +// Test bindings can read from value types +void tst_valuetypes::bindingRead() +{ + QmlComponent component(&engine, TEST_FILE("bindingRead.qml")); + MyTypeObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + + QCOMPARE(object->property("value").toInt(), 2); + + object->setRect(QRect(19, 3, 88, 2)); + + QCOMPARE(object->property("value").toInt(), 19); + + delete object; +} + +// Test static values can assign to value types +void tst_valuetypes::staticAssignment() +{ + QmlComponent component(&engine, TEST_FILE("staticAssignment.qml")); + MyTypeObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + + QCOMPARE(object->rect().x(), 9); + + delete object; +} + +// Test scripts can read/write value types +void tst_valuetypes::scriptAccess() +{ + QmlComponent component(&engine, TEST_FILE("scriptAccess.qml")); + MyTypeObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + + QCOMPARE(object->property("valuePre").toInt(), 2); + QCOMPARE(object->rect().x(), 19); + QCOMPARE(object->property("valuePost").toInt(), 19); + + delete object; +} + +// Test that assigning a constant from script removes any binding +void tst_valuetypes::autoBindingRemoval() +{ + { + QmlComponent component(&engine, TEST_FILE("autoBindingRemoval.qml")); + MyTypeObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + + QCOMPARE(object->rect().x(), 10); + + object->setProperty("value", QVariant(13)); + + QCOMPARE(object->rect().x(), 13); + + object->emitRunScript(); + + QCOMPARE(object->rect().x(), 42); + + object->setProperty("value", QVariant(92)); + + QCOMPARE(object->rect().x(), 42); + + delete object; + } + + { + QmlComponent component(&engine, TEST_FILE("autoBindingRemoval.2.qml")); + MyTypeObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + + QCOMPARE(object->rect().x(), 10); + + object->setProperty("value", QVariant(13)); + + QCOMPARE(object->rect().x(), 13); + + object->emitRunScript(); + + QCOMPARE(object->rect(), QRect(10, 10, 10, 10)); + + object->setProperty("value", QVariant(92)); + + QCOMPARE(object->rect(), QRect(10, 10, 10, 10)); + + delete object; + } + + { + QmlComponent component(&engine, TEST_FILE("autoBindingRemoval.3.qml")); + MyTypeObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + + object->setProperty("value", QVariant(QRect(9, 22, 33, 44))); + + QCOMPARE(object->rect(), QRect(9, 22, 33, 44)); + + object->emitRunScript(); + + QCOMPARE(object->rect(), QRect(44, 22, 33, 44)); + + object->setProperty("value", QVariant(QRect(19, 3, 4, 8))); + + QCOMPARE(object->rect(), QRect(44, 22, 33, 44)); + + delete object; + } + +} + +// Test that property value sources assign to value types +void tst_valuetypes::valueSources() +{ + QmlComponent component(&engine, TEST_FILE("valueSources.qml")); + MyTypeObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + + QCOMPARE(object->rect().x(), 3345); + + delete object; +} + +// Test that property value interceptors can be applied to value types +void tst_valuetypes::valueInterceptors() +{ + QmlComponent component(&engine, TEST_FILE("valueInterceptors.qml")); + MyTypeObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + + QCOMPARE(object->rect().x(), 26); + + object->setProperty("value", 99); + + QCOMPARE(object->rect().x(), 112); + + delete object; +} + +// Test that you can't assign a binding to the "root" value type, and a sub-property +void tst_valuetypes::bindingConflict() +{ + QmlComponent component(&engine, TEST_FILE("bindingConflict.qml")); + QCOMPARE(component.isError(), true); +} + +#define CPP_TEST(type, v) \ +{ \ + type *t = new type; \ + QVariant value(v); \ + t->setValue(value); \ + QCOMPARE(t->value(), value); \ + delete t; \ +} + +// Test that the value type classes can be used manually +void tst_valuetypes::cppClasses() +{ + CPP_TEST(QmlPointValueType, QPoint(19, 33)); + CPP_TEST(QmlPointFValueType, QPointF(33.6, -23)); + CPP_TEST(QmlSizeValueType, QSize(-100, 18)); + CPP_TEST(QmlSizeFValueType, QSizeF(-100.7, 18.2)); + CPP_TEST(QmlRectValueType, QRect(13, 39, 10928, 88)); + CPP_TEST(QmlRectFValueType, QRectF(88.2, -90.1, 103.2, 118)); + CPP_TEST(QmlVector3DValueType, QVector3D(18.2, 19.7, 1002)); + CPP_TEST(QmlFontValueType, QFont("Helvetica")); + +} QTEST_MAIN(tst_valuetypes) #include "tst_valuetypes.moc" -- cgit v0.12 From 0bc45e6b54f67a3f5e8b7c3b780a124de1d9570d Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Thu, 5 Nov 2009 17:16:29 +1000 Subject: fix calculator --- demos/declarative/calculator/calculator.qml | 34 +++++++++++++---------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml index 18ee5b9..54af7ad 100644 --- a/demos/declarative/calculator/calculator.qml +++ b/demos/declarative/calculator/calculator.qml @@ -45,7 +45,7 @@ Rectangle { } Item { - width: 320 + width: 320; height: 160 Item { id: basicButtons @@ -106,23 +106,19 @@ Rectangle { } } - states: [ - State { - name: "Advanced"; when: advancedCheckBox.toggled == true - PropertyChanges { target: basicButtons; x: 0 } - PropertyChanges { target: simpleOperations; y: 32 } - PropertyChanges { target: bksp; opacity: 1 } - PropertyChanges { target: c; x: 69; width: 67 } - PropertyChanges { target: ac; x: 138; width: 67 } - PropertyChanges { target: equals; width: 50 } - PropertyChanges { target: advancedButtons; x: 210; opacity: 1 } - } - ] + states: State { + name: "Advanced"; when: advancedCheckBox.toggled == true + PropertyChanges { target: basicButtons; x: 0 } + PropertyChanges { target: simpleOperations; y: 32 } + PropertyChanges { target: bksp; opacity: 1 } + PropertyChanges { target: c; x: 69; width: 67 } + PropertyChanges { target: ac; x: 138; width: 67 } + PropertyChanges { target: equals; width: 50 } + PropertyChanges { target: advancedButtons; x: 210; opacity: 1 } + } - transitions: [ - Transition { - NumberAnimation { properties: "x,y,width"; easing: "easeOutBounce"; duration: 500 } - NumberAnimation { properties: "opacity"; easing: "easeInOutQuad"; duration: 500 } - } - ] + transitions: Transition { + NumberAnimation { properties: "x,y,width"; easing: "easeOutBounce"; duration: 500 } + NumberAnimation { properties: "opacity"; easing: "easeInOutQuad"; duration: 500 } + } } -- cgit v0.12 From 7dc306a32b12dcd783714fbb6078e100bc52f32e Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 5 Nov 2009 17:32:34 +1000 Subject: Test the currentSection property --- src/declarative/graphicsitems/qmlgraphicslistview.cpp | 4 ++++ tests/auto/declarative/listview/tst_listview.cpp | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp index f9d4190..1f5d51d 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp @@ -1461,6 +1461,10 @@ void QmlGraphicsListView::setSectionExpression(const QString &expression) } } +/*! + \qmlproperty string ListView::currentSection + This property holds the section that is currently at the beginning of the view. +*/ QString QmlGraphicsListView::currentSection() const { Q_D(const QmlGraphicsListView); diff --git a/tests/auto/declarative/listview/tst_listview.cpp b/tests/auto/declarative/listview/tst_listview.cpp index b8f87b7..5575ace 100644 --- a/tests/auto/declarative/listview/tst_listview.cpp +++ b/tests/auto/declarative/listview/tst_listview.cpp @@ -671,6 +671,7 @@ void tst_QmlGraphicsListView::spacing() } listview->setSpacing(10); + QVERIFY(listview->spacing() == 10); // Confirm items positioned correctly itemCount = findItems(viewport, "wrapper").count(); @@ -723,6 +724,11 @@ void tst_QmlGraphicsListView::sections() QCOMPARE(item->y(), qreal(i*20 + ((i+4)/5) * 20)); } + QVERIFY(listview->currentSection() == "0"); + + listview->setViewportY(140); + QVERIFY(listview->currentSection() == "1"); + delete canvas; } -- cgit v0.12 From f8423b94bbf439831577644cd07d2aa4e997396a Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Thu, 5 Nov 2009 17:39:43 +1000 Subject: QmlGraphicsparticles visual test --- .../qmlgraphicsparticles/data/particles.0.png | Bin 0 -> 10022 bytes .../qmlgraphicsparticles/data/particles.1.png | Bin 0 -> 14142 bytes .../qmlgraphicsparticles/data/particles.2.png | Bin 0 -> 14214 bytes .../visual/qmlgraphicsparticles/data/particles.qml | 783 +++++++++++++++++++++ .../visual/qmlgraphicsparticles/particles.qml | 48 ++ .../visual/qmlgraphicsparticles/star.png | Bin 0 -> 262 bytes 6 files changed, 831 insertions(+) create mode 100644 tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.0.png create mode 100644 tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.1.png create mode 100644 tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.2.png create mode 100644 tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicsparticles/particles.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicsparticles/star.png diff --git a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.0.png b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.0.png new file mode 100644 index 0000000..30bdefd Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.0.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.1.png b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.1.png new file mode 100644 index 0000000..799e028 Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.1.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.2.png b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.2.png new file mode 100644 index 0000000..ed267c2 Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.2.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.qml b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.qml new file mode 100644 index 0000000..3199f31 --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.qml @@ -0,0 +1,783 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "b4df49cbd7cf972af9879399808f6c53" + } + Frame { + msec: 32 + hash: "1c129b1c4a39412bed2f23d712f2bc90" + } + Frame { + msec: 48 + hash: "fbcc4bc3fea46a43453aa39b032264c6" + } + Frame { + msec: 64 + hash: "2cb13275faca414b7c8ba9d70067fd1f" + } + Frame { + msec: 80 + hash: "b017afb05f96085ee3395d62e62e457b" + } + Frame { + msec: 96 + hash: "642851d10c549c8ae72c057563e99e64" + } + Frame { + msec: 112 + hash: "494c0942f7410d455a4b113fb908e570" + } + Frame { + msec: 128 + hash: "cb0a2f9980f27757c0c1d62ef3dcfde0" + } + Frame { + msec: 144 + hash: "2fb9cf782ea106006af8bcd66c62869c" + } + Frame { + msec: 160 + hash: "bf68518323f03e4f407831e8b34f247b" + } + Frame { + msec: 176 + hash: "c99abe9c0384ae339fdfa0c75dc8047d" + } + Frame { + msec: 192 + hash: "96f2eb402633c1aca8a1a2b0d60af5fb" + } + Frame { + msec: 208 + hash: "6cba51a856f1ba54ee702761f196b915" + } + Frame { + msec: 224 + hash: "9188926caa6c6ba8cb3aee04de635b96" + } + Frame { + msec: 240 + hash: "81132a5e8768de0630311813170f166e" + } + Frame { + msec: 256 + hash: "a638698d7ccb73f20f6eeba3857f417c" + } + Frame { + msec: 272 + hash: "4761ba6847f6f0769b916106c5f3245b" + } + Frame { + msec: 288 + hash: "13bc0c681962bada7fcb3b722895ffaa" + } + Frame { + msec: 304 + hash: "505c5824be16d812b7c339f1f9b8a10b" + } + Frame { + msec: 320 + hash: "d191d502d9c685f8497583669147ee73" + } + Frame { + msec: 336 + hash: "c17f55cc5d7bf541e235791a157aa8b9" + } + Frame { + msec: 352 + hash: "3ef401f87830c53b9b277d4420a9a742" + } + Frame { + msec: 368 + hash: "d04816400e66ebbf797f9985a53f7cfb" + } + Frame { + msec: 384 + hash: "d7a7df7c2a92449f42d61c0572e7dbac" + } + Frame { + msec: 400 + hash: "f49a3bcf3842f554136ff9bd5bb470ef" + } + Frame { + msec: 416 + hash: "27bccc5933d7bfaad6d5f6a10efd283b" + } + Frame { + msec: 432 + hash: "3067ac00a4d58c67bb96d813c344871d" + } + Frame { + msec: 448 + hash: "d38d7192688feecc38fd63285d37ce49" + } + Frame { + msec: 464 + hash: "4172d1b74cdd6ea89be718977775a9e0" + } + Frame { + msec: 480 + hash: "2761a7e58cbfa46fc6d306c8270e4f10" + } + Frame { + msec: 496 + hash: "58a851b9fbcb98afc7c1bc58c2f45e4a" + } + Frame { + msec: 512 + hash: "0f7789f04bf20708d9d6f1e818b6b88a" + } + Frame { + msec: 528 + hash: "8d8b8d109dce4c7b05ecb603b4718859" + } + Frame { + msec: 544 + hash: "0fc6fde589932ac41787e8ebfe3fcbe3" + } + Frame { + msec: 560 + hash: "e08bffd5a56795488f090a475513e5db" + } + Frame { + msec: 576 + hash: "e089ab7c5feefd3d745bb665e2ff49ee" + } + Frame { + msec: 592 + hash: "e7b787fb1b21e991c19ec88b3d985b69" + } + Frame { + msec: 608 + hash: "a6f4f32287bd926e0eeff68717b80512" + } + Frame { + msec: 624 + hash: "3344ca9c97473bd922bd8efd5d6ab212" + } + Frame { + msec: 640 + hash: "a330510a9f62acb4f2163728939d0bb5" + } + Frame { + msec: 656 + hash: "1ec473936f2279f13675b6b5fe2ee392" + } + Frame { + msec: 672 + hash: "b193b7d2917ee00c4cb29bf244186bef" + } + Frame { + msec: 688 + hash: "75137e977941e357bad2ad9af2cbc898" + } + Frame { + msec: 704 + hash: "31773ba8979a31b1691860b7dafe28dc" + } + Frame { + msec: 720 + hash: "d8922452edbba4f1092b83e87c0330ea" + } + Frame { + msec: 736 + hash: "982c80305b54236d1259f5672098652d" + } + Frame { + msec: 752 + hash: "d8b23fb0867fb75558960216c8d0f2aa" + } + Frame { + msec: 768 + hash: "daf7833f93a216d1e025c9129b3a7caa" + } + Frame { + msec: 784 + hash: "bb08e8fe2ce74018fc702e5dad8927fe" + } + Frame { + msec: 800 + hash: "22a30051c87d4de7e734d9de6ce7eed8" + } + Frame { + msec: 816 + hash: "d8625628587feace367fc97c1f11aff8" + } + Frame { + msec: 832 + hash: "e9dbbf715fc094cb22ecd5c6df602f95" + } + Frame { + msec: 848 + hash: "ca69b2b9f8e6b16e3bc6d93598b6c75a" + } + Frame { + msec: 864 + hash: "87e09752e39df5042aef163fe4ed0b47" + } + Frame { + msec: 880 + hash: "80adfaf02838c8bd372e53d0483fbac5" + } + Frame { + msec: 896 + hash: "9934a1aece14ba7369b00cf2620cd207" + } + Frame { + msec: 912 + hash: "954a70a949fdcca4e4412174f30653c3" + } + Frame { + msec: 928 + hash: "850fa936516f8b145465eac39c9a74a6" + } + Frame { + msec: 944 + hash: "1d844e8a7c710ccbf31f47470cc9abf2" + } + Frame { + msec: 960 + image: "particles.0.png" + } + Frame { + msec: 976 + hash: "33f4eee3f6e3fb715463254d727ef898" + } + Frame { + msec: 992 + hash: "68648a3f75f58b34dd9770a9edc2caea" + } + Frame { + msec: 1008 + hash: "ad0d431ab7e6cfbb43053050a1cf5e40" + } + Frame { + msec: 1024 + hash: "d1ae74c9bf3826d30fb461ca2fd8e36a" + } + Frame { + msec: 1040 + hash: "bda9d77c68a30d491abdfbfcf854c5ea" + } + Frame { + msec: 1056 + hash: "386ea303f8102339f8cd5ae88fd5f6bc" + } + Frame { + msec: 1072 + hash: "8c81d3992851ebeb3cb820bc4510af66" + } + Frame { + msec: 1088 + hash: "566813e312ffdde4a7d3af4276bc8cdd" + } + Frame { + msec: 1104 + hash: "d9c8b391b12ee40aa393f4fb39c12a16" + } + Frame { + msec: 1120 + hash: "f2bf70bda626089437f0ab67ad62d8f6" + } + Frame { + msec: 1136 + hash: "88b2d1ecd7d51d0bf8c947a3433b7013" + } + Frame { + msec: 1152 + hash: "e93e0553c5dcc6dcd21dad0932d1e3fa" + } + Frame { + msec: 1168 + hash: "c1ec148772d399ea4934cdfc514f6980" + } + Frame { + msec: 1184 + hash: "14f286793de5452f4677e8b6fd5c1e7e" + } + Frame { + msec: 1200 + hash: "220a7df0af53fc9a2442956128091ad8" + } + Frame { + msec: 1216 + hash: "84c49512f5e9f138901b3833a5adbcab" + } + Frame { + msec: 1232 + hash: "b05410caa120f5a4191a44b84aa17a8c" + } + Frame { + msec: 1248 + hash: "e1f6db204f62394205c1d4d56bbf9f52" + } + Frame { + msec: 1264 + hash: "f45033d1350009e09f62e81aeec297a5" + } + Frame { + msec: 1280 + hash: "dfd88b1dba38ab8260e00b3810b89318" + } + Frame { + msec: 1296 + hash: "17503276f68e365cde03607d66fe4c8e" + } + Frame { + msec: 1312 + hash: "28f03c5c0fe5c4647c5b9d3b72a07c76" + } + Frame { + msec: 1328 + hash: "ea2082529b50543fab22497e01938102" + } + Frame { + msec: 1344 + hash: "a700a2f3721625b1ec68107884d1ce67" + } + Frame { + msec: 1360 + hash: "ce717f1f1d98158aeef1cc6a9485dc80" + } + Frame { + msec: 1376 + hash: "7febe7c67e1c159881de72f62800a505" + } + Frame { + msec: 1392 + hash: "474931cb44a8e18426b9c2cc9f6df482" + } + Frame { + msec: 1408 + hash: "1085b4873b9a4934882a163be72a2710" + } + Frame { + msec: 1424 + hash: "59e7911800e915e6f159cb111ce61a54" + } + Frame { + msec: 1440 + hash: "6d0d780ffc726b04f9885c25b08d1009" + } + Frame { + msec: 1456 + hash: "bf896d6403dc1ad26536cc1165e71e9e" + } + Frame { + msec: 1472 + hash: "86397c7dcf5ed34edbbaa465ae6eab43" + } + Frame { + msec: 1488 + hash: "ed1b4967bf14eead9cb4d2dcfbdb46c2" + } + Frame { + msec: 1504 + hash: "67b7e59c8f945d1f3bdb1944fa736ecf" + } + Frame { + msec: 1520 + hash: "b5f95e89f39d1c4821ba38547b0f2e3b" + } + Frame { + msec: 1536 + hash: "5bc91c9e35afa255a2dda28db9802b1e" + } + Frame { + msec: 1552 + hash: "84fab4042e0ff891ca1998cbfbb60e5a" + } + Frame { + msec: 1568 + hash: "7c5ef5025a06e990171dac3e8fd93977" + } + Frame { + msec: 1584 + hash: "ab4cd0e103d71a35250668ad850a5213" + } + Frame { + msec: 1600 + hash: "aa974c4b2290f7febb121344623de86d" + } + Frame { + msec: 1616 + hash: "ff6ee1b50ca356dc98038a459e318b32" + } + Frame { + msec: 1632 + hash: "022fe9c391514fdd98bc1c38bc383df2" + } + Frame { + msec: 1648 + hash: "b1a33c9c9cbdcc1c8c9c982eef041ccd" + } + Frame { + msec: 1664 + hash: "0945e66ab5aa81beacf662eb82ec39ed" + } + Frame { + msec: 1680 + hash: "ae293f675dbdd88dec8f924140033cc9" + } + Frame { + msec: 1696 + hash: "5ace5013e3d51a8db338f65011dd10f8" + } + Frame { + msec: 1712 + hash: "9466a4e96d647f2bd8845697fce89399" + } + Frame { + msec: 1728 + hash: "73bbbfc57e020c6a0acbd5fdfa711c30" + } + Frame { + msec: 1744 + hash: "d71d7182107c3d6b004a57a321caee96" + } + Frame { + msec: 1760 + hash: "0902867c89e536cffcde69bde2eb1994" + } + Frame { + msec: 1776 + hash: "39fc26943f6077272c36e93b7cbf6994" + } + Frame { + msec: 1792 + hash: "92931d5a6e57fb9df60785a64d3a6f78" + } + Frame { + msec: 1808 + hash: "fffd632552f88f2979ef85de0ce585c2" + } + Frame { + msec: 1824 + hash: "9f97bfcffbb5d127c5eee852b30a13c4" + } + Frame { + msec: 1840 + hash: "ea9ee0293fbc45d3467e29c09e42adcd" + } + Frame { + msec: 1856 + hash: "b5b75c50f8fae3fb3b88efad536c911b" + } + Frame { + msec: 1872 + hash: "25dcd3fa30c057d1a42c19cee1ce444b" + } + Frame { + msec: 1888 + hash: "862d42abe7abd49d4a38e38a8c33a657" + } + Frame { + msec: 1904 + hash: "a335f3c8c797c1bb5537b57f952c19d1" + } + Frame { + msec: 1920 + image: "particles.1.png" + } + Frame { + msec: 1936 + hash: "da1cf98fdfe5acbe30cfbe66389aa240" + } + Frame { + msec: 1952 + hash: "088f3209c0363c06cf0607c58d00ca2d" + } + Frame { + msec: 1968 + hash: "47ba3bf2604b21f331a2e00f05926aaf" + } + Frame { + msec: 1984 + hash: "5ff0de383abdefad76380af144bd9d80" + } + Frame { + msec: 2000 + hash: "b972d1c85d3d8777f84b54dc118172fd" + } + Frame { + msec: 2016 + hash: "37581c3fbef2088b7d14b6c7bbf3cdc3" + } + Frame { + msec: 2032 + hash: "4ad6a06ac6de9dea66e9ce873a6618c1" + } + Frame { + msec: 2048 + hash: "3a0379ad966235044508c144ffbc336b" + } + Frame { + msec: 2064 + hash: "cb5a9510400943d77c9a296066f037e2" + } + Frame { + msec: 2080 + hash: "7bd5673a1d2ad8079df2569149e5811e" + } + Frame { + msec: 2096 + hash: "bd327ff6b8a4081b3a41cb0035403037" + } + Frame { + msec: 2112 + hash: "f0f9f559251f7648cd60e66ac745962d" + } + Frame { + msec: 2128 + hash: "18827630a859b0ce497f682e33558fae" + } + Frame { + msec: 2144 + hash: "e22d8110cbe34acddba799942872645d" + } + Frame { + msec: 2160 + hash: "11564e7221524cc3655c2c5f1d7e42b6" + } + Frame { + msec: 2176 + hash: "6468721ee38209aaf2c82a320bcd122e" + } + Frame { + msec: 2192 + hash: "19772d0f422fd206645ae6cf0be30b59" + } + Frame { + msec: 2208 + hash: "48b6c7e1317b9a66238c17afceb5121f" + } + Frame { + msec: 2224 + hash: "82a1af78709b78cce2d9b4eed7f8477c" + } + Frame { + msec: 2240 + hash: "36e2366eccbdd2d16c19829c34fbff87" + } + Frame { + msec: 2256 + hash: "271db39ca46c59ddc279fb41a9d191af" + } + Frame { + msec: 2272 + hash: "ee279a90e86aa89b1c3d745ab030180d" + } + Frame { + msec: 2288 + hash: "14e8c72d770644f4cec99e65aeff0d75" + } + Frame { + msec: 2304 + hash: "56fa1756eb11a30f07f8f31c22c99973" + } + Frame { + msec: 2320 + hash: "165af677ff3921f06b89b2c8d76a7924" + } + Frame { + msec: 2336 + hash: "d64aa248d9b207b87e5ba14bdabf2f6c" + } + Frame { + msec: 2352 + hash: "33e9716eb9ca62fe5c5cb1b1ee0e9e68" + } + Frame { + msec: 2368 + hash: "cff2316820c469b84c3bacabfcf1a551" + } + Frame { + msec: 2384 + hash: "9f1359c4bab95244602254ca3954e2b7" + } + Frame { + msec: 2400 + hash: "d6246d2aaea895755eab4c839c35ca9d" + } + Frame { + msec: 2416 + hash: "d446e1ac91fec10482b0c6d38ce86d17" + } + Frame { + msec: 2432 + hash: "99f443af76a9e0d2d03638bc9927fda3" + } + Frame { + msec: 2448 + hash: "a9169e293b8154947332d9754fd23af3" + } + Frame { + msec: 2464 + hash: "cc6851cc5864615c000fbc8d552eb593" + } + Frame { + msec: 2480 + hash: "58a3a6edb5842c88cb73b79a8a187717" + } + Frame { + msec: 2496 + hash: "42bcf77c98c9a80508446bd8c66e935b" + } + Frame { + msec: 2512 + hash: "0f99350ae151591fbda95158c046e072" + } + Frame { + msec: 2528 + hash: "9e817e2fd8377b7117f908c4e87d4d57" + } + Frame { + msec: 2544 + hash: "72c105bce75feeeb7a86f823945b4ff9" + } + Frame { + msec: 2560 + hash: "653b858445bdd8afdf8abd27f5e53fb8" + } + Frame { + msec: 2576 + hash: "18bf39154fbf4b42c4d3303e018a2f27" + } + Frame { + msec: 2592 + hash: "5ed5d52ab7da7ae77e97f3ace09b3b8d" + } + Frame { + msec: 2608 + hash: "1d382462e5746ee9b6df980364b1c96b" + } + Frame { + msec: 2624 + hash: "2a0a561f38c113a0f177b1c2b99ee5e1" + } + Frame { + msec: 2640 + hash: "0605d3e2dd9132d9c1d25b75a870d647" + } + Frame { + msec: 2656 + hash: "a1def1576f386c90bb80d46e254bd384" + } + Frame { + msec: 2672 + hash: "cf38d4ae577047048d2bd0a4005abfe2" + } + Frame { + msec: 2688 + hash: "d7cb6715cd89978bbca5ce4c93b488e5" + } + Frame { + msec: 2704 + hash: "9a5075ee794af14d4f17a52bdbc47f1e" + } + Frame { + msec: 2720 + hash: "fd3d803a1e5e9e3eeae7d5edcddd0072" + } + Frame { + msec: 2736 + hash: "445114e7d10581a475989e469323d83d" + } + Frame { + msec: 2752 + hash: "58328c1d4c0ee7fca78b684697f1922c" + } + Frame { + msec: 2768 + hash: "433df4d872b9565b43af5afce1b42e15" + } + Frame { + msec: 2784 + hash: "3b694f15722a087c2c9a860cad8bb6de" + } + Frame { + msec: 2800 + hash: "1986c8036bd548ca06a32aa98ab4fc83" + } + Frame { + msec: 2816 + hash: "7845dbb0e38145f54a9e4e0bfbd608db" + } + Frame { + msec: 2832 + hash: "caed393910ae7467c307a314bdf459ef" + } + Frame { + msec: 2848 + hash: "f3f6b41b7ed04dbc1693c169bdae3b13" + } + Frame { + msec: 2864 + hash: "b9a87d15d48f951b0a1d6962fb1d5995" + } + Frame { + msec: 2880 + image: "particles.2.png" + } + Frame { + msec: 2896 + hash: "954300274b6a5785e03a6cdae67238e9" + } + Frame { + msec: 2912 + hash: "5b7f51afad796107289369c7d3494843" + } + Frame { + msec: 2928 + hash: "41164f28cbb94528eda719d590d1cf75" + } + Frame { + msec: 2944 + hash: "5953d4c9a4b4c83ba1dfd83a57ec2742" + } + Frame { + msec: 2960 + hash: "0be7c6187a26b44f12bf71587372a6c7" + } + Frame { + msec: 2976 + hash: "a7cab1faf0cdd5649c8ea3c26d2e80d0" + } + Frame { + msec: 2992 + hash: "5f91bef1865623030aea20805993319a" + } + Frame { + msec: 3008 + hash: "69d34e2a27c471ad44f8aba8d906a961" + } + Frame { + msec: 3024 + hash: "5a987879aff30d6c6712c0631bc2f43d" + } + Frame { + msec: 3040 + hash: "62b9132c58cd5fdcfe7f1bc5e64885cf" + } + Frame { + msec: 3056 + hash: "d394ef9b504abf94c1d28a9fb7f3c28b" + } + Frame { + msec: 3072 + hash: "a559cc25af950227fa5fdf70be7fd94c" + } + Frame { + msec: 3088 + hash: "318dde40fc72c5f8ee45b865a68922b1" + } + Frame { + msec: 3104 + hash: "3cbfd55773e52f48f01fe66c28c0b992" + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicsparticles/particles.qml b/tests/auto/declarative/visual/qmlgraphicsparticles/particles.qml new file mode 100644 index 0000000..8fb793f --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicsparticles/particles.qml @@ -0,0 +1,48 @@ +import Qt 4.6 + +Rectangle { + width: 640; height: 480; color: "black" + + Particles { id:particlesA + y:0; width: 260; height:30; source: "star.png"; + lifeSpan:1000; count: 50; angle:70; angleDeviation:36; + velocity:30; velocityDeviation:10; emissionRate: 10 + ParticleMotionWander { xvariance:30; pace:100 } + } + + Particles { id:particlesB + y:280; x:180; width:1; height:1; lifeSpan:1000; source: "star.png" + count: 100; angle:270; angleDeviation:45; velocity:50; velocityDeviation:30; + emissionRate: 0 + ParticleMotionGravity { yattractor: 1000; xattractor:0; acceleration:25 } + } + + Timer { running: true; interval: 1000; repeat: true; onTriggered: particlesB.burst(200, 2000); } + + Column{ + x: 340; + Repeater{ + model: 5 + delegate: Component{ + Item{ + width: 100; height: 100 + Rectangle{ + color: "blue" + width: 2; height: 2; + x: 49; y:49; + } + Particles{ + x: 50; y:50; width: 0; height: 0; + fadeInDuration: 0; fadeOutDuration: 0 + lifeSpan: 1000; lifeSpanDeviation:0; + source: "star.png" + count: -1; emissionRate: 120; + emissionVariance: index/2; + velocity: 250; velocityDeviation: 0; + angle: 0; angleDeviation: 0; + } + } + } + } + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicsparticles/star.png b/tests/auto/declarative/visual/qmlgraphicsparticles/star.png new file mode 100644 index 0000000..defbde5 Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicsparticles/star.png differ -- cgit v0.12 From 34aaa28047656a43132933eb86cfdd8f2e63a5b5 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 5 Nov 2009 17:59:55 +1000 Subject: Missing files for 8b40fac7e97a629ddaf1c0f6de2ebb504f004060 --- .../auto/declarative/valuetypes/data/autoBindingRemoval.2.qml | 9 +++++++++ .../auto/declarative/valuetypes/data/autoBindingRemoval.3.qml | 10 ++++++++++ tests/auto/declarative/valuetypes/data/autoBindingRemoval.qml | 9 +++++++++ tests/auto/declarative/valuetypes/data/bindingAssignment.qml | 7 +++++++ tests/auto/declarative/valuetypes/data/bindingConflict.qml | 8 ++++++++ tests/auto/declarative/valuetypes/data/bindingRead.qml | 5 +++++ tests/auto/declarative/valuetypes/data/scriptAccess.qml | 9 +++++++++ tests/auto/declarative/valuetypes/data/staticAssignment.qml | 5 +++++ tests/auto/declarative/valuetypes/data/valueInterceptors.qml | 8 ++++++++ tests/auto/declarative/valuetypes/data/valueSources.qml | 5 +++++ 10 files changed, 75 insertions(+) create mode 100644 tests/auto/declarative/valuetypes/data/autoBindingRemoval.2.qml create mode 100644 tests/auto/declarative/valuetypes/data/autoBindingRemoval.3.qml create mode 100644 tests/auto/declarative/valuetypes/data/autoBindingRemoval.qml create mode 100644 tests/auto/declarative/valuetypes/data/bindingAssignment.qml create mode 100644 tests/auto/declarative/valuetypes/data/bindingConflict.qml create mode 100644 tests/auto/declarative/valuetypes/data/bindingRead.qml create mode 100644 tests/auto/declarative/valuetypes/data/scriptAccess.qml create mode 100644 tests/auto/declarative/valuetypes/data/staticAssignment.qml create mode 100644 tests/auto/declarative/valuetypes/data/valueInterceptors.qml create mode 100644 tests/auto/declarative/valuetypes/data/valueSources.qml diff --git a/tests/auto/declarative/valuetypes/data/autoBindingRemoval.2.qml b/tests/auto/declarative/valuetypes/data/autoBindingRemoval.2.qml new file mode 100644 index 0000000..ce2e82d --- /dev/null +++ b/tests/auto/declarative/valuetypes/data/autoBindingRemoval.2.qml @@ -0,0 +1,9 @@ +import Test 1.0 + +MyTypeObject { + property int value: 10 + rect.x: value + + onRunScript: { rect = Qt.rect(10, 10, 10, 10) } +} + diff --git a/tests/auto/declarative/valuetypes/data/autoBindingRemoval.3.qml b/tests/auto/declarative/valuetypes/data/autoBindingRemoval.3.qml new file mode 100644 index 0000000..c82b533 --- /dev/null +++ b/tests/auto/declarative/valuetypes/data/autoBindingRemoval.3.qml @@ -0,0 +1,10 @@ +import Test 1.0 + +MyTypeObject { + property var value + + rect: value + + onRunScript: { rect.x = 44 } +} + diff --git a/tests/auto/declarative/valuetypes/data/autoBindingRemoval.qml b/tests/auto/declarative/valuetypes/data/autoBindingRemoval.qml new file mode 100644 index 0000000..a8a72f5 --- /dev/null +++ b/tests/auto/declarative/valuetypes/data/autoBindingRemoval.qml @@ -0,0 +1,9 @@ +import Test 1.0 + +MyTypeObject { + property int value: 10 + rect.x: value + + onRunScript: { rect.x = 42; } +} + diff --git a/tests/auto/declarative/valuetypes/data/bindingAssignment.qml b/tests/auto/declarative/valuetypes/data/bindingAssignment.qml new file mode 100644 index 0000000..a652186 --- /dev/null +++ b/tests/auto/declarative/valuetypes/data/bindingAssignment.qml @@ -0,0 +1,7 @@ +import Test 1.0 + +MyTypeObject { + property int value: 10 + + rect.x: value +} diff --git a/tests/auto/declarative/valuetypes/data/bindingConflict.qml b/tests/auto/declarative/valuetypes/data/bindingConflict.qml new file mode 100644 index 0000000..fd25c9f --- /dev/null +++ b/tests/auto/declarative/valuetypes/data/bindingConflict.qml @@ -0,0 +1,8 @@ +import Test 1.0 + +MyTypeObject { + property int value: 13 + + rect.x: value + rect: "10,10,10x10" +} diff --git a/tests/auto/declarative/valuetypes/data/bindingRead.qml b/tests/auto/declarative/valuetypes/data/bindingRead.qml new file mode 100644 index 0000000..538d776 --- /dev/null +++ b/tests/auto/declarative/valuetypes/data/bindingRead.qml @@ -0,0 +1,5 @@ +import Test 1.0 + +MyTypeObject { + property int value: rect.x +} diff --git a/tests/auto/declarative/valuetypes/data/scriptAccess.qml b/tests/auto/declarative/valuetypes/data/scriptAccess.qml new file mode 100644 index 0000000..96592eb --- /dev/null +++ b/tests/auto/declarative/valuetypes/data/scriptAccess.qml @@ -0,0 +1,9 @@ +import Qt 4.6 +import Test 1.0 + +MyTypeObject { + property int valuePre; + property int valuePost; + + Component.onCompleted: { valuePre = rect.x; rect.x = 19; valuePost = rect.x; } +} diff --git a/tests/auto/declarative/valuetypes/data/staticAssignment.qml b/tests/auto/declarative/valuetypes/data/staticAssignment.qml new file mode 100644 index 0000000..b687f89 --- /dev/null +++ b/tests/auto/declarative/valuetypes/data/staticAssignment.qml @@ -0,0 +1,5 @@ +import Test 1.0 + +MyTypeObject { + rect.x: 9 +} diff --git a/tests/auto/declarative/valuetypes/data/valueInterceptors.qml b/tests/auto/declarative/valuetypes/data/valueInterceptors.qml new file mode 100644 index 0000000..026ae83 --- /dev/null +++ b/tests/auto/declarative/valuetypes/data/valueInterceptors.qml @@ -0,0 +1,8 @@ +import Test 1.0 + +MyTypeObject { + property int value: 13; + + rect.x: MyOffsetValueInterceptor {} + rect.x: value +} diff --git a/tests/auto/declarative/valuetypes/data/valueSources.qml b/tests/auto/declarative/valuetypes/data/valueSources.qml new file mode 100644 index 0000000..d4d4391 --- /dev/null +++ b/tests/auto/declarative/valuetypes/data/valueSources.qml @@ -0,0 +1,5 @@ +import Test 1.0 + +MyTypeObject { + rect.x: MyConstantValueSource {} +} -- cgit v0.12 From 9bb160d8cee882bec25d7654a4d0554a755265c5 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Thu, 5 Nov 2009 18:27:18 +1000 Subject: Get tests passing on Mac There was inconsistent rounding of text widths. Task-number: QT-4200 QT-4201 --- .../graphicsitems/qmlgraphicsparticles.cpp | 22 +++++++++++----------- .../declarative/qfxtextedit/tst_qfxtextedit.cpp | 6 ++++-- .../declarative/qfxtextinput/tst_qfxtextinput.cpp | 4 ++-- .../qmlgraphicstext/tst_qmlgraphicstext.cpp | 6 ++++-- 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/declarative/graphicsitems/qmlgraphicsparticles.cpp b/src/declarative/graphicsitems/qmlgraphicsparticles.cpp index 92943e8..4ac02b4 100644 --- a/src/declarative/graphicsitems/qmlgraphicsparticles.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsparticles.cpp @@ -302,7 +302,7 @@ void QmlGraphicsParticleMotionWander::advance(QmlGraphicsParticle &p, int interv qreal xdiff = p.x_velocity - d->x_targetV; if ((xdiff > d->x_peak && d->x_var > 0.0) || (xdiff < -d->x_peak && d->x_var < 0.0)) { d->x_var = -d->x_var; - d->x_peak = _xvariance + _xvariance * qreal(rand()) / RAND_MAX; + d->x_peak = _xvariance + _xvariance * qreal(qrand()) / RAND_MAX; } p.x_velocity += d->x_var * interval; } @@ -312,7 +312,7 @@ void QmlGraphicsParticleMotionWander::advance(QmlGraphicsParticle &p, int interv qreal ydiff = p.y_velocity - d->y_targetV; if ((ydiff > d->y_peak && d->y_var > 0.0) || (ydiff < -d->y_peak && d->y_var < 0.0)) { d->y_var = -d->y_var; - d->y_peak = _yvariance + _yvariance * qreal(rand()) / RAND_MAX; + d->y_peak = _yvariance + _yvariance * qreal(qrand()) / RAND_MAX; } p.y_velocity += d->y_var * interval; } @@ -329,8 +329,8 @@ void QmlGraphicsParticleMotionWander::created(QmlGraphicsParticle &p) d->y_targetV = p.y_velocity; d->x_peak = _xvariance; d->y_peak = _yvariance; - d->x_var = _pace * qreal(rand()) / RAND_MAX / 1000.0; - d->y_var = _pace * qreal(rand()) / RAND_MAX / 1000.0; + d->x_var = _pace * qreal(qrand()) / RAND_MAX / 1000.0; + d->y_var = _pace * qreal(qrand()) / RAND_MAX / 1000.0; } } @@ -456,7 +456,7 @@ void QmlGraphicsParticlesPrivate::tick(int time) if (emissionRate != -1){ qreal variance = 1.; if (emissionVariance > 0.){ - variance += (qreal(rand())/RAND_MAX) * emissionVariance * (rand()%2?-1.:1.); + variance += (qreal(qrand())/RAND_MAX) * emissionVariance * (qrand()%2?-1.:1.); } qreal emission = emissionRate * (qreal(interval)/1000.); emission = emission * variance + emissionCarry; @@ -478,7 +478,7 @@ void QmlGraphicsParticlesPrivate::tick(int time) }else{ qreal variance = 1.; if (emissionVariance > 0.){ - variance += (qreal(rand())/RAND_MAX) * emissionVariance * (rand()%2?-1.:1.); + variance += (qreal(qrand())/RAND_MAX) * emissionVariance * (qrand()%2?-1.:1.); } qreal workingEmission = bursts[i].second * (qreal(interval)/1000.); workingEmission *= variance; @@ -510,11 +510,11 @@ void QmlGraphicsParticlesPrivate::createParticle(int time) #endif Q_Q(QmlGraphicsParticles); QmlGraphicsParticle p(time); - p.x = q->x() + q->width() * qreal(rand()) / RAND_MAX - image.width()/2.0; - p.y = q->y() + q->height() * qreal(rand()) / RAND_MAX - image.height()/2.0; + p.x = q->x() + q->width() * qreal(qrand()) / RAND_MAX - image.width()/2.0; + p.y = q->y() + q->height() * qreal(qrand()) / RAND_MAX - image.height()/2.0; p.lifeSpan = lifeSpan; if (lifeSpanDev) - p.lifeSpan += int(lifeSpanDev/2 - lifeSpanDev * qreal(rand()) / RAND_MAX); + p.lifeSpan += int(lifeSpanDev/2 - lifeSpanDev * qreal(qrand()) / RAND_MAX); p.fadeOutAge = p.lifeSpan - fadeOutDur; if (fadeInDur == 0.) { p.state= QmlGraphicsParticle::Solid; @@ -522,12 +522,12 @@ void QmlGraphicsParticlesPrivate::createParticle(int time) } qreal a = angle; if (angleDev) - a += angleDev/2 - angleDev * qreal(rand()) / RAND_MAX; + a += angleDev/2 - angleDev * qreal(qrand()) / RAND_MAX; if (a > M_PI) a = a - 2 * M_PI; qreal v = velocity; if (velocityDev) - v += velocityDev/2 - velocityDev * qreal(rand()) / RAND_MAX; + v += velocityDev/2 - velocityDev * qreal(qrand()) / RAND_MAX; p.x_velocity = v * fastCos(a); p.y_velocity = v * fastSin(a); particles.append(p); diff --git a/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp b/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp index 7bc6121..19d5998 100644 --- a/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp +++ b/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include #include "../../../shared/util.h" +#include #include #include #include @@ -183,8 +184,9 @@ void tst_qfxtextedit::width() for (int i = 0; i < standard.size(); i++) { QFont f; - QFontMetrics fm(f); - int metricWidth = fm.size(Qt::TextExpandTabs && Qt::TextShowMnemonic, standard.at(i)).width(); + QFontMetricsF fm(f); + qreal metricWidth = fm.size(Qt::TextExpandTabs && Qt::TextShowMnemonic, standard.at(i)).width(); + metricWidth = floor(metricWidth); QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + standard.at(i) + "\" }"; QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); diff --git a/tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp b/tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp index 2dc096d..8eeb22d 100644 --- a/tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp +++ b/tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp @@ -132,8 +132,8 @@ void tst_qfxtextinput::width() for (int i = 0; i < standard.size(); i++) { QFont f; - QFontMetrics fm(f); - int metricWidth = fm.width(standard.at(i)); + QFontMetricsF fm(f); + qreal metricWidth = fm.width(standard.at(i)); QString componentStr = "import Qt 4.6\nTextInput { text: \"" + standard.at(i) + "\" }"; QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); diff --git a/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp b/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp index ba5c835..2a3cdde 100644 --- a/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp +++ b/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp @@ -45,6 +45,7 @@ #include #include #include +#include class tst_qmlgraphicstext : public QObject @@ -201,8 +202,9 @@ void tst_qmlgraphicstext::width() QVERIFY(!Qt::mightBeRichText(standard.at(i))); // self-test QFont f; - QFontMetrics fm(f); - int metricWidth = fm.size(Qt::TextExpandTabs && Qt::TextShowMnemonic, standard.at(i)).width(); + QFontMetricsF fm(f); + qreal metricWidth = fm.size(Qt::TextExpandTabs && Qt::TextShowMnemonic, standard.at(i)).width(); + metricWidth = floor(metricWidth); QString componentStr = "import Qt 4.6\nText { text: \"" + standard.at(i) + "\" }"; QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); -- cgit v0.12 From 1a7cee240904a3aea112fc102901066fe26d45d6 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 5 Nov 2009 18:30:55 +1000 Subject: More error-case tests --- .../declarative/qmllanguage/data/invalidImportID.errors.txt | 1 + tests/auto/declarative/qmllanguage/data/invalidImportID.qml | 4 ++++ .../declarative/qmllanguage/data/invalidRoot.errors.txt | 1 + tests/auto/declarative/qmllanguage/data/invalidRoot.qml | 2 ++ .../auto/declarative/qmllanguage/data/property.1.errors.txt | 1 + tests/auto/declarative/qmllanguage/data/property.1.qml | 5 +++++ .../auto/declarative/qmllanguage/data/property.2.errors.txt | 1 + tests/auto/declarative/qmllanguage/data/property.2.qml | 6 ++++++ .../auto/declarative/qmllanguage/data/property.3.errors.txt | 1 + tests/auto/declarative/qmllanguage/data/property.3.qml | 7 +++++++ .../auto/declarative/qmllanguage/data/property.4.errors.txt | 1 + tests/auto/declarative/qmllanguage/data/property.4.qml | 5 +++++ .../auto/declarative/qmllanguage/data/property.5.errors.txt | 1 + tests/auto/declarative/qmllanguage/data/property.5.qml | 6 ++++++ .../auto/declarative/qmllanguage/data/script.12.errors.txt | 1 + tests/auto/declarative/qmllanguage/data/script.12.qml | 6 ++++++ tests/auto/declarative/qmllanguage/data/signal.1.errors.txt | 1 + tests/auto/declarative/qmllanguage/data/signal.1.qml | 5 +++++ tests/auto/declarative/qmllanguage/data/signal.2.errors.txt | 1 + tests/auto/declarative/qmllanguage/data/signal.2.qml | 6 ++++++ tests/auto/declarative/qmllanguage/data/signal.3.errors.txt | 1 + tests/auto/declarative/qmllanguage/data/signal.3.qml | 6 ++++++ tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp | 13 +++++++++++++ 23 files changed, 82 insertions(+) create mode 100644 tests/auto/declarative/qmllanguage/data/invalidImportID.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidImportID.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidRoot.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidRoot.qml create mode 100644 tests/auto/declarative/qmllanguage/data/property.1.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/property.1.qml create mode 100644 tests/auto/declarative/qmllanguage/data/property.2.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/property.2.qml create mode 100644 tests/auto/declarative/qmllanguage/data/property.3.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/property.3.qml create mode 100644 tests/auto/declarative/qmllanguage/data/property.4.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/property.4.qml create mode 100644 tests/auto/declarative/qmllanguage/data/property.5.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/property.5.qml create mode 100644 tests/auto/declarative/qmllanguage/data/script.12.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/script.12.qml create mode 100644 tests/auto/declarative/qmllanguage/data/signal.1.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/signal.1.qml create mode 100644 tests/auto/declarative/qmllanguage/data/signal.2.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/signal.2.qml create mode 100644 tests/auto/declarative/qmllanguage/data/signal.3.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/signal.3.qml diff --git a/tests/auto/declarative/qmllanguage/data/invalidImportID.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidImportID.errors.txt new file mode 100644 index 0000000..a65f5fd --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidImportID.errors.txt @@ -0,0 +1 @@ +2:18:Invalid import qualifier ID diff --git a/tests/auto/declarative/qmllanguage/data/invalidImportID.qml b/tests/auto/declarative/qmllanguage/data/invalidImportID.qml new file mode 100644 index 0000000..75aa06d --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidImportID.qml @@ -0,0 +1,4 @@ +import Qt 4.6 +import Qt 4.6 as qt + +Object {} diff --git a/tests/auto/declarative/qmllanguage/data/invalidRoot.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidRoot.errors.txt new file mode 100644 index 0000000..4bcc948 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidRoot.errors.txt @@ -0,0 +1 @@ +1:1:Expected type name diff --git a/tests/auto/declarative/qmllanguage/data/invalidRoot.qml b/tests/auto/declarative/qmllanguage/data/invalidRoot.qml new file mode 100644 index 0000000..427827c --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidRoot.qml @@ -0,0 +1,2 @@ +foo { +} diff --git a/tests/auto/declarative/qmllanguage/data/property.1.errors.txt b/tests/auto/declarative/qmllanguage/data/property.1.errors.txt new file mode 100644 index 0000000..3ae6c46 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/property.1.errors.txt @@ -0,0 +1 @@ +4:14:Expected property type diff --git a/tests/auto/declarative/qmllanguage/data/property.1.qml b/tests/auto/declarative/qmllanguage/data/property.1.qml new file mode 100644 index 0000000..62178e5 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/property.1.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +Object { + property blah a; +} diff --git a/tests/auto/declarative/qmllanguage/data/property.2.errors.txt b/tests/auto/declarative/qmllanguage/data/property.2.errors.txt new file mode 100644 index 0000000..a18e21a --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/property.2.errors.txt @@ -0,0 +1 @@ +4:14:Unexpected property type modifier diff --git a/tests/auto/declarative/qmllanguage/data/property.2.qml b/tests/auto/declarative/qmllanguage/data/property.2.qml new file mode 100644 index 0000000..1d6d015 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/property.2.qml @@ -0,0 +1,6 @@ +import Qt 4.6 + +Object { + property invalidmodifier a; +} + diff --git a/tests/auto/declarative/qmllanguage/data/property.3.errors.txt b/tests/auto/declarative/qmllanguage/data/property.3.errors.txt new file mode 100644 index 0000000..5e09a25 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/property.3.errors.txt @@ -0,0 +1 @@ +4:14:Invalid property type modifier diff --git a/tests/auto/declarative/qmllanguage/data/property.3.qml b/tests/auto/declarative/qmllanguage/data/property.3.qml new file mode 100644 index 0000000..1b14b86 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/property.3.qml @@ -0,0 +1,7 @@ +import Qt 4.6 + +Object { + property invalidmodifier a; +} + + diff --git a/tests/auto/declarative/qmllanguage/data/property.4.errors.txt b/tests/auto/declarative/qmllanguage/data/property.4.errors.txt new file mode 100644 index 0000000..b447186 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/property.4.errors.txt @@ -0,0 +1 @@ +5:1:Syntax error diff --git a/tests/auto/declarative/qmllanguage/data/property.4.qml b/tests/auto/declarative/qmllanguage/data/property.4.qml new file mode 100644 index 0000000..d256c96 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/property.4.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +Object { + readonly property int a +} diff --git a/tests/auto/declarative/qmllanguage/data/property.5.errors.txt b/tests/auto/declarative/qmllanguage/data/property.5.errors.txt new file mode 100644 index 0000000..32a8dc1 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/property.5.errors.txt @@ -0,0 +1 @@ +4:5:Readonly not yet supported diff --git a/tests/auto/declarative/qmllanguage/data/property.5.qml b/tests/auto/declarative/qmllanguage/data/property.5.qml new file mode 100644 index 0000000..c3aaf5e --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/property.5.qml @@ -0,0 +1,6 @@ +import Qt 4.6 + +Object { + readonly property int a: value +} + diff --git a/tests/auto/declarative/qmllanguage/data/script.12.errors.txt b/tests/auto/declarative/qmllanguage/data/script.12.errors.txt new file mode 100644 index 0000000..85c8396 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/script.12.errors.txt @@ -0,0 +1 @@ +4:5:QmlJS declaration outside Script element diff --git a/tests/auto/declarative/qmllanguage/data/script.12.qml b/tests/auto/declarative/qmllanguage/data/script.12.qml new file mode 100644 index 0000000..ea6c482 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/script.12.qml @@ -0,0 +1,6 @@ +import Qt 4.6 + +Object { + var a +} + diff --git a/tests/auto/declarative/qmllanguage/data/signal.1.errors.txt b/tests/auto/declarative/qmllanguage/data/signal.1.errors.txt new file mode 100644 index 0000000..78d9960 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/signal.1.errors.txt @@ -0,0 +1 @@ +4:12:Expected parameter type diff --git a/tests/auto/declarative/qmllanguage/data/signal.1.qml b/tests/auto/declarative/qmllanguage/data/signal.1.qml new file mode 100644 index 0000000..d0ad155 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/signal.1.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +Object { + signal mySignal(nontype a) +} diff --git a/tests/auto/declarative/qmllanguage/data/signal.2.errors.txt b/tests/auto/declarative/qmllanguage/data/signal.2.errors.txt new file mode 100644 index 0000000..fce8928 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/signal.2.errors.txt @@ -0,0 +1 @@ +4:21:Unexpected token `;' diff --git a/tests/auto/declarative/qmllanguage/data/signal.2.qml b/tests/auto/declarative/qmllanguage/data/signal.2.qml new file mode 100644 index 0000000..aa45ae9 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/signal.2.qml @@ -0,0 +1,6 @@ +import Qt 4.6 + +Object { + signal mySignal(,) +} + diff --git a/tests/auto/declarative/qmllanguage/data/signal.3.errors.txt b/tests/auto/declarative/qmllanguage/data/signal.3.errors.txt new file mode 100644 index 0000000..bf043ac --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/signal.3.errors.txt @@ -0,0 +1 @@ +4:22:Expected token `identifier' diff --git a/tests/auto/declarative/qmllanguage/data/signal.3.qml b/tests/auto/declarative/qmllanguage/data/signal.3.qml new file mode 100644 index 0000000..f38ccc5 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/signal.3.qml @@ -0,0 +1,6 @@ +import Qt 4.6 + +Object { + signal mySignal(a) +} + diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp index 0fa36a1..c646583 100644 --- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp +++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp @@ -246,6 +246,17 @@ void tst_qmllanguage::errors_data() QTest::newRow("importNamespaceConflict") << "importNamespaceConflict.qml" << "importNamespaceConflict.errors.txt" << false; QTest::newRow("importVersionMissing (builtin)") << "importVersionMissingBuiltIn.qml" << "importVersionMissingBuiltIn.errors.txt" << false; QTest::newRow("importVersionMissing (installed)") << "importVersionMissingInstalled.qml" << "importVersionMissingInstalled.errors.txt" << false; + QTest::newRow("invalidImportID") << "invalidImportID.qml" << "invalidImportID.errors.txt" << false; + + QTest::newRow("signal.1") << "signal.1.qml" << "signal.1.errors.txt" << false; + QTest::newRow("signal.2") << "signal.2.qml" << "signal.2.errors.txt" << false; + QTest::newRow("signal.3") << "signal.3.qml" << "signal.3.errors.txt" << false; + + QTest::newRow("property.1") << "property.1.qml" << "property.1.errors.txt" << false; + QTest::newRow("property.2") << "property.2.qml" << "property.2.errors.txt" << false; + QTest::newRow("property.3") << "property.3.qml" << "property.3.errors.txt" << false; + QTest::newRow("property.4") << "property.4.qml" << "property.4.errors.txt" << false; + QTest::newRow("property.5") << "property.5.qml" << "property.5.errors.txt" << false; QTest::newRow("Script.1") << "script.1.qml" << "script.1.errors.txt" << false; QTest::newRow("Script.2") << "script.2.qml" << "script.2.errors.txt" << false; @@ -258,6 +269,7 @@ void tst_qmllanguage::errors_data() QTest::newRow("Script.9") << "script.9.qml" << "script.9.errors.txt" << false; QTest::newRow("Script.10") << "script.10.qml" << "script.10.errors.txt" << false; QTest::newRow("Script.11") << "script.11.qml" << "script.11.errors.txt" << false; + QTest::newRow("Script.12") << "script.12.qml" << "script.12.errors.txt" << false; QTest::newRow("Component.1") << "component.1.qml" << "component.1.errors.txt" << false; QTest::newRow("Component.2") << "component.2.qml" << "component.2.errors.txt" << false; @@ -270,6 +282,7 @@ void tst_qmllanguage::errors_data() QTest::newRow("defaultGrouped") << "defaultGrouped.qml" << "defaultGrouped.errors.txt" << false; QTest::newRow("emptySignal") << "emptySignal.qml" << "emptySignal.errors.txt" << false; QTest::newRow("doubleSignal") << "doubleSignal.qml" << "doubleSignal.errors.txt" << false; + QTest::newRow("invalidRoot") << "invalidRoot.qml" << "invalidRoot.errors.txt" << false; } void tst_qmllanguage::errors() -- cgit v0.12 From 315d460e6a4ce5fa8c9fcb90474d43174b5e0b0d Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 5 Nov 2009 19:56:22 +1000 Subject: Tests --- src/declarative/qml/qmlmetatype.cpp | 45 +---- src/declarative/qml/qmlmetatype.h | 3 - src/declarative/qml/qmlprivate.h | 3 +- .../declarative/qmlmetatype/tst_qmlmetatype.cpp | 225 +++++++++++++++++++++ 4 files changed, 231 insertions(+), 45 deletions(-) diff --git a/src/declarative/qml/qmlmetatype.cpp b/src/declarative/qml/qmlmetatype.cpp index 6ecaa9f..5fb2f50 100644 --- a/src/declarative/qml/qmlmetatype.cpp +++ b/src/declarative/qml/qmlmetatype.cpp @@ -134,7 +134,6 @@ public: QmlCustomParser *m_customParser; mutable volatile bool m_isSetup:1; mutable QList m_metaObjects; - mutable QByteArray m_hash; }; QmlTypePrivate::QmlTypePrivate() @@ -259,27 +258,6 @@ void QmlTypePrivate::init() const m_metaObjects.at(ii).metaObject->methodOffset(); } - // Calculate hash - QByteArray hashData; - - const QMetaObject *myMetaObject = m_metaObjects.isEmpty()?m_baseMetaObject:m_metaObjects.first().metaObject; - - for (int ii = 0; ii < myMetaObject->propertyCount(); ++ii) { - QMetaProperty prop = myMetaObject->property(ii); - hashData.append(prop.type()); - hashData.append("|"); - hashData.append(prop.name()); - hashData.append("|"); - } - - for (int ii = 0; ii < myMetaObject->methodCount(); ++ii) { - QMetaMethod method = myMetaObject->method(ii); - hashData.append(method.signature()); - hashData.append("|"); - } - - m_hash = QCryptographicHash::hash(hashData, QCryptographicHash::Md5); - m_isSetup = true; lock.unlock(); } @@ -297,13 +275,6 @@ QByteArray QmlType::qmlTypeName() const return d->m_name; } -QByteArray QmlType::hash() const -{ - d->init(); - - return d->m_hash; -} - QObject *QmlType::create() const { d->init(); @@ -804,17 +775,6 @@ const char *QmlMetaType::interfaceIId(int userType) return 0; } -bool QmlMetaType::isObject(const QMetaObject *mo) -{ - // ### Huh? - while(mo) { - if (mo == &QObject::staticMetaObject) - return true; - mo = mo->superClass(); - } - return false; -} - bool QmlMetaType::isQmlList(int userType) { QReadLocker lock(metaTypeDataLock()); @@ -851,6 +811,9 @@ int QmlMetaType::listCount(const QVariant &v) QVariant QmlMetaType::listAt(const QVariant &v, int idx) { + if (idx < 0) + return QVariant(); + int userType = v.userType(); QReadLocker lock(metaTypeDataLock()); @@ -861,7 +824,7 @@ QVariant QmlMetaType::listAt(const QVariant &v, int idx) if (type && type->qListTypeId() == userType) return type->listAt(v, idx); else - return 0; + return QVariant(); } /*! diff --git a/src/declarative/qml/qmlmetatype.h b/src/declarative/qml/qmlmetatype.h index e90c367..1f493f8 100644 --- a/src/declarative/qml/qmlmetatype.h +++ b/src/declarative/qml/qmlmetatype.h @@ -97,7 +97,6 @@ public: static bool isInterface(int); static const char *interfaceIId(int); static bool isObject(int); - static bool isObject(const QMetaObject *); static bool isList(int); static bool isList(const QVariant &); static bool isQmlList(int); @@ -121,8 +120,6 @@ public: int minorVersion() const; bool availableInVersion(int vmajor, int vminor) const; - QByteArray hash() const; - QObject *create() const; QmlCustomParser *customParser() const; diff --git a/src/declarative/qml/qmlprivate.h b/src/declarative/qml/qmlprivate.h index e5b1060..0eec43c 100644 --- a/src/declarative/qml/qmlprivate.h +++ b/src/declarative/qml/qmlprivate.h @@ -283,7 +283,8 @@ int QmlPrivate::list_op(QmlPrivate::ListOp op, int val, } break; case QmlPrivate::Value: - *((QVariant *)*out) = QVariant::fromValue(list->at(val)); + if (list->count() <= val) *((QVariant *)*out) = QVariant(); + else *((QVariant *)*out) = QVariant::fromValue(list->at(val)); break; } return 0; diff --git a/tests/auto/declarative/qmlmetatype/tst_qmlmetatype.cpp b/tests/auto/declarative/qmlmetatype/tst_qmlmetatype.cpp index ed102a5..b481ce4 100644 --- a/tests/auto/declarative/qmlmetatype/tst_qmlmetatype.cpp +++ b/tests/auto/declarative/qmlmetatype/tst_qmlmetatype.cpp @@ -51,6 +51,7 @@ #include #include #include +#include class tst_qmlmetatype : public QObject { @@ -60,8 +61,62 @@ public: private slots: void copy(); + + void qmlParserStatusCast(); + void qmlPropertyValueSourceCast(); + void qmlPropertyValueInterceptorCast(); + + void isList(); + void isQmlList(); + + void listCount(); + void listAt(); + + void defaultObject(); }; +class TestType : public QObject +{ + Q_OBJECT + Q_PROPERTY(int foo READ foo); + + Q_CLASSINFO("DefaultProperty", "foo"); +public: + int foo() { return 0; } +}; +QML_DECLARE_TYPE(TestType); +QML_DEFINE_TYPE(Test, 1, 0, TestType, TestType); + +class ParserStatusTestType : public QObject, public QmlParserStatus +{ + Q_OBJECT + Q_CLASSINFO("DefaultProperty", "foo"); // Missing default property +}; +QML_DECLARE_TYPE(ParserStatusTestType); +QML_DEFINE_TYPE(Test, 1, 0, ParserStatusTestType, ParserStatusTestType); + +class ValueSourceTestType : public QObject, public QmlPropertyValueSource +{ + Q_OBJECT + Q_INTERFACES(QmlPropertyValueSource) +public: + virtual void setTarget(const QmlMetaProperty &) {} +}; +QML_DECLARE_TYPE(ValueSourceTestType); +QML_DEFINE_TYPE(Test, 1, 0, ValueSourceTestType, ValueSourceTestType); + +class ValueInterceptorTestType : public QObject, public QmlPropertyValueInterceptor +{ + Q_OBJECT + Q_INTERFACES(QmlPropertyValueInterceptor) +public: + virtual void setTarget(const QmlMetaProperty &) {} + virtual void write(const QVariant &) {} +}; +QML_DECLARE_TYPE(ValueInterceptorTestType); +QML_DEFINE_TYPE(Test, 1, 0, ValueInterceptorTestType, ValueInterceptorTestType); + + #define COPY_TEST(cpptype, metatype, value, defaultvalue) \ { \ cpptype v = (value); cpptype v2 = (value); \ @@ -181,6 +236,7 @@ void tst_qmlmetatype::copy() QT_COPY_TEST(QKeySequence, QKeySequence("Ctrl+O")); QT_COPY_TEST(QPen, QPen(Qt::red)); QT_COPY_TEST(QTextLength, QTextLength(QTextLength::FixedLength, 10.2)); + QT_COPY_TEST(QTextFormat, QTextFormat(QTextFormat::ListFormat)); QT_COPY_TEST(QMatrix, QMatrix().translate(10, 10)); QT_COPY_TEST(QTransform, QTransform().translate(10, 10)); QT_COPY_TEST(QMatrix4x4, QMatrix4x4().translate(10, 10)); @@ -204,6 +260,175 @@ void tst_qmlmetatype::copy() COPY_TEST(QObject *, QObjectStar, &objectValue, 0); COPY_TEST(QWidget *, QWidgetStar, &widgetValue, 0); COPY_TEST(qreal, QReal, 10.2, 0); + + { + QVariant tv = QVariant::fromValue(QVariant(10)); + QVariant v(tv); QVariant v2(tv); + QVERIFY(QmlMetaType::copy(qMetaTypeId(), &v, 0)); + QVERIFY(v == QVariant()); + QVERIFY(QmlMetaType::copy(qMetaTypeId(), &v, &v2)); + QVERIFY(v == tv); + } + + { + TestType t; QVariant tv = QVariant::fromValue(&t); + + QVariant v(tv); QVariant v2(tv); + QVERIFY(QmlMetaType::copy(qMetaTypeId(), &v, 0)); + QVERIFY(v == QVariant::fromValue((TestType *)0)); + QVERIFY(QmlMetaType::copy(qMetaTypeId(), &v, &v2)); + QVERIFY(v == tv); + } +} + +void tst_qmlmetatype::qmlParserStatusCast() +{ + QCOMPARE(QmlMetaType::qmlParserStatusCast(QVariant::Int), -1); + QCOMPARE(QmlMetaType::qmlParserStatusCast(qMetaTypeId()), -1); + QCOMPARE(QmlMetaType::qmlParserStatusCast(qMetaTypeId()), -1); + + int cast = QmlMetaType::qmlParserStatusCast(qMetaTypeId()); + QVERIFY(cast != -1); + QVERIFY(cast != 0); + + ParserStatusTestType t; + QVERIFY(reinterpret_cast((QObject *)&t) != reinterpret_cast((QmlParserStatus *)&t)); + + QmlParserStatus *status = reinterpret_cast(reinterpret_cast((QObject *)&t) + cast); + QCOMPARE(status, &t); +} + +void tst_qmlmetatype::qmlPropertyValueSourceCast() +{ + QCOMPARE(QmlMetaType::qmlPropertyValueSourceCast(QVariant::Int), -1); + QCOMPARE(QmlMetaType::qmlPropertyValueSourceCast(qMetaTypeId()), -1); + QCOMPARE(QmlMetaType::qmlPropertyValueSourceCast(qMetaTypeId()), -1); + + int cast = QmlMetaType::qmlPropertyValueSourceCast(qMetaTypeId()); + QVERIFY(cast != -1); + QVERIFY(cast != 0); + + ValueSourceTestType t; + QVERIFY(reinterpret_cast((QObject *)&t) != reinterpret_cast((QmlPropertyValueSource *)&t)); + + QmlPropertyValueSource *source = reinterpret_cast(reinterpret_cast((QObject *)&t) + cast); + QCOMPARE(source, &t); +} + +void tst_qmlmetatype::qmlPropertyValueInterceptorCast() +{ + QCOMPARE(QmlMetaType::qmlPropertyValueInterceptorCast(QVariant::Int), -1); + QCOMPARE(QmlMetaType::qmlPropertyValueInterceptorCast(qMetaTypeId()), -1); + QCOMPARE(QmlMetaType::qmlPropertyValueInterceptorCast(qMetaTypeId()), -1); + + int cast = QmlMetaType::qmlPropertyValueInterceptorCast(qMetaTypeId()); + QVERIFY(cast != -1); + QVERIFY(cast != 0); + + ValueInterceptorTestType t; + QVERIFY(reinterpret_cast((QObject *)&t) != reinterpret_cast((QmlPropertyValueInterceptor *)&t)); + + QmlPropertyValueInterceptor *interceptor = reinterpret_cast(reinterpret_cast((QObject *)&t) + cast); + QCOMPARE(interceptor, &t); +} + +void tst_qmlmetatype::isList() +{ + QCOMPARE(QmlMetaType::isList(QVariant()), false); + QCOMPARE(QmlMetaType::isList(QVariant::Invalid), false); + QCOMPARE(QmlMetaType::isList(QVariant::Int), false); + QCOMPARE(QmlMetaType::isList(QVariant(10)), false); + + QList list; + QmlConcreteList qmllist; + + QCOMPARE(QmlMetaType::isList(qMetaTypeId*>()), true); + QCOMPARE(QmlMetaType::isList(QVariant::fromValue(&list)), true); + QCOMPARE(QmlMetaType::isList(qMetaTypeId*>()), false); + QCOMPARE(QmlMetaType::isList(QVariant::fromValue((QmlList*)&qmllist)), false); +} + +void tst_qmlmetatype::isQmlList() +{ + QCOMPARE(QmlMetaType::isQmlList(QVariant::Invalid), false); + QCOMPARE(QmlMetaType::isQmlList(QVariant::Int), false); + + QCOMPARE(QmlMetaType::isQmlList(qMetaTypeId*>()), false); + QCOMPARE(QmlMetaType::isQmlList(qMetaTypeId*>()), true); +} + +void tst_qmlmetatype::listCount() +{ + QCOMPARE(QmlMetaType::listCount(QVariant()), 0); + QCOMPARE(QmlMetaType::listCount(QVariant(10)), 0); + + QList list; + QVariant listVar = QVariant::fromValue(&list); + QmlConcreteList qmllist; + QVariant qmllistVar = QVariant::fromValue((QmlList*)&qmllist); + + QCOMPARE(QmlMetaType::listCount(listVar), 0); + QCOMPARE(QmlMetaType::listCount(qmllistVar), 0); + + list.append(0); list.append(0); list.append(0); + qmllist.append(0); qmllist.append(0); qmllist.append(0); + + QCOMPARE(QmlMetaType::listCount(listVar), 3); + QCOMPARE(QmlMetaType::listCount(qmllistVar), 0); +} + +void tst_qmlmetatype::listAt() +{ + QCOMPARE(QmlMetaType::listAt(QVariant(), 0), QVariant()); + QCOMPARE(QmlMetaType::listAt(QVariant(10), 0), QVariant()); + QCOMPARE(QmlMetaType::listAt(QVariant(), 10), QVariant()); + QCOMPARE(QmlMetaType::listAt(QVariant(10), 10), QVariant()); + QCOMPARE(QmlMetaType::listAt(QVariant(), -10), QVariant()); + QCOMPARE(QmlMetaType::listAt(QVariant(10), -10), QVariant()); + + QList list; + QVariant listVar = QVariant::fromValue(&list); + QmlConcreteList qmllist; + QVariant qmllistVar = QVariant::fromValue((QmlList*)&qmllist); + + QCOMPARE(QmlMetaType::listAt(listVar, 0), QVariant()); + QCOMPARE(QmlMetaType::listAt(listVar, 2), QVariant()); + QCOMPARE(QmlMetaType::listAt(listVar, -1), QVariant()); + + QCOMPARE(QmlMetaType::listAt(qmllistVar, 0), QVariant()); + QCOMPARE(QmlMetaType::listAt(qmllistVar, 2), QVariant()); + QCOMPARE(QmlMetaType::listAt(qmllistVar, -1), QVariant()); + + TestType ttype; + QVariant ttypeVar = QVariant::fromValue(&ttype); + QVariant nullttypeVar = QVariant::fromValue((TestType *)0); + + list.append(0); list.append(&ttype); list.append(0); + qmllist.append(0); qmllist.append(&ttype); qmllist.append(0); + + QCOMPARE(QmlMetaType::listAt(listVar, 0), nullttypeVar); + QCOMPARE(QmlMetaType::listAt(listVar, 1), ttypeVar); + QCOMPARE(QmlMetaType::listAt(listVar, -1), QVariant()); + + QCOMPARE(QmlMetaType::listAt(qmllistVar, 0), QVariant()); + QCOMPARE(QmlMetaType::listAt(qmllistVar, 2), QVariant()); + QCOMPARE(QmlMetaType::listAt(qmllistVar, -1), QVariant()); +} + +void tst_qmlmetatype::defaultObject() +{ + QVERIFY(QmlMetaType::defaultProperty(&QObject::staticMetaObject).name() == 0); + QVERIFY(QmlMetaType::defaultProperty(&ParserStatusTestType::staticMetaObject).name() == 0); + QCOMPARE(QString(QmlMetaType::defaultProperty(&TestType::staticMetaObject).name()), QString("foo")); + + QObject o; + TestType t; + ParserStatusTestType p; + + QVERIFY(QmlMetaType::defaultProperty((QObject *)0).name() == 0); + QVERIFY(QmlMetaType::defaultProperty(&o).name() == 0); + QVERIFY(QmlMetaType::defaultProperty(&p).name() == 0); + QCOMPARE(QString(QmlMetaType::defaultProperty(&t).name()), QString("foo")); } QTEST_MAIN(tst_qmlmetatype) -- cgit v0.12 From 39b3fcba96d6f9d7d7b96d3c875ef569a3083898 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 5 Nov 2009 20:16:25 +1000 Subject: QmlError test --- tests/auto/declarative/declarative.pro | 1 + tests/auto/declarative/qmlerror/qmlerror.pro | 6 + tests/auto/declarative/qmlerror/test.txt | 3 + tests/auto/declarative/qmlerror/tst_qmlerror.cpp | 242 +++++++++++++++++++++++ 4 files changed, 252 insertions(+) create mode 100644 tests/auto/declarative/qmlerror/qmlerror.pro create mode 100644 tests/auto/declarative/qmlerror/test.txt create mode 100644 tests/auto/declarative/qmlerror/tst_qmlerror.cpp diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 02d5a55..716d278 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -19,6 +19,7 @@ SUBDIRS += \ qmlcontext \ # Cover qmldom \ # Cover qmlecmascript \ # Cover + qmlerror \ # Cover qmlfontloader \ # Cover qmlgraphicsborderimage \ # Cover qmlgraphicsparticles \ # Cover diff --git a/tests/auto/declarative/qmlerror/qmlerror.pro b/tests/auto/declarative/qmlerror/qmlerror.pro new file mode 100644 index 0000000..fa9b79e --- /dev/null +++ b/tests/auto/declarative/qmlerror/qmlerror.pro @@ -0,0 +1,6 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative +SOURCES += tst_qmlerror.cpp +macx:CONFIG -= app_bundle + +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qmlerror/test.txt b/tests/auto/declarative/qmlerror/test.txt new file mode 100644 index 0000000..cdafd9e --- /dev/null +++ b/tests/auto/declarative/qmlerror/test.txt @@ -0,0 +1,3 @@ +Line Content +Line2 Content +Line3 Content diff --git a/tests/auto/declarative/qmlerror/tst_qmlerror.cpp b/tests/auto/declarative/qmlerror/tst_qmlerror.cpp new file mode 100644 index 0000000..70fef1d --- /dev/null +++ b/tests/auto/declarative/qmlerror/tst_qmlerror.cpp @@ -0,0 +1,242 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include + +class tst_qmlerror : public QObject +{ + Q_OBJECT +private slots: + void url(); + void description(); + void line(); + void column(); + void toString(); + + void copy(); + void debug(); +}; + +void tst_qmlerror::url() +{ + QmlError error; + + QCOMPARE(error.url(), QUrl()); + + error.setUrl(QUrl("http://www.nokia.com/main.qml")); + + QCOMPARE(error.url(), QUrl("http://www.nokia.com/main.qml")); + + QmlError error2 = error; + + QCOMPARE(error2.url(), QUrl("http://www.nokia.com/main.qml")); + + error.setUrl(QUrl("http://qt.nokia.com/main.qml")); + + QCOMPARE(error.url(), QUrl("http://qt.nokia.com/main.qml")); + QCOMPARE(error2.url(), QUrl("http://www.nokia.com/main.qml")); +} + +void tst_qmlerror::description() +{ + QmlError error; + + QCOMPARE(error.description(), QString()); + + error.setDescription("An Error"); + + QCOMPARE(error.description(), QString("An Error")); + + QmlError error2 = error; + + QCOMPARE(error2.description(), QString("An Error")); + + error.setDescription("Another Error"); + + QCOMPARE(error.description(), QString("Another Error")); + QCOMPARE(error2.description(), QString("An Error")); +} + +void tst_qmlerror::line() +{ + QmlError error; + + QCOMPARE(error.line(), -1); + + error.setLine(102); + + QCOMPARE(error.line(), 102); + + QmlError error2 = error; + + QCOMPARE(error2.line(), 102); + + error.setLine(4); + + QCOMPARE(error.line(), 4); + QCOMPARE(error2.line(), 102); +} + +void tst_qmlerror::column() +{ + QmlError error; + + QCOMPARE(error.column(), -1); + + error.setColumn(16); + + QCOMPARE(error.column(), 16); + + QmlError error2 = error; + + QCOMPARE(error2.column(), 16); + + error.setColumn(3); + + QCOMPARE(error.column(), 3); + QCOMPARE(error2.column(), 16); +} + +void tst_qmlerror::toString() +{ + { + QmlError error; + error.setUrl(QUrl("http://www.nokia.com/main.qml")); + error.setDescription("An Error"); + error.setLine(92); + error.setColumn(13); + + QCOMPARE(error.toString(), QString("http://www.nokia.com/main.qml:92:13: An Error")); + } + + { + QmlError error; + error.setUrl(QUrl("http://www.nokia.com/main.qml")); + error.setDescription("An Error"); + error.setLine(92); + + QCOMPARE(error.toString(), QString("http://www.nokia.com/main.qml:92: An Error")); + } +} + +void tst_qmlerror::copy() +{ + QmlError error; + error.setUrl(QUrl("http://www.nokia.com/main.qml")); + error.setDescription("An Error"); + error.setLine(92); + error.setColumn(13); + + QmlError error2(error); + QmlError error3; + error3 = error; + + error.setUrl(QUrl("http://qt.nokia.com/main.qml")); + error.setDescription("Another Error"); + error.setLine(2); + error.setColumn(33); + + QCOMPARE(error.url(), QUrl("http://qt.nokia.com/main.qml")); + QCOMPARE(error.description(), QString("Another Error")); + QCOMPARE(error.line(), 2); + QCOMPARE(error.column(), 33); + + QCOMPARE(error2.url(), QUrl("http://www.nokia.com/main.qml")); + QCOMPARE(error2.description(), QString("An Error")); + QCOMPARE(error2.line(), 92); + QCOMPARE(error2.column(), 13); + + QCOMPARE(error3.url(), QUrl("http://www.nokia.com/main.qml")); + QCOMPARE(error3.description(), QString("An Error")); + QCOMPARE(error3.line(), 92); + QCOMPARE(error3.column(), 13); + +} + +void tst_qmlerror::debug() +{ + { + QmlError error; + error.setUrl(QUrl("http://www.nokia.com/main.qml")); + error.setDescription("An Error"); + error.setLine(92); + error.setColumn(13); + + QTest::ignoreMessage(QtWarningMsg, "http://www.nokia.com/main.qml:92:13: An Error "); + qWarning() << error; + } + + { + QUrl url(QUrl::fromLocalFile(QString(SRCDIR) + "/").resolved(QUrl("test.txt"))); + QmlError error; + error.setUrl(url); + error.setDescription("An Error"); + error.setLine(2); + error.setColumn(5); + + QString out = url.toString() + ":2:5: An Error \n Line2 Content \n ^ "; + QTest::ignoreMessage(QtWarningMsg, qPrintable(out)); + + qWarning() << error; + } + + { + QUrl url(QUrl::fromLocalFile(QString(SRCDIR) + "/").resolved(QUrl("foo.txt"))); + QmlError error; + error.setUrl(url); + error.setDescription("An Error"); + error.setLine(2); + error.setColumn(5); + + QString out = url.toString() + ":2:5: An Error "; + QTest::ignoreMessage(QtWarningMsg, qPrintable(out)); + + qWarning() << error; + } +} + + + +QTEST_MAIN(tst_qmlerror) + +#include "tst_qmlerror.moc" -- cgit v0.12 From 4328004a78fedc33c09e352c2e7f7f9958952a16 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Thu, 5 Nov 2009 14:09:16 +0100 Subject: qdoc3: Fixed a linking problem for qml methods. Note the Invalid Syntax errors for some uses of \qmlmethod and \qmlsignal. A syntactically correct signature is now required as the argument. --- tools/qdoc3/cppcodemarker.cpp | 8 ++-- tools/qdoc3/cppcodeparser.cpp | 70 ++++++++++++++++++++++++-------- tools/qdoc3/cppcodeparser.h | 14 ++++++- tools/qdoc3/htmlgenerator.cpp | 4 +- tools/qdoc3/node.cpp | 92 ++++++++++++++++++++++++++++++------------- tools/qdoc3/node.h | 39 +++++------------- tools/qdoc3/tree.cpp | 13 +++--- 7 files changed, 152 insertions(+), 88 deletions(-) diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp index c07be8b..f3188bd 100644 --- a/tools/qdoc3/cppcodemarker.cpp +++ b/tools/qdoc3/cppcodemarker.cpp @@ -1154,14 +1154,14 @@ QList
CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, } } else if ((*c)->type() == Node::QmlSignal) { - const QmlSignalNode* sn = static_cast(*c); + const FunctionNode* sn = static_cast(*c); if (sn->isAttached()) insert(qmlattachedsignals,*c,style,Okay); else insert(qmlsignals,*c,style,Okay); } else if ((*c)->type() == Node::QmlMethod) { - const QmlMethodNode* mn = static_cast(*c); + const FunctionNode* mn = static_cast(*c); if (mn->isAttached()) insert(qmlattachedmethods,*c,style,Okay); else @@ -1193,14 +1193,14 @@ QList
CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, insert(qmlproperties,*c,style,Okay); } else if ((*c)->type() == Node::QmlSignal) { - const QmlSignalNode* sn = static_cast(*c); + const FunctionNode* sn = static_cast(*c); if (sn->isAttached()) insert(qmlattachedsignals,*c,style,Okay); else insert(qmlsignals,*c,style,Okay); } else if ((*c)->type() == Node::QmlMethod) { - const QmlMethodNode* mn = static_cast(*c); + const FunctionNode* mn = static_cast(*c); if (mn->isAttached()) insert(qmlattachedmethods,*c,style,Okay); else diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index cabbe38..90d83ca 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -693,13 +693,13 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc, if (n && n->subType() == Node::QmlClass) { qmlClass = static_cast(n); if (command == COMMAND_QMLSIGNAL) - return new QmlSignalNode(qmlClass,name,false); + return makeFunctionNode(doc,arg,qmlClass,Node::QmlSignal,false,COMMAND_QMLSIGNAL); else if (command == COMMAND_QMLATTACHEDSIGNAL) - return new QmlSignalNode(qmlClass,name,true); + return makeFunctionNode(doc,arg,qmlClass,Node::QmlSignal,true,COMMAND_QMLATTACHEDSIGNAL); else if (command == COMMAND_QMLMETHOD) - return new QmlMethodNode(qmlClass,name,false); + return makeFunctionNode(doc,arg,qmlClass,Node::QmlMethod,false,COMMAND_QMLMETHOD); else if (command == COMMAND_QMLATTACHEDMETHOD) - return new QmlMethodNode(qmlClass,name,true); + return makeFunctionNode(doc,arg,qmlClass,Node::QmlMethod,true,COMMAND_QMLATTACHEDMETHOD); else return 0; // never get here. } @@ -1265,7 +1265,9 @@ bool CppCodeParser::matchParameter(FunctionNode *func) bool CppCodeParser::matchFunctionDecl(InnerNode *parent, QStringList *parentPathPtr, FunctionNode **funcPtr, - const QString &templateStuff) + const QString &templateStuff, + Node::Type type, + bool attached) { CodeChunk returnType; QStringList parentPath; @@ -1295,8 +1297,9 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, if (tokenizer->parsingFnOrMacro() && (match(Tok_Q_DECLARE_FLAGS) || match(Tok_Q_PROPERTY))) returnType = CodeChunk(previousLexeme()); - else + else { return false; + } } if (returnType.toString() == "QBool") @@ -1326,8 +1329,9 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, readToken(); } } - if (tok != Tok_LeftParen) + if (tok != Tok_LeftParen) { return false; + } } else if (tok == Tok_LeftParen) { // constructor or destructor @@ -1373,8 +1377,9 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, returnType.append(lexeme()); readToken(); } - if (tok != Tok_Semicolon) + if (tok != Tok_Semicolon) { return false; + } } else if (tok == Tok_Colon) { returnType.appendHotspot(); @@ -1383,8 +1388,9 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, returnType.append(lexeme()); readToken(); } - if (tok != Tok_Semicolon) + if (tok != Tok_Semicolon) { return false; + } } VariableNode *var = new VariableNode(parent, name); @@ -1397,12 +1403,13 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, var->setStatic(sta); return false; } - if (tok != Tok_LeftParen) + if (tok != Tok_LeftParen) { return false; + } } readToken(); - FunctionNode *func = new FunctionNode(parent, name); + FunctionNode *func = new FunctionNode(type, parent, name, attached); func->setAccess(access); func->setLocation(location()); func->setReturnType(returnType.toString()); @@ -1423,12 +1430,14 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, if (tok != Tok_RightParen) { do { - if (!matchParameter(func)) + if (!matchParameter(func)) { return false; + } } while (match(Tok_Comma)); } - if (!match(Tok_RightParen)) + if (!match(Tok_RightParen)) { return false; + } func->setConst(match(Tok_const)); @@ -1444,8 +1453,9 @@ bool CppCodeParser::matchFunctionDecl(InnerNode *parent, if (!match(Tok_Semicolon) && tok != Tok_Eoi) { int braceDepth0 = tokenizer->braceDepth(); - if (!match(Tok_LeftBrace)) + if (!match(Tok_LeftBrace)) { return false; + } while (tokenizer->braceDepth() >= braceDepth0 && tok != Tok_Eoi) readToken(); match(Tok_RightBrace); @@ -2092,7 +2102,9 @@ bool CppCodeParser::matchDocsAndStuff() bool CppCodeParser::makeFunctionNode(const QString& synopsis, QStringList *parentPathPtr, FunctionNode **funcPtr, - InnerNode *root) + InnerNode *root, + Node::Type type, + bool attached) { Tokenizer *outerTokenizer = tokenizer; int outerTok = tok; @@ -2104,15 +2116,39 @@ bool CppCodeParser::makeFunctionNode(const QString& synopsis, tokenizer = &stringTokenizer; readToken(); - bool ok = matchFunctionDecl(root, parentPathPtr, funcPtr); + bool ok = matchFunctionDecl(root, parentPathPtr, funcPtr, QString(), type, attached); // potential memory leak with funcPtr tokenizer = outerTokenizer; tok = outerTok; - return ok; } +/*! + Create a new FunctionNode for a QML method or signal, as + specified by \a type, as a child of \a parent. \a sig is + the complete signature, and if \a attached is true, the + method or signal is "attached". \a qdoctag is the text of + the \a type. + */ +FunctionNode* CppCodeParser::makeFunctionNode(const Doc& doc, + const QString& sig, + InnerNode* parent, + Node::Type type, + bool attached, + QString qdoctag) +{ + QStringList pp; + FunctionNode* fn = 0; + if (!makeFunctionNode(sig,&pp,&fn,parent,type,attached) && + !makeFunctionNode("void "+sig,&pp,&fn,parent,type,attached)) { + doc.location().warning(tr("Invalid syntax in '\\%1'").arg(qdoctag)); + } + if (fn) + return fn; + return 0; +} + void CppCodeParser::parseQiteratorDotH(const Location &location, const QString &filePath) { diff --git a/tools/qdoc3/cppcodeparser.h b/tools/qdoc3/cppcodeparser.h index 233ac09..87c1b69 100644 --- a/tools/qdoc3/cppcodeparser.h +++ b/tools/qdoc3/cppcodeparser.h @@ -127,7 +127,9 @@ class CppCodeParser : public CodeParser bool matchFunctionDecl(InnerNode *parent, QStringList *parentPathPtr = 0, FunctionNode **funcPtr = 0, - const QString &templateStuff = QString()); + const QString &templateStuff = QString(), + Node::Type type = Node::Function, + bool attached = false); bool matchBaseSpecifier(ClassNode *classe, bool isClass); bool matchBaseList(ClassNode *classe, bool isClass); bool matchClassDecl(InnerNode *parent, @@ -143,7 +145,15 @@ class CppCodeParser : public CodeParser bool makeFunctionNode(const QString &synopsis, QStringList *parentPathPtr, FunctionNode **funcPtr, - InnerNode *root = 0); + InnerNode *root = 0, + Node::Type type = Node::Function, + bool attached = false); + FunctionNode* makeFunctionNode(const Doc& doc, + const QString& sig, + InnerNode* parent, + Node::Type type, + bool attached, + QString qdoctag); void parseQiteratorDotH(const Location &location, const QString &filePath); void instantiateIteratorMacro(const QString &container, const QString &includeFile, diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index afd1e74..ae47fc0 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -4219,7 +4219,7 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, out() << ""; } else if (node->type() == Node::QmlSignal) { - const QmlSignalNode* qsn = static_cast(node); + const FunctionNode* qsn = static_cast(node); out() << "
"; out() << ""; out() << "
"; @@ -4230,7 +4230,7 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, out() << ""; } else if (node->type() == Node::QmlMethod) { - const QmlMethodNode* qmn = static_cast(node); + const FunctionNode* qmn = static_cast(node); out() << "
"; out() << ""; out() << "
"; diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index ecb4a44..1217042 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -218,6 +218,7 @@ Node *InnerNode::findNode(const QString& name, Type type) } /*! + Find the function node in this node for the function named \a name. */ FunctionNode *InnerNode::findFunctionNode(const QString& name) { @@ -225,6 +226,7 @@ FunctionNode *InnerNode::findFunctionNode(const QString& name) } /*! + Find the function node in this node that has the same name as \a clone. */ FunctionNode *InnerNode::findFunctionNode(const FunctionNode *clone) { @@ -248,6 +250,34 @@ FunctionNode *InnerNode::findFunctionNode(const FunctionNode *clone) } /*! + Returns the list of keys from the primary function map. + */ +QStringList InnerNode::primaryKeys() +{ + QStringList t; + QMap::iterator i = primaryFunctionMap.begin(); + while (i != primaryFunctionMap.end()) { + t.append(i.key()); + ++i; + } + return t; +} + +/*! + Returns the list of keys from the secondary function map. + */ +QStringList InnerNode::secondaryKeys() +{ + QStringList t; + QMap::iterator i = secondaryFunctionMap.begin(); + while (i != secondaryFunctionMap.end()) { + t.append(i.key()); + ++i; + } + return t; +} + +/*! */ void InnerNode::setOverload(const FunctionNode *func, bool overlode) { @@ -392,6 +422,7 @@ const Node *InnerNode::findNode(const QString& name, Type type) const } /*! + Find the function node in this node that has the given \a name. */ const FunctionNode *InnerNode::findFunctionNode(const QString& name) const { @@ -400,9 +431,9 @@ const FunctionNode *InnerNode::findFunctionNode(const QString& name) const } /*! + Find the function node in this node that has the same name as \a clone. */ -const FunctionNode *InnerNode::findFunctionNode( - const FunctionNode *clone) const +const FunctionNode *InnerNode::findFunctionNode(const FunctionNode *clone) const { InnerNode *that = (InnerNode *) this; return that->findFunctionNode(clone); @@ -520,7 +551,7 @@ bool InnerNode::isSameSignature(const FunctionNode *f1, const FunctionNode *f2) void InnerNode::addChild(Node *child) { children.append(child); - if (child->type() == Function) { + if ((child->type() == Function) || (child->type() == QmlMethod)) { FunctionNode *func = (FunctionNode *) child; if (!primaryFunctionMap.contains(func->name())) { primaryFunctionMap.insert(func->name(), func); @@ -896,11 +927,40 @@ QString Parameter::reconstruct(bool value) const */ /*! + Construct a function node for a C++ function. It's parent + is \a parent, and it's name is \a name. */ FunctionNode::FunctionNode(InnerNode *parent, const QString& name) - : LeafNode(Function, parent, name), met(Plain), vir(NonVirtual), - con(false), sta(false), ove(false), rf(0), ap(0) + : LeafNode(Function, parent, name), + met(Plain), + vir(NonVirtual), + con(false), + sta(false), + ove(false), + att(false), + rf(0), + ap(0) +{ + // nothing. +} + +/*! + Construct a function node for a QML method or signal, specified + by \a type. It's parent is \a parent, and it's name is \a name. + If \a attached is true, it is an attached method or signal. + */ +FunctionNode::FunctionNode(Type type, InnerNode *parent, const QString& name, bool attached) + : LeafNode(type, parent, name), + met(Plain), + vir(NonVirtual), + con(false), + sta(false), + ove(false), + att(attached), + rf(0), + ap(0) { + // nothing. } /*! @@ -1208,28 +1268,6 @@ bool QmlPropertyNode::fromTrool(Trool troolean, bool defaultValue) return defaultValue; } } - -/*! - Constructor for the QML signal node. - */ -QmlSignalNode::QmlSignalNode(QmlClassNode *parent, - const QString& name, - bool attached) - : LeafNode(QmlSignal, parent, name), att(attached) -{ - // nothing. -} - -/*! - Constructor for the QML method node. - */ -QmlMethodNode::QmlMethodNode(QmlClassNode *parent, - const QString& name, - bool attached) - : LeafNode(QmlMethod, parent, name), att(attached) -{ - // nothing. -} #endif QT_END_NAMESPACE diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index 5712879..3f5be6c 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -151,6 +151,7 @@ class Node virtual bool isInnerNode() const = 0; virtual bool isReimp() const { return false; } + virtual bool isFunction() const { return false; } Type type() const { return typ; } virtual SubType subType() const { return NoSubType; } InnerNode *parent() const { return par; } @@ -239,6 +240,9 @@ class InnerNode : public Node NodeList overloads(const QString &funcName) const; const QStringList& includes() const { return inc; } + QStringList primaryKeys(); + QStringList secondaryKeys(); + protected: InnerNode(Type type, InnerNode *parent, const QString& name); @@ -421,36 +425,6 @@ class QmlPropertyNode : public LeafNode Trool wri; bool att; }; - -class QmlSignalNode : public LeafNode -{ - public: - QmlSignalNode(QmlClassNode* parent, - const QString& name, - bool attached); - virtual ~QmlSignalNode() { } - - const QString& element() const { return parent()->name(); } - bool isAttached() const { return att; } - - private: - bool att; -}; - -class QmlMethodNode : public LeafNode -{ - public: - QmlMethodNode(QmlClassNode* parent, - const QString& name, - bool attached); - virtual ~QmlMethodNode() { } - - const QString& element() const { return parent()->name(); } - bool isAttached() const { return att; } - - private: - bool att; -}; #endif class EnumItem @@ -564,6 +538,7 @@ class FunctionNode : public LeafNode enum Virtualness { NonVirtual, ImpureVirtual, PureVirtual }; FunctionNode(InnerNode *parent, const QString &name); + FunctionNode(Type type, InnerNode *parent, const QString &name, bool attached); virtual ~FunctionNode() { } void setReturnType(const QString& returnType) { rt = returnType; } @@ -589,6 +564,7 @@ class FunctionNode : public LeafNode bool isStatic() const { return sta; } bool isOverload() const { return ove; } bool isReimp() const { return reimp; } + bool isFunction() const { return true; } int overloadNumber() const; int numOverloads() const; const QList& parameters() const { return params; } @@ -600,6 +576,8 @@ class FunctionNode : public LeafNode QStringList reconstructParams(bool values = false) const; QString signature(bool values = false) const; + const QString& element() const { return parent()->name(); } + bool isAttached() const { return att; } private: void setAssociatedProperty(PropertyNode *property); @@ -620,6 +598,7 @@ class FunctionNode : public LeafNode bool sta : 1; bool ove : 1; bool reimp: 1; + bool att: 1; QList params; const FunctionNode *rf; const PropertyNode *ap; diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp index bcd9709..4d401de 100644 --- a/tools/qdoc3/tree.cpp +++ b/tools/qdoc3/tree.cpp @@ -225,6 +225,7 @@ const FunctionNode *Tree::findFunctionNode(const QStringList &path, { if (!relative) relative = root(); + do { const Node *node = relative; int i; @@ -244,8 +245,7 @@ const FunctionNode *Tree::findFunctionNode(const QStringList &path, NodeList baseClasses = allBaseClasses(static_cast(node)); foreach (const Node *baseClass, baseClasses) { if (i == path.size() - 1) - next = static_cast(baseClass)-> - findFunctionNode(path.at(i)); + next = static_cast(baseClass)->findFunctionNode(path.at(i)); else next = static_cast(baseClass)->findNode(path.at(i)); @@ -256,11 +256,10 @@ const FunctionNode *Tree::findFunctionNode(const QStringList &path, node = next; } - if (node && i == path.size() && node->type() == Node::Function) { + if (node && i == path.size() && node->isFunction()) { // CppCodeParser::processOtherMetaCommand ensures that reimplemented // functions are private. const FunctionNode *func = static_cast(node); - while (func->access() == Node::Private) { const FunctionNode *from = func->reimplementedFrom(); if (from != 0) { @@ -268,7 +267,8 @@ const FunctionNode *Tree::findFunctionNode(const QStringList &path, return from; else func = from; - } else + } + else break; } return func; @@ -303,7 +303,8 @@ const FunctionNode *Tree::findFunctionNode(const QStringList &parentPath, const Node *parent = findNode(parentPath, relative, findFlags); if (parent == 0 || !parent->isInnerNode()) { return 0; - } else { + } + else { return ((InnerNode *)parent)->findFunctionNode(clone); } } -- cgit v0.12 From 96f3abd4df881789bd2677100a2417c96fd2edb4 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 6 Nov 2009 08:36:53 +1000 Subject: fix javascript errors in samegame tutorials --- .../tutorials/samegame/samegame2/samegame.js | 6 +- .../tutorials/samegame/samegame3/samegame.js | 10 +- .../samegame/samegame4/content/samegame.js | 103 ++++++++++++++------- .../tutorials/samegame/samegame4/samegame.qml | 40 ++++---- 4 files changed, 102 insertions(+), 57 deletions(-) diff --git a/examples/declarative/tutorials/samegame/samegame2/samegame.js b/examples/declarative/tutorials/samegame/samegame2/samegame.js index 2bf68b5..2c02c61 100644 --- a/examples/declarative/tutorials/samegame/samegame2/samegame.js +++ b/examples/declarative/tutorials/samegame/samegame2/samegame.js @@ -22,8 +22,8 @@ function initBoard() //Initialize Board board = new Array(maxIndex); - for(xIdx=0; xIdx=0; yIdx--){ if(board[index(xIdx,yIdx)] == null){ diff --git a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js index ce9c169..58de55f 100755 --- a/examples/declarative/tutorials/samegame/samegame4/content/samegame.js +++ b/examples/declarative/tutorials/samegame/samegame4/content/samegame.js @@ -1,14 +1,14 @@ /* This script file handles the game logic */ //Note that X/Y referred to here are in game coordinates -var maxX = 10;//Nums are for tileSize 40 +var maxX = 10;//Nums are for gameCanvas.tileSize 40 var maxY = 15; -var tileSize = 40; var maxIndex = maxX*maxY; var board = new Array(maxIndex); var tileSrc = "content/BoomBlock.qml"; var scoresURL = "http://qtfx-nokia.trolltech.com.au/samegame/scores.php"; +var scoresURL = ""; var timer; -var component; +var component = createComponent(tileSrc); //Index function used instead of a 2D array function index(xIdx,yIdx) { @@ -22,33 +22,41 @@ function timeStr(msecs) { return ret; } +function getTileSize() +{ + return tileSize; +} + function initBoard() { - for(i = 0; i= maxX || xIdx < 0 || yIdx >= maxY || yIdx < 0) return; if(board[index(xIdx, yIdx)] == null) @@ -103,15 +111,15 @@ function floodFill(xIdx,yIdx,type) function shuffleDown() { //Fall down - for(xIdx=0; xIdx=0; yIdx--){ + for(var xIdx=0; xIdx=0; yIdx--){ if(board[index(xIdx,yIdx)] == null){ fallDist += 1; }else{ if(fallDist > 0){ - obj = board[index(xIdx,yIdx)]; - obj.targetY += fallDist * tileSize; + var obj = board[index(xIdx,yIdx)]; + obj.targetY += fallDist * gameCanvas.tileSize; board[index(xIdx,yIdx+fallDist)] = obj; board[index(xIdx,yIdx)] = null; } @@ -129,7 +137,7 @@ function shuffleDown() obj = board[index(xIdx,yIdx)]; if(obj == null) continue; - obj.targetX -= fallDist * tileSize; + obj.targetX -= fallDist * gameCanvas.tileSize; board[index(xIdx-fallDist,yIdx)] = obj; board[index(xIdx,yIdx)] = null; } @@ -141,8 +149,8 @@ function shuffleDown() function victoryCheck() { //awards bonuses for no tiles left - deservesBonus = true; - for(xIdx=maxX-1; xIdx>=0; xIdx--) + var deservesBonus = true; + for(var xIdx=maxX-1; xIdx>=0; xIdx--) if(board[index(xIdx, maxY - 1)] != null) deservesBonus = false; if(deservesBonus) @@ -150,10 +158,8 @@ function victoryCheck() //Checks for game over if(deservesBonus || !(floodMoveCheck(0,maxY-1, -1))){ timer = new Date() - timer; - if(scoresURL != "") - scoreName.show("You've won! Please enter your name: "); - else - dialog.show("Game Over. Your score is " + gameCanvas.score); + scoreName.show("You won! Please enter your name: "); + //dialog.show("Game Over. Your score is " + gameCanvas.score); } } @@ -164,7 +170,7 @@ function floodMoveCheck(xIdx, yIdx, type) return false; if(board[index(xIdx, yIdx)] == null) return false; - myType = board[index(xIdx, yIdx)].type; + var myType = board[index(xIdx, yIdx)].type; if(type == myType) return true; return floodMoveCheck(xIdx + 1, yIdx, myType) || @@ -172,15 +178,12 @@ function floodMoveCheck(xIdx, yIdx, type) } function createBlock(xIdx,yIdx){ - if(component==null) - component = createComponent(tileSrc); - // Note that we don't wait for the component to become ready. This will // only work if the block QML is a local file. Otherwise the component will // not be ready immediately. There is a statusChanged signal on the // component you could use if you want to wait to load remote files. if(component.isReady){ - dynamicObject = component.createObject(); + var dynamicObject = component.createObject(); if(dynamicObject == null){ print("error creating block"); print(component.errorsString()); @@ -188,11 +191,11 @@ function createBlock(xIdx,yIdx){ } dynamicObject.type = Math.floor(Math.random() * 3); dynamicObject.parent = gameCanvas; - dynamicObject.x = xIdx*tileSize; - dynamicObject.targetX = xIdx*tileSize; - dynamicObject.targetY = yIdx*tileSize; - dynamicObject.width = tileSize; - dynamicObject.height = tileSize; + dynamicObject.x = xIdx*gameCanvas.tileSize; + dynamicObject.targetX = xIdx*gameCanvas.tileSize; + dynamicObject.targetY = yIdx*gameCanvas.tileSize; + dynamicObject.width = gameCanvas.tileSize; + dynamicObject.height = gameCanvas.tileSize; dynamicObject.spawned = true; board[index(xIdx,yIdx)] = dynamicObject; }else{//isError or isLoading @@ -203,6 +206,42 @@ function createBlock(xIdx,yIdx){ return true; } +function saveHighScore(name) { + if(scoresURL!="") + sendHighScore(name); + //OfflineStorage + var db = openDatabase("SameGameScores", "1.0", "Local SameGame High Scores",100); + var dataStr = "INSERT INTO Scores VALUES(?, ?, ?, ?)"; + var data = [name, gameCanvas.score, maxX+"x"+maxY ,Math.floor(timer/1000)]; + db.transaction( + function(tx) { + tx.executeSql('CREATE TABLE IF NOT EXISTS Scores(name TEXT, score NUMBER, gridSize TEXT, time NUMBER)',[]); + tx.executeSql(dataStr, data); + + tx.executeSql('SELECT * FROM Scores WHERE gridSize = "12x17" ORDER BY score desc LIMIT 10',[], + function(tx, rs) { + var r = "\nHIGH SCORES for a standard sized grid\n\n" + for(var i = 0; i < rs.rows.length; i++){ + r += (i+1)+". " + rs.rows.item(i).name +' got ' + + rs.rows.item(i).score + ' points in ' + + rs.rows.item(i).time + ' seconds.\n'; + } + dialog.show(r); + }, + function(tx, error) { + print("ERROR:", error.message); + } + ); + }, + function() { + print("ERROR in transaction"); + }, + function() { + //print("Transaction successful"); + } + ); +} + //![1] function sendHighScore(name) { var postman = new XMLHttpRequest() diff --git a/examples/declarative/tutorials/samegame/samegame4/samegame.qml b/examples/declarative/tutorials/samegame/samegame4/samegame.qml index 89dc945..19b929f 100644 --- a/examples/declarative/tutorials/samegame/samegame4/samegame.qml +++ b/examples/declarative/tutorials/samegame/samegame4/samegame.qml @@ -2,15 +2,13 @@ import Qt 4.6 import "content" Rectangle { - id: Screen + id: screen width: 490; height: 720 - Script { source: "content/samegame.js" } - SystemPalette { id: activePalette } Item { - width: parent.width; anchors.top: parent.top; anchors.bottom: ToolBar.top + width: parent.width; anchors.top: parent.top; anchors.bottom: toolBar.top Image { id: background @@ -21,10 +19,13 @@ Rectangle { Item { id: gameCanvas property int score: 0 + property int tileSize: 40 + + Script { source: "content/samegame.js" } z: 20; anchors.centerIn: parent - width: parent.width - (parent.width % tileSize); - height: parent.height - (parent.height % tileSize); + width: parent.width - (parent.width % getTileSize()); + height: parent.height - (parent.height % getTileSize()); MouseRegion { id: gameMR @@ -34,26 +35,31 @@ Rectangle { } Dialog { id: dialog; anchors.centerIn: parent; z: 21 } - Dialog { - id: scoreName; anchors.centerIn: parent; z: 22; + Dialog { + id: scoreName; anchors.centerIn: parent; z: 22; + Text { + id: spacer + opacity: 0 + text: " You won! Please enter your name:" + } TextInput { - id: Editor - onAccepted: { - if(scoreName.opacity==1&&Editor.text!="") - sendHighScore(Editor.text); - scoreName.forceClose(); + id: editor + onAccepted: { + if(scoreName.opacity==1&&editor.text!="") + saveHighScore(editor.text); + scoreName.forceClose(); } anchors.verticalCenter: parent.verticalCenter width: 72; focus: true - anchors.right: scoreName.right + anchors.left: spacer.right } } Rectangle { - id: ToolBar + id: toolBar color: activePalette.window height: 32; width: parent.width - anchors.bottom: Screen.bottom + anchors.bottom: screen.bottom Button { id: btnA; text: "New Game"; onClicked: {initBoard();} @@ -62,7 +68,7 @@ Rectangle { } Text { - id: Score + id: score text: "Score: " + gameCanvas.score; font.bold: true anchors.right: parent.right; anchors.rightMargin: 3 anchors.verticalCenter: parent.verticalCenter -- cgit v0.12 From ec543f79c7d036961eb6cdcd956b3e8ca28b8e54 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 6 Nov 2009 08:49:00 +1000 Subject: Fix possible crash when overriding a signal handler. --- src/declarative/qml/qmlboundsignal.cpp | 2 +- src/declarative/util/qmlpropertychanges.cpp | 4 ++-- .../declarative/states/data/signalOverrideCrash.qml | 15 +++++++++++++++ tests/auto/declarative/states/tst_states.cpp | 18 ++++++++++++++++++ 4 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 tests/auto/declarative/states/data/signalOverrideCrash.qml diff --git a/src/declarative/qml/qmlboundsignal.cpp b/src/declarative/qml/qmlboundsignal.cpp index def11c3..deb15dc 100644 --- a/src/declarative/qml/qmlboundsignal.cpp +++ b/src/declarative/qml/qmlboundsignal.cpp @@ -177,7 +177,7 @@ int QmlBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a) if (m_params) m_params->setValues(a); if (m_expression) { QmlExpressionPrivate::get(m_expression)->value(m_params); - if (m_expression->hasError()) + if (m_expression && m_expression->hasError()) qWarning().nospace() << qPrintable(m_expression->error().toString()); } if (m_params) m_params->clearValues(); diff --git a/src/declarative/util/qmlpropertychanges.cpp b/src/declarative/util/qmlpropertychanges.cpp index 3cc6ca9..3aa3678 100644 --- a/src/declarative/util/qmlpropertychanges.cpp +++ b/src/declarative/util/qmlpropertychanges.cpp @@ -232,7 +232,7 @@ void QmlPropertyChangesPrivate::decode() ds >> data; QmlMetaProperty prop = property(name); //### better way to check for signal property? - if (prop.type() == QmlMetaProperty::SignalProperty) { + if (prop.type() & QmlMetaProperty::SignalProperty) { QmlExpression *expression = new QmlExpression(qmlContext(q), data.toString(), object); expression->setTrackChange(false); QmlReplaceSignalHandler *handler = new QmlReplaceSignalHandler; @@ -307,7 +307,7 @@ QmlPropertyChangesPrivate::property(const QByteArray &property) if (!prop.isValid()) { qmlInfo(QmlPropertyChanges::tr("Cannot assign to non-existant property \"%1\"").arg(QString::fromUtf8(property)), q); return QmlMetaProperty(); - } else if (prop.type() != QmlMetaProperty::SignalProperty && !prop.isWritable()) { + } else if (!(prop.type() & QmlMetaProperty::SignalProperty) && !prop.isWritable()) { qmlInfo(QmlPropertyChanges::tr("Cannot assign to read-only property \"%1\"").arg(QString::fromUtf8(property)), q); return QmlMetaProperty(); } diff --git a/tests/auto/declarative/states/data/signalOverrideCrash.qml b/tests/auto/declarative/states/data/signalOverrideCrash.qml new file mode 100644 index 0000000..702fa86 --- /dev/null +++ b/tests/auto/declarative/states/data/signalOverrideCrash.qml @@ -0,0 +1,15 @@ +import Qt 4.6 +import Qt.test 1.0 + +MyRectangle { + id: rect + + width: 100; height: 100 + states: State { + name: "overridden" + PropertyChanges { + target: rect + onDidSomething: rect.state = "" + } + } +} diff --git a/tests/auto/declarative/states/tst_states.cpp b/tests/auto/declarative/states/tst_states.cpp index f67c737..d6df37e 100644 --- a/tests/auto/declarative/states/tst_states.cpp +++ b/tests/auto/declarative/states/tst_states.cpp @@ -54,6 +54,7 @@ private slots: void basicExtension(); void basicBinding(); void signalOverride(); + void signalOverrideCrash(); void parentChange(); void anchorChanges(); void script(); @@ -356,6 +357,23 @@ void tst_states::signalOverride() } } +void tst_states::signalOverrideCrash() +{ + QmlEngine engine; + + QmlComponent rectComponent(&engine, SRCDIR "/data/signalOverrideCrash.qml"); + MyRect *rect = qobject_cast(rectComponent.create()); + QVERIFY(rect != 0); + + //QCOMPARE(rect->color(),QColor("red")); + //rect->doSomething(); + //QCOMPARE(rect->color(),QColor("blue")); + + rect->setState("overridden"); + rect->doSomething(); + //QCOMPARE(rect->color(),QColor("green")); +} + void tst_states::parentChange() { QmlEngine engine; -- cgit v0.12 From 8ad965ff19490d8c38ff4562f61fa0ca5b33e3e4 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Wed, 4 Nov 2009 14:06:07 +0100 Subject: Fix to the unregistration of the animation to the global timer The unregistration has to happen befaire calling virtual methods to support changing the state in those functions. Reviewed-by: ogoffart --- src/corelib/animation/qabstractanimation.cpp | 30 ++++++++++------------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 948a084..6ab5bde 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -347,29 +347,26 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState) state = newState; QWeakPointer guard(q); - q->updateState(oldState, newState); - if (!guard) - return; + //unregistration of the animation must always happen before calls to + //virtual function (updateState) to ensure a correct state of the timer + if (oldState == QAbstractAnimation::Running) { + if (newState == QAbstractAnimation::Paused && hasRegisteredTimer) + QUnifiedTimer::instance()->ensureTimerUpdate(); + //the animation, is not running any more + QUnifiedTimer::instance()->unregisterAnimation(q); + } - //this is to be safe if updateState changes the state - if (state == oldState) + q->updateState(oldState, newState); + if (!guard || newState != state) //this is to be safe if updateState changes the state return; // Notify state change emit q->stateChanged(oldState, newState); - if (!guard) + if (!guard || newState != state) //this is to be safe if updateState changes the state return; switch (state) { case QAbstractAnimation::Paused: - if (hasRegisteredTimer) - // currentTime needs to be updated if pauseTimer is active - QUnifiedTimer::instance()->ensureTimerUpdate(); - if (!guard) - return; - //here we're sure that we were in running state before and that the - //animation is currently registered - QUnifiedTimer::instance()->unregisterAnimation(q); break; case QAbstractAnimation::Running: { @@ -389,15 +386,10 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState) case QAbstractAnimation::Stopped: // Leave running state. int dura = q->duration(); - if (!guard) - return; if (deleteWhenStopped) q->deleteLater(); - if (oldState == QAbstractAnimation::Running) - QUnifiedTimer::instance()->unregisterAnimation(q); - if (dura == -1 || loopCount < 0 || (oldDirection == QAbstractAnimation::Forward && (oldCurrentTime * (oldCurrentLoop + 1)) == (dura * loopCount)) || (oldDirection == QAbstractAnimation::Backward && oldCurrentTime == 0)) { -- cgit v0.12 From 41c740c0e3fe0edb08dea9cfabfb91c26baecee5 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Thu, 5 Nov 2009 13:48:28 +0100 Subject: Another fix for the registration of the animations --- src/corelib/animation/qabstractanimation.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 6ab5bde..94e88aa 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -347,13 +347,16 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState) state = newState; QWeakPointer guard(q); - //unregistration of the animation must always happen before calls to + //(un)registration of the animation must always happen before calls to //virtual function (updateState) to ensure a correct state of the timer + bool isTopLevel = !group || group->state() == QAbstractAnimation::Stopped; if (oldState == QAbstractAnimation::Running) { if (newState == QAbstractAnimation::Paused && hasRegisteredTimer) QUnifiedTimer::instance()->ensureTimerUpdate(); //the animation, is not running any more QUnifiedTimer::instance()->unregisterAnimation(q); + } else { + QUnifiedTimer::instance()->registerAnimation(q, isTopLevel); } q->updateState(oldState, newState); @@ -370,8 +373,6 @@ void QAbstractAnimationPrivate::setState(QAbstractAnimation::State newState) break; case QAbstractAnimation::Running: { - bool isTopLevel = !group || group->state() == QAbstractAnimation::Stopped; - QUnifiedTimer::instance()->registerAnimation(q, isTopLevel); // this ensures that the value is updated now that the animation is running if (oldState == QAbstractAnimation::Stopped) { -- cgit v0.12 From 2ba1454ff6e3468f8871d2de3afbef8f80b3da07 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 6 Nov 2009 09:14:04 +1000 Subject: Fix bad merge. --- src/corelib/animation/qabstractanimation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp index 94e88aa..5110ce8 100644 --- a/src/corelib/animation/qabstractanimation.cpp +++ b/src/corelib/animation/qabstractanimation.cpp @@ -262,11 +262,11 @@ void QUnifiedTimer::registerAnimation(QAbstractAnimation *animation, bool isTopL void QUnifiedTimer::unregisterAnimation(QAbstractAnimation *animation) { + unregisterRunningAnimation(animation); + if (!QAbstractAnimationPrivate::get(animation)->hasRegisteredTimer) return; - unregisterRunningAnimation(animation); - int idx = animations.indexOf(animation); if (idx != -1) { animations.removeAt(idx); -- cgit v0.12 From 2487c4c17e4d5016c40d7c50d7c732157a00c39c Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 6 Nov 2009 09:56:53 +1000 Subject: autotests for Binding element --- .../declarative/qmlbinding/data/test-binding.qml | 16 ++++ .../declarative/qmlbinding/data/test-binding2.qml | 16 ++++ tests/auto/declarative/qmlbinding/qmlbinding.pro | 8 ++ .../auto/declarative/qmlbinding/tst_qmlbinding.cpp | 101 +++++++++++++++++++++ 4 files changed, 141 insertions(+) create mode 100644 tests/auto/declarative/qmlbinding/data/test-binding.qml create mode 100644 tests/auto/declarative/qmlbinding/data/test-binding2.qml create mode 100644 tests/auto/declarative/qmlbinding/qmlbinding.pro create mode 100644 tests/auto/declarative/qmlbinding/tst_qmlbinding.cpp diff --git a/tests/auto/declarative/qmlbinding/data/test-binding.qml b/tests/auto/declarative/qmlbinding/data/test-binding.qml new file mode 100644 index 0000000..d2a22f5 --- /dev/null +++ b/tests/auto/declarative/qmlbinding/data/test-binding.qml @@ -0,0 +1,16 @@ +import Qt 4.6 + +Rectangle { + id: screen + width: 320; height: 240 + property string text + property bool changeColor: false + + Text { id: s1; text: "Hello" } + Rectangle { id: r1; width: 1; height: 1; color: "yellow" } + Rectangle { id: r2; width: 1; height: 1; color: "red" } + + Binding { target: screen; property: "text"; value: s1.text } + Binding { target: screen; property: "color"; value: r1.color } + Binding { target: screen; property: "color"; when: screen.changeColor == true; value: r2.color } +} diff --git a/tests/auto/declarative/qmlbinding/data/test-binding2.qml b/tests/auto/declarative/qmlbinding/data/test-binding2.qml new file mode 100644 index 0000000..ea20c16 --- /dev/null +++ b/tests/auto/declarative/qmlbinding/data/test-binding2.qml @@ -0,0 +1,16 @@ +import Qt 4.6 + +Rectangle { + id: screen + width: 320; height: 240 + property string text + property bool changeColor: false + + Text { id: s1; text: "Hello" } + Rectangle { id: r1; width: 1; height: 1; color: "yellow" } + Rectangle { id: r2; width: 1; height: 1; color: "red" } + + Binding { target: screen; property: "text"; value: s1.text } + Binding { target: screen; property: "color"; value: r1.color } + Binding { target: screen; property: "color"; value: r2.color; when: screen.changeColor == true } +} diff --git a/tests/auto/declarative/qmlbinding/qmlbinding.pro b/tests/auto/declarative/qmlbinding/qmlbinding.pro new file mode 100644 index 0000000..dfaca91 --- /dev/null +++ b/tests/auto/declarative/qmlbinding/qmlbinding.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + +SOURCES += tst_qmlbinding.cpp + +# Define SRCDIR equal to test's source directory +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qmlbinding/tst_qmlbinding.cpp b/tests/auto/declarative/qmlbinding/tst_qmlbinding.cpp new file mode 100644 index 0000000..e5aacc7 --- /dev/null +++ b/tests/auto/declarative/qmlbinding/tst_qmlbinding.cpp @@ -0,0 +1,101 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include +#include +#include +#include +#include "../../../shared/util.h" + +class tst_qmlbinding : public QObject + +{ + Q_OBJECT +public: + tst_qmlbinding(); + +private slots: + void binding(); + void whenAfterValue(); + +private: + QmlEngine engine; +}; + +tst_qmlbinding::tst_qmlbinding() +{ +} + +void tst_qmlbinding::binding() +{ + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/test-binding.qml")); + QmlGraphicsRectangle *rect = qobject_cast(c.create()); + + QVERIFY(rect != 0); + QCOMPARE(rect->color(), QColor("yellow")); + QCOMPARE(rect->property("text").toString(), QString("Hello")); + + rect->setProperty("changeColor", true); + QCOMPARE(rect->color(), QColor("red")); + + delete rect; +} + +void tst_qmlbinding::whenAfterValue() +{ + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/test-binding2.qml")); + QmlGraphicsRectangle *rect = qobject_cast(c.create()); + + QVERIFY(rect != 0); + QCOMPARE(rect->color(), QColor("yellow")); + QCOMPARE(rect->property("text").toString(), QString("Hello")); + + rect->setProperty("changeColor", true); + QCOMPARE(rect->color(), QColor("red")); + + delete rect; +} + +QTEST_MAIN(tst_qmlbinding) + +#include "tst_qmlbinding.moc" -- cgit v0.12 From a71d10cd44ae01329c7b50e708c55a4192fbd386 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 6 Nov 2009 10:00:10 +1000 Subject: add to declarative.pro --- tests/auto/declarative/declarative.pro | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 716d278..88134f9 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -16,6 +16,7 @@ SUBDIRS += \ qfxtextinput \ # Cover qfxwebview \ # Cover qmetaobjectbuilder \ # Cover + qmlbinding \ # Cover qmlcontext \ # Cover qmldom \ # Cover qmlecmascript \ # Cover -- cgit v0.12 From 4ad04d20d69ed0d8903c2d6d2f91dfd40f7e13a4 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 6 Nov 2009 10:01:44 +1000 Subject: Make tests with transparent QML reproducible. --- tools/qmlviewer/qfxtester.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/qmlviewer/qfxtester.cpp b/tools/qmlviewer/qfxtester.cpp index 802a927..5484771 100644 --- a/tools/qmlviewer/qfxtester.cpp +++ b/tools/qmlviewer/qfxtester.cpp @@ -248,6 +248,7 @@ void QmlGraphicsTester::updateCurrentTime(int msec) QImage img(m_view->width(), m_view->height(), QImage::Format_RGB32); if (options & QmlViewer::TestImages) { + img.fill(qRgb(255,255,255)); QPainter p(&img); m_view->render(&p); } -- cgit v0.12 From 36e8bdc254ceab1d25d16e2bf03bd2dda7dd8302 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 6 Nov 2009 10:03:28 +1000 Subject: webview visual tests --- .../visual/webview/settings/FreeMono.ttf | Bin 0 -> 267400 bytes .../visual/webview/settings/data/fontFamily.0.png | Bin 0 -> 3774 bytes .../visual/webview/settings/data/fontFamily.qml | 395 +++ .../visual/webview/settings/data/fontSize.0.png | Bin 0 -> 32180 bytes .../visual/webview/settings/data/fontSize.qml | 339 +++ .../webview/settings/data/noAutoLoadImages.0.png | Bin 0 -> 6609 bytes .../webview/settings/data/noAutoLoadImages.1.png | Bin 0 -> 6609 bytes .../webview/settings/data/noAutoLoadImages.qml | 595 +++++ .../webview/settings/data/setFontFamily.0.png | Bin 0 -> 9380 bytes .../visual/webview/settings/data/setFontFamily.qml | 351 +++ .../webview/settings/data/windowObjects.0.png | Bin 0 -> 7991 bytes .../webview/settings/data/windowObjects.1.png | Bin 0 -> 7991 bytes .../webview/settings/data/windowObjects.2.png | Bin 0 -> 7643 bytes .../webview/settings/data/windowObjects.3.png | Bin 0 -> 7733 bytes .../webview/settings/data/windowObjects.4.png | Bin 0 -> 8116 bytes .../visual/webview/settings/data/windowObjects.qml | 2643 ++++++++++++++++++++ .../visual/webview/settings/fontFamily.qml | 16 + .../visual/webview/settings/fontSize.qml | 70 + .../visual/webview/settings/noAutoLoadImages.qml | 20 + .../declarative/visual/webview/settings/qtlogo.png | Bin 0 -> 2738 bytes .../visual/webview/settings/setFontFamily.qml | 10 + .../visual/webview/settings/test-img.html | 6 + .../visual/webview/settings/test-objects.html | 12 + .../declarative/visual/webview/settings/test.html | 9 + .../visual/webview/settings/windowObjects.qml | 26 + 25 files changed, 4492 insertions(+) create mode 100644 tests/auto/declarative/visual/webview/settings/FreeMono.ttf create mode 100644 tests/auto/declarative/visual/webview/settings/data/fontFamily.0.png create mode 100644 tests/auto/declarative/visual/webview/settings/data/fontFamily.qml create mode 100644 tests/auto/declarative/visual/webview/settings/data/fontSize.0.png create mode 100644 tests/auto/declarative/visual/webview/settings/data/fontSize.qml create mode 100644 tests/auto/declarative/visual/webview/settings/data/noAutoLoadImages.0.png create mode 100644 tests/auto/declarative/visual/webview/settings/data/noAutoLoadImages.1.png create mode 100644 tests/auto/declarative/visual/webview/settings/data/noAutoLoadImages.qml create mode 100644 tests/auto/declarative/visual/webview/settings/data/setFontFamily.0.png create mode 100644 tests/auto/declarative/visual/webview/settings/data/setFontFamily.qml create mode 100644 tests/auto/declarative/visual/webview/settings/data/windowObjects.0.png create mode 100644 tests/auto/declarative/visual/webview/settings/data/windowObjects.1.png create mode 100644 tests/auto/declarative/visual/webview/settings/data/windowObjects.2.png create mode 100644 tests/auto/declarative/visual/webview/settings/data/windowObjects.3.png create mode 100644 tests/auto/declarative/visual/webview/settings/data/windowObjects.4.png create mode 100644 tests/auto/declarative/visual/webview/settings/data/windowObjects.qml create mode 100644 tests/auto/declarative/visual/webview/settings/fontFamily.qml create mode 100644 tests/auto/declarative/visual/webview/settings/fontSize.qml create mode 100644 tests/auto/declarative/visual/webview/settings/noAutoLoadImages.qml create mode 100644 tests/auto/declarative/visual/webview/settings/qtlogo.png create mode 100644 tests/auto/declarative/visual/webview/settings/setFontFamily.qml create mode 100644 tests/auto/declarative/visual/webview/settings/test-img.html create mode 100644 tests/auto/declarative/visual/webview/settings/test-objects.html create mode 100644 tests/auto/declarative/visual/webview/settings/test.html create mode 100644 tests/auto/declarative/visual/webview/settings/windowObjects.qml diff --git a/tests/auto/declarative/visual/webview/settings/FreeMono.ttf b/tests/auto/declarative/visual/webview/settings/FreeMono.ttf new file mode 100644 index 0000000..d7ce52d Binary files /dev/null and b/tests/auto/declarative/visual/webview/settings/FreeMono.ttf differ diff --git a/tests/auto/declarative/visual/webview/settings/data/fontFamily.0.png b/tests/auto/declarative/visual/webview/settings/data/fontFamily.0.png new file mode 100644 index 0000000..7721e75 Binary files /dev/null and b/tests/auto/declarative/visual/webview/settings/data/fontFamily.0.png differ diff --git a/tests/auto/declarative/visual/webview/settings/data/fontFamily.qml b/tests/auto/declarative/visual/webview/settings/data/fontFamily.qml new file mode 100644 index 0000000..195c3ba --- /dev/null +++ b/tests/auto/declarative/visual/webview/settings/data/fontFamily.qml @@ -0,0 +1,395 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 32 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 48 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 64 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 80 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 96 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 112 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 128 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 144 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 160 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 176 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 192 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 208 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 224 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 240 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 256 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 272 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 288 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 304 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 320 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 336 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 352 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 368 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 384 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 400 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 416 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 432 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 448 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 464 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 480 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 496 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 512 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 528 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 544 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 560 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 576 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 592 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 608 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 624 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 640 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 656 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 672 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 688 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 196; y: 25 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 194; y: 19 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 190; y: 13 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 704 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 720 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 736 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 752 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 768 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 784 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 800 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 816 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 832 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 848 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 864 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 880 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 896 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 912 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 928 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 944 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 960 + image: "fontFamily.0.png" + } + Frame { + msec: 976 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 992 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1008 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1024 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1040 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1056 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1072 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1088 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1104 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1120 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1136 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1152 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1168 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1184 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1200 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1216 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1232 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1248 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1264 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1280 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1296 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1312 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1328 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1344 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1360 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1376 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1392 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1408 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1424 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1440 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } + Frame { + msec: 1456 + hash: "5d66fdee6a0a96bb24e89244f02eacc9" + } +} diff --git a/tests/auto/declarative/visual/webview/settings/data/fontSize.0.png b/tests/auto/declarative/visual/webview/settings/data/fontSize.0.png new file mode 100644 index 0000000..95196a1 Binary files /dev/null and b/tests/auto/declarative/visual/webview/settings/data/fontSize.0.png differ diff --git a/tests/auto/declarative/visual/webview/settings/data/fontSize.qml b/tests/auto/declarative/visual/webview/settings/data/fontSize.qml new file mode 100644 index 0000000..438ffa5 --- /dev/null +++ b/tests/auto/declarative/visual/webview/settings/data/fontSize.qml @@ -0,0 +1,339 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 32 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 48 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 64 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 80 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 96 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 112 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 128 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 144 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 160 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 176 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 192 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 208 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 224 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 240 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 256 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 272 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 288 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 304 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 320 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 336 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 352 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 368 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 384 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 400 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 416 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 432 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 448 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 464 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 480 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 496 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 512 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 528 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 544 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 560 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 576 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 592 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 608 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 624 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 640 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 656 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 672 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 688 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 704 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 720 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 736 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 752 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 768 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 784 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 800 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 816 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 832 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 848 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 864 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 880 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 896 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 912 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 928 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 944 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 960 + image: "fontSize.0.png" + } + Frame { + msec: 976 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 992 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1008 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1024 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1040 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1056 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1072 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1088 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1104 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1120 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1136 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1152 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1168 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1184 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1200 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1216 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1232 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1248 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1264 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1280 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1296 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1312 + hash: "962e77f522956d38f3b1b890df749f0a" + } + Frame { + msec: 1328 + hash: "962e77f522956d38f3b1b890df749f0a" + } +} diff --git a/tests/auto/declarative/visual/webview/settings/data/noAutoLoadImages.0.png b/tests/auto/declarative/visual/webview/settings/data/noAutoLoadImages.0.png new file mode 100644 index 0000000..48920a2 Binary files /dev/null and b/tests/auto/declarative/visual/webview/settings/data/noAutoLoadImages.0.png differ diff --git a/tests/auto/declarative/visual/webview/settings/data/noAutoLoadImages.1.png b/tests/auto/declarative/visual/webview/settings/data/noAutoLoadImages.1.png new file mode 100644 index 0000000..48920a2 Binary files /dev/null and b/tests/auto/declarative/visual/webview/settings/data/noAutoLoadImages.1.png differ diff --git a/tests/auto/declarative/visual/webview/settings/data/noAutoLoadImages.qml b/tests/auto/declarative/visual/webview/settings/data/noAutoLoadImages.qml new file mode 100644 index 0000000..ead5c3b --- /dev/null +++ b/tests/auto/declarative/visual/webview/settings/data/noAutoLoadImages.qml @@ -0,0 +1,595 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 32 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 48 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 64 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 80 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 96 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 112 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 128 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 144 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 160 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 176 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 192 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 208 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 224 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 240 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 256 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 272 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 288 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 304 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 320 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 336 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 352 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 368 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 384 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 400 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 416 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 432 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 448 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 464 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 480 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 496 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 512 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 528 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 544 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 560 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 576 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 592 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 608 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 624 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 640 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 656 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 672 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 688 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 704 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 720 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 736 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 752 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 768 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 784 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 800 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 816 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 832 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 848 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 864 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 880 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 896 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 912 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 928 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 944 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 960 + image: "noAutoLoadImages.0.png" + } + Frame { + msec: 976 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 992 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1008 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1024 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1040 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1056 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1072 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1088 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1104 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1120 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1136 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1152 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1168 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1184 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1200 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1216 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1232 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1248 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1264 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1280 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1296 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1312 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1328 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1344 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1360 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1376 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1392 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1408 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1424 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1440 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1456 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1472 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1488 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1504 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1520 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1536 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1552 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1568 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1584 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1600 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1616 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1632 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1648 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1664 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1680 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1696 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1712 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1728 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1744 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1760 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1776 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1792 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1808 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1824 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1840 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1856 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1872 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1888 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1904 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1920 + image: "noAutoLoadImages.1.png" + } + Frame { + msec: 1936 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1952 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1968 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 1984 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2000 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2016 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2032 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2048 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2064 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2080 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2096 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2112 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2128 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2144 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2160 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2176 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2192 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2208 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2224 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2240 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2256 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2272 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2288 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2304 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2320 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2336 + hash: "5146cfbeefc51268eca7717d84775750" + } + Frame { + msec: 2352 + hash: "5146cfbeefc51268eca7717d84775750" + } +} diff --git a/tests/auto/declarative/visual/webview/settings/data/setFontFamily.0.png b/tests/auto/declarative/visual/webview/settings/data/setFontFamily.0.png new file mode 100644 index 0000000..1a0448a Binary files /dev/null and b/tests/auto/declarative/visual/webview/settings/data/setFontFamily.0.png differ diff --git a/tests/auto/declarative/visual/webview/settings/data/setFontFamily.qml b/tests/auto/declarative/visual/webview/settings/data/setFontFamily.qml new file mode 100644 index 0000000..da71ef1 --- /dev/null +++ b/tests/auto/declarative/visual/webview/settings/data/setFontFamily.qml @@ -0,0 +1,351 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 32 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 48 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 64 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 80 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 96 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 112 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 128 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 144 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 160 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 176 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 192 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 208 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 224 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 240 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 256 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 272 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 288 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 304 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 320 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 336 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 352 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 368 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 384 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 400 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 416 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 432 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 448 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 464 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 480 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 496 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 512 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 528 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 544 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 560 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 576 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 592 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 608 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 624 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 640 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 656 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 672 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 688 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 704 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 720 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 736 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 752 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 768 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 784 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 800 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 816 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 832 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 848 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 864 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 880 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 896 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 912 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 928 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 944 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 960 + image: "setFontFamily.0.png" + } + Frame { + msec: 976 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 992 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1008 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1024 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1040 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1056 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1072 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1088 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1104 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1120 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1136 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1152 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1168 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1184 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1200 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1216 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1232 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1248 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1264 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1280 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1296 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1312 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1328 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1344 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1360 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } + Frame { + msec: 1376 + hash: "52d74d4a6716ed4d4e202de6480b13b2" + } +} diff --git a/tests/auto/declarative/visual/webview/settings/data/windowObjects.0.png b/tests/auto/declarative/visual/webview/settings/data/windowObjects.0.png new file mode 100644 index 0000000..b5c35d2 Binary files /dev/null and b/tests/auto/declarative/visual/webview/settings/data/windowObjects.0.png differ diff --git a/tests/auto/declarative/visual/webview/settings/data/windowObjects.1.png b/tests/auto/declarative/visual/webview/settings/data/windowObjects.1.png new file mode 100644 index 0000000..b5c35d2 Binary files /dev/null and b/tests/auto/declarative/visual/webview/settings/data/windowObjects.1.png differ diff --git a/tests/auto/declarative/visual/webview/settings/data/windowObjects.2.png b/tests/auto/declarative/visual/webview/settings/data/windowObjects.2.png new file mode 100644 index 0000000..28403c8 Binary files /dev/null and b/tests/auto/declarative/visual/webview/settings/data/windowObjects.2.png differ diff --git a/tests/auto/declarative/visual/webview/settings/data/windowObjects.3.png b/tests/auto/declarative/visual/webview/settings/data/windowObjects.3.png new file mode 100644 index 0000000..241b9f8 Binary files /dev/null and b/tests/auto/declarative/visual/webview/settings/data/windowObjects.3.png differ diff --git a/tests/auto/declarative/visual/webview/settings/data/windowObjects.4.png b/tests/auto/declarative/visual/webview/settings/data/windowObjects.4.png new file mode 100644 index 0000000..1877cb2 Binary files /dev/null and b/tests/auto/declarative/visual/webview/settings/data/windowObjects.4.png differ diff --git a/tests/auto/declarative/visual/webview/settings/data/windowObjects.qml b/tests/auto/declarative/visual/webview/settings/data/windowObjects.qml new file mode 100644 index 0000000..7fce295 --- /dev/null +++ b/tests/auto/declarative/visual/webview/settings/data/windowObjects.qml @@ -0,0 +1,2643 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 32 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 48 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 64 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 80 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 96 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 112 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 128 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 144 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 160 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 176 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 192 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 208 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 224 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 240 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 256 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 272 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 288 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 304 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 320 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 336 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 352 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 368 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 384 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 400 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 416 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 432 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 448 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 464 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 480 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 496 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 512 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 528 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 544 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 560 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 576 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 592 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 608 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 624 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 640 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 656 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 672 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 688 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 704 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 720 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 736 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 752 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 768 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 784 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 800 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 816 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 832 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 848 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 864 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 880 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 896 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 912 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 928 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 944 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 960 + image: "windowObjects.0.png" + } + Frame { + msec: 976 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 992 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1008 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1024 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1040 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 155; y: 9 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 145; y: 23 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1056 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 137; y: 37 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 127; y: 53 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1072 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 119; y: 67 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 111; y: 77 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1088 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 103; y: 87 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1104 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 97; y: 93 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 91; y: 101 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 87; y: 109 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1120 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 83; y: 117 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 81; y: 125 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1136 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 81; y: 133 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 79; y: 139 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1152 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 79; y: 142 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 79; y: 145 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1168 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 78; y: 146 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 78; y: 147 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1184 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1200 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1216 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1232 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1248 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 82; y: 143 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1264 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1280 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 83; y: 142 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 83; y: 141 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 84; y: 139 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1296 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 85; y: 138 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1312 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1328 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1344 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 86; y: 137 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 87; y: 137 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1360 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 88; y: 137 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1376 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 89; y: 138 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 89; y: 139 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1392 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 90; y: 141 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 90; y: 142 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1408 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 91; y: 144 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1424 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 91; y: 146 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 91; y: 148 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 91; y: 149 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1440 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 91; y: 151 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 91; y: 153 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1456 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 90; y: 154 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 90; y: 155 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1472 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 89; y: 156 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1488 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1504 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1520 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1536 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1552 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1568 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1584 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1600 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1616 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1632 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1648 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1664 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1680 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1696 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1712 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1728 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1744 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1760 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1776 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1792 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1808 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1824 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1840 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1856 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1872 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1888 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1904 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1920 + image: "windowObjects.1.png" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 89; y: 156 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1936 + hash: "fca76207a4fa6f2c4bb01d28aa018f0c" + } + Frame { + msec: 1952 + hash: "fca76207a4fa6f2c4bb01d28aa018f0c" + } + Frame { + msec: 1968 + hash: "fca76207a4fa6f2c4bb01d28aa018f0c" + } + Frame { + msec: 1984 + hash: "fca76207a4fa6f2c4bb01d28aa018f0c" + } + Frame { + msec: 2000 + hash: "fca76207a4fa6f2c4bb01d28aa018f0c" + } + Frame { + msec: 2016 + hash: "fca76207a4fa6f2c4bb01d28aa018f0c" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 89; y: 156 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2032 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2048 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2064 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2080 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2096 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2112 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2128 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2144 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2160 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2176 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2192 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2208 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2224 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2240 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2256 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2272 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2288 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 89; y: 157 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 88; y: 158 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 87; y: 160 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2304 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 87; y: 161 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 83; y: 167 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2320 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 82; y: 169 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 80; y: 175 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2336 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 78; y: 183 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 74; y: 189 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2352 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 72; y: 195 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 68; y: 201 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2368 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 64; y: 207 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 62; y: 213 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2384 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 61; y: 215 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 59; y: 221 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2400 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 58; y: 222 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 57; y: 224 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2416 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2432 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2448 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2464 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2480 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2496 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2512 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2528 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2544 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2560 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2576 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2592 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2608 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2624 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2640 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2656 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2672 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2688 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2704 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2720 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2736 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 49; y: 225 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 50; y: 224 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2752 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 50; y: 223 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2768 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 51; y: 222 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2784 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 51; y: 221 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 52; y: 220 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2800 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 52; y: 218 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2816 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 53; y: 217 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2832 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2848 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2864 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 54; y: 216 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2880 + image: "windowObjects.2.png" + } + Frame { + msec: 2896 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 55; y: 215 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2912 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2928 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 56; y: 214 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2944 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2960 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2976 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 57; y: 214 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 57; y: 214 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2992 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3008 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3024 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3040 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3056 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3072 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3088 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3104 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 57; y: 214 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3120 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3136 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3152 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3168 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3184 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3200 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3216 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3232 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Key { + type: 6 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 3248 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Frame { + msec: 3264 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Frame { + msec: 3280 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Frame { + msec: 3296 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Key { + type: 7 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 3312 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Frame { + msec: 3328 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Frame { + msec: 3344 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Frame { + msec: 3360 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 57; y: 212 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3376 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Frame { + msec: 3392 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Frame { + msec: 3408 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 57; y: 211 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3424 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Key { + type: 6 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 3440 + hash: "c6ac7e0be8b7b2a80966344389def97a" + } + Frame { + msec: 3456 + hash: "c6ac7e0be8b7b2a80966344389def97a" + } + Frame { + msec: 3472 + hash: "c6ac7e0be8b7b2a80966344389def97a" + } + Frame { + msec: 3488 + hash: "40f333072bb9f1d334d5ae432d9641b9" + } + Frame { + msec: 3504 + hash: "40f333072bb9f1d334d5ae432d9641b9" + } + Key { + type: 7 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 3520 + hash: "40f333072bb9f1d334d5ae432d9641b9" + } + Frame { + msec: 3536 + hash: "40f333072bb9f1d334d5ae432d9641b9" + } + Frame { + msec: 3552 + hash: "40f333072bb9f1d334d5ae432d9641b9" + } + Frame { + msec: 3568 + hash: "40f333072bb9f1d334d5ae432d9641b9" + } + Frame { + msec: 3584 + hash: "40f333072bb9f1d334d5ae432d9641b9" + } + Frame { + msec: 3600 + hash: "40f333072bb9f1d334d5ae432d9641b9" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 58; y: 210 + modifiers: 0 + sendToViewport: true + } + Key { + type: 6 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 3616 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 60; y: 209 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 61; y: 207 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3632 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 62; y: 205 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3648 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 62; y: 204 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 63; y: 203 + modifiers: 0 + sendToViewport: true + } + Key { + type: 7 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 3664 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 63; y: 202 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 64; y: 200 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3680 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Frame { + msec: 3696 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 65; y: 198 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 66; y: 197 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 67; y: 195 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3712 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 68; y: 194 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 69; y: 192 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3728 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 70; y: 190 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 70; y: 188 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3744 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 70; y: 186 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 70; y: 185 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3760 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 71; y: 183 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 71; y: 181 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3776 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 72; y: 179 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 73; y: 178 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3792 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 73; y: 176 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 73; y: 175 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3808 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 74; y: 174 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 74; y: 173 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3824 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 74; y: 172 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3840 + image: "windowObjects.3.png" + } + Frame { + msec: 3856 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Frame { + msec: 3872 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Frame { + msec: 3888 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Frame { + msec: 3904 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Frame { + msec: 3920 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 75; y: 171 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 76; y: 171 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3936 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Frame { + msec: 3952 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Frame { + msec: 3968 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Frame { + msec: 3984 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Frame { + msec: 4000 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Frame { + msec: 4016 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Frame { + msec: 4032 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 76; y: 170 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4048 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 77; y: 169 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 78; y: 168 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4064 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 79; y: 168 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4080 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 81; y: 167 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 81; y: 166 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4096 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 82; y: 165 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4112 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 83; y: 164 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4128 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Frame { + msec: 4144 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Frame { + msec: 4160 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Frame { + msec: 4176 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 83; y: 164 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4192 + hash: "5b3505be865f704640e81cea092d35ba" + } + Frame { + msec: 4208 + hash: "5b3505be865f704640e81cea092d35ba" + } + Frame { + msec: 4224 + hash: "5b3505be865f704640e81cea092d35ba" + } + Frame { + msec: 4240 + hash: "5b3505be865f704640e81cea092d35ba" + } + Frame { + msec: 4256 + hash: "5b3505be865f704640e81cea092d35ba" + } + Frame { + msec: 4272 + hash: "5b3505be865f704640e81cea092d35ba" + } + Frame { + msec: 4288 + hash: "5b3505be865f704640e81cea092d35ba" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 83; y: 164 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4304 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4320 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4336 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4352 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4368 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4384 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4400 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4416 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4432 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4448 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4464 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 85; y: 158 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 85; y: 156 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4480 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 86; y: 154 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 86; y: 152 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4496 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 87; y: 150 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 89; y: 144 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4512 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 93; y: 138 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 99; y: 134 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4528 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 101; y: 128 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 105; y: 122 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4544 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 109; y: 114 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 113; y: 108 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4560 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 114; y: 106 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 114; y: 105 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4576 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 115; y: 104 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 115; y: 102 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4592 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 115; y: 100 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 116; y: 98 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4608 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 120; y: 92 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 122; y: 86 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4624 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 126; y: 76 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 130; y: 66 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4640 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 132; y: 56 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 134; y: 46 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4656 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 136; y: 38 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 138; y: 30 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4672 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 140; y: 22 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 141; y: 20 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4688 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 143; y: 14 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 144; y: 12 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4704 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 144; y: 11 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 144; y: 9 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4720 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 144; y: 7 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 144; y: 6 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4736 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 143; y: 4 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 143; y: 2 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4752 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 143; y: 1 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4768 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4784 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4800 + image: "windowObjects.4.png" + } + Frame { + msec: 4816 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4832 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4848 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4864 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4880 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4896 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4912 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4928 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4944 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4960 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4976 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4992 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5008 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5024 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5040 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5056 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5072 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5088 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5104 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5120 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5136 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5152 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5168 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5184 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5200 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5216 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5232 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5248 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5264 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5280 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5296 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5312 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5328 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5344 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5360 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5376 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5392 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5408 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5424 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5440 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5456 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5472 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5488 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5504 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5520 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5536 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5552 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5568 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5584 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } +} diff --git a/tests/auto/declarative/visual/webview/settings/fontFamily.qml b/tests/auto/declarative/visual/webview/settings/fontFamily.qml new file mode 100644 index 0000000..2bb2a53 --- /dev/null +++ b/tests/auto/declarative/visual/webview/settings/fontFamily.qml @@ -0,0 +1,16 @@ +import Qt 4.6 + +WebView { + id: web + width: 200 + height: 200 + Column { + anchors.fill: parent + Text { text: "standard: " + web.settings.standardFontFamily } + Text { text: "fixed: " + web.settings.fixedFontFamily } + Text { text: "serif: " + web.settings.serifFontFamily } + Text { text: "sansserif: " + web.settings.sansSerifFontFamily } + Text { text: "cursive: " + web.settings.cursiveFontFamily } + Text { text: "fantasy: " + web.settings.fantasyFontFamily } + } +} diff --git a/tests/auto/declarative/visual/webview/settings/fontSize.qml b/tests/auto/declarative/visual/webview/settings/fontSize.qml new file mode 100644 index 0000000..b970783 --- /dev/null +++ b/tests/auto/declarative/visual/webview/settings/fontSize.qml @@ -0,0 +1,70 @@ +import Qt 4.6 + +Grid { + columns: 3 + Rectangle { + Text { color: "green"; text: "Normal" } + border.color: "black" + width: 200 + height: 200 + WebView { + anchors.fill: parent + url: "test.html" + } + } + Rectangle { + Text { color: "green"; text: "Big" } + border.color: "black" + width: 200 + height: 200 + WebView { + anchors.fill: parent + url: "test.html" + settings.minimumFontSize: 20 + } + } + Rectangle { + Text { color: "green"; text: "Big (logical)" } + border.color: "black" + width: 200 + height: 200 + WebView { + anchors.fill: parent + url: "test.html" + settings.minimumLogicalFontSize: 20 + } + } + Rectangle { + Text { color: "green"; text: "Bigger" } + border.color: "black" + width: 200 + height: 200 + WebView { + anchors.fill: parent + url: "test.html" + settings.minimumFontSize: 30 + } + } + Rectangle { + Text { color: "green"; text: "Small (except fixed)" } + border.color: "black" + width: 200 + height: 200 + WebView { + anchors.fill: parent + url: "test.html" + settings.defaultFontSize: 8 + } + } + Rectangle { + Text { color: "green"; text: "Small fixed" } + border.color: "black" + width: 200 + height: 200 + WebView { + anchors.fill: parent + url: "test.html" + settings.defaultFixedFontSize: 8 + } + } +} diff --git a/tests/auto/declarative/visual/webview/settings/noAutoLoadImages.qml b/tests/auto/declarative/visual/webview/settings/noAutoLoadImages.qml new file mode 100644 index 0000000..2478932 --- /dev/null +++ b/tests/auto/declarative/visual/webview/settings/noAutoLoadImages.qml @@ -0,0 +1,20 @@ +import Qt 4.6 + +Grid { + columns: 2 + Rectangle { + Text { id: label; x:10; y:170; color: "green"; text: "No image" } + border.color: "black" + width: 200 + height: 200 + WebView { + anchors.fill: parent + settings.autoLoadImages: false + url: "test-img.html" + MouseRegion { + anchors.fill: parent + onClicked: { parent.settings.autoLoadImages=true; label.text=""; parent.reload.trigger() } + } + } + } +} diff --git a/tests/auto/declarative/visual/webview/settings/qtlogo.png b/tests/auto/declarative/visual/webview/settings/qtlogo.png new file mode 100644 index 0000000..399bd0b Binary files /dev/null and b/tests/auto/declarative/visual/webview/settings/qtlogo.png differ diff --git a/tests/auto/declarative/visual/webview/settings/setFontFamily.qml b/tests/auto/declarative/visual/webview/settings/setFontFamily.qml new file mode 100644 index 0000000..99d5f2a --- /dev/null +++ b/tests/auto/declarative/visual/webview/settings/setFontFamily.qml @@ -0,0 +1,10 @@ +import Qt 4.6 + +WebView { + url: "test.html" + width: 200 + height: 200 + settings.standardFontFamily: font.name + // WebKit doesn't seem to honour any other FontFamily settings + FontLoader { id: font; source: "FreeMono.ttf" } +} diff --git a/tests/auto/declarative/visual/webview/settings/test-img.html b/tests/auto/declarative/visual/webview/settings/test-img.html new file mode 100644 index 0000000..cdd63ac --- /dev/null +++ b/tests/auto/declarative/visual/webview/settings/test-img.html @@ -0,0 +1,6 @@ + + +

Boring Document

+

+This is a boring document. +With a picture: diff --git a/tests/auto/declarative/visual/webview/settings/test-objects.html b/tests/auto/declarative/visual/webview/settings/test-objects.html new file mode 100644 index 0000000..ed7d2ea --- /dev/null +++ b/tests/auto/declarative/visual/webview/settings/test-objects.html @@ -0,0 +1,12 @@ + + + + +

Boring Document

+

+This is a boring document. +It gets the text on this button: + +from QML. +

diff --git a/tests/auto/declarative/visual/webview/settings/test.html b/tests/auto/declarative/visual/webview/settings/test.html new file mode 100644 index 0000000..3265e20 --- /dev/null +++ b/tests/auto/declarative/visual/webview/settings/test.html @@ -0,0 +1,9 @@ + + +

Boring Document

+

+This is a boring document. +

+This is italic. +This is bold. +This is fixed. diff --git a/tests/auto/declarative/visual/webview/settings/windowObjects.qml b/tests/auto/declarative/visual/webview/settings/windowObjects.qml new file mode 100644 index 0000000..f1d4097 --- /dev/null +++ b/tests/auto/declarative/visual/webview/settings/windowObjects.qml @@ -0,0 +1,26 @@ +import Qt 4.6 + +Column { + WebView { + width: 200 + height: 200 + url: "test-objects.html" + javaScriptWindowObjects: + Object { + property string text: btntext.text + WebView.windowObjectName: "qmltext" + } + } + Row { + Text { text: "Input:" } + Rectangle { + width: btntext.width+10 + height: btntext.height+10 + border.color: "black" + TextInput { + id: btntext + text: "Blah" + } + } + } +} -- cgit v0.12 From 135f09e3599accca53ae825f6c36a17bf1c0f295 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 6 Nov 2009 10:27:58 +1000 Subject: Impove triggerOnStart docs. --- src/declarative/util/qmltimer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/declarative/util/qmltimer.cpp b/src/declarative/util/qmltimer.cpp index 0aa0747..8ee9059 100644 --- a/src/declarative/util/qmltimer.cpp +++ b/src/declarative/util/qmltimer.cpp @@ -176,6 +176,11 @@ void QmlTimer::setRepeating(bool repeating) /*! \qmlproperty bool Timer::triggeredOnStart + When the Timer is started the first trigger is normally after the specified + interval has elapsed. It is sometimes desireable to trigger immediately + when the timer is started, for example to establish an initial + state. + If \a triggeredOnStart is true, the timer will be triggered immediately when started, and subsequently at the specified interval. Note that for a Timer with \e repeat set to false, this will result in the timer being -- cgit v0.12 From d79eb9b3e824b2d61ae4412889d0f8a0eb8e688c Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 6 Nov 2009 10:57:33 +1000 Subject: set html property --- tests/auto/declarative/qfxwebview/data/sethtml.qml | 5 +++++ tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 tests/auto/declarative/qfxwebview/data/sethtml.qml diff --git a/tests/auto/declarative/qfxwebview/data/sethtml.qml b/tests/auto/declarative/qfxwebview/data/sethtml.qml new file mode 100644 index 0000000..063b5a8 --- /dev/null +++ b/tests/auto/declarative/qfxwebview/data/sethtml.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +WebView { + html: "

This is a string set on the WebView" +} diff --git a/tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp b/tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp index 9ca6312..a8a0854 100644 --- a/tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp +++ b/tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp @@ -55,7 +55,8 @@ public: tst_qfxwebview() {} private slots: - void testBasicProperties(); + void basicProperties(); + void setHtml(); void cleanupTestCase(); @@ -102,7 +103,7 @@ void tst_qfxwebview::checkNoErrors(const QmlComponent& component) QVERIFY(!component.isError()); } -void tst_qfxwebview::testBasicProperties() +void tst_qfxwebview::basicProperties() { QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/basic.qml")); checkNoErrors(component); @@ -138,6 +139,15 @@ void tst_qfxwebview::testBasicProperties() QVERIFY(!wv->stopAction()->isEnabled()); } +void tst_qfxwebview::setHtml() +{ + QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/sethtml.qml")); + checkNoErrors(component); + QmlGraphicsWebView *wv = qobject_cast(component.create()); + QVERIFY(wv != 0); + QCOMPARE(wv->html(),QString("

This is a string set on the WebView

")); +} + QTEST_MAIN(tst_qfxwebview) #include "tst_qfxwebview.moc" -- cgit v0.12 From 71b0c10cb0a0186b6978143566bb0b35b3de3b54 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 6 Nov 2009 11:03:18 +1000 Subject: move --- tests/auto/declarative/qfxwebview/data/basic.html | 12 -- tests/auto/declarative/qfxwebview/data/basic.png | Bin 3961 -> 0 bytes tests/auto/declarative/qfxwebview/data/basic.qml | 5 - tests/auto/declarative/qfxwebview/data/sethtml.qml | 5 - tests/auto/declarative/qfxwebview/qfxwebview.pro | 8 -- .../auto/declarative/qfxwebview/tst_qfxwebview.cpp | 153 --------------------- .../declarative/qmlgraphicswebview/data/basic.html | 12 ++ .../declarative/qmlgraphicswebview/data/basic.png | Bin 0 -> 3961 bytes .../declarative/qmlgraphicswebview/data/basic.qml | 5 + .../qmlgraphicswebview/data/sethtml.qml | 5 + .../qmlgraphicswebview/qmlgraphicswebview.pro | 8 ++ .../qmlgraphicswebview/tst_qmlgraphicswebview.cpp | 153 +++++++++++++++++++++ 12 files changed, 183 insertions(+), 183 deletions(-) delete mode 100644 tests/auto/declarative/qfxwebview/data/basic.html delete mode 100644 tests/auto/declarative/qfxwebview/data/basic.png delete mode 100644 tests/auto/declarative/qfxwebview/data/basic.qml delete mode 100644 tests/auto/declarative/qfxwebview/data/sethtml.qml delete mode 100644 tests/auto/declarative/qfxwebview/qfxwebview.pro delete mode 100644 tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp create mode 100644 tests/auto/declarative/qmlgraphicswebview/data/basic.html create mode 100644 tests/auto/declarative/qmlgraphicswebview/data/basic.png create mode 100644 tests/auto/declarative/qmlgraphicswebview/data/basic.qml create mode 100644 tests/auto/declarative/qmlgraphicswebview/data/sethtml.qml create mode 100644 tests/auto/declarative/qmlgraphicswebview/qmlgraphicswebview.pro create mode 100644 tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp diff --git a/tests/auto/declarative/qfxwebview/data/basic.html b/tests/auto/declarative/qfxwebview/data/basic.html deleted file mode 100644 index c262f12..0000000 --- a/tests/auto/declarative/qfxwebview/data/basic.html +++ /dev/null @@ -1,12 +0,0 @@ - -Basic - - - - - - - -
This is a basic test.
- - diff --git a/tests/auto/declarative/qfxwebview/data/basic.png b/tests/auto/declarative/qfxwebview/data/basic.png deleted file mode 100644 index 35717cc..0000000 Binary files a/tests/auto/declarative/qfxwebview/data/basic.png and /dev/null differ diff --git a/tests/auto/declarative/qfxwebview/data/basic.qml b/tests/auto/declarative/qfxwebview/data/basic.qml deleted file mode 100644 index 5394837..0000000 --- a/tests/auto/declarative/qfxwebview/data/basic.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Qt 4.6 - -WebView { - url: "basic.html" -} diff --git a/tests/auto/declarative/qfxwebview/data/sethtml.qml b/tests/auto/declarative/qfxwebview/data/sethtml.qml deleted file mode 100644 index 063b5a8..0000000 --- a/tests/auto/declarative/qfxwebview/data/sethtml.qml +++ /dev/null @@ -1,5 +0,0 @@ -import Qt 4.6 - -WebView { - html: "

This is a string set on the WebView" -} diff --git a/tests/auto/declarative/qfxwebview/qfxwebview.pro b/tests/auto/declarative/qfxwebview/qfxwebview.pro deleted file mode 100644 index b75e057..0000000 --- a/tests/auto/declarative/qfxwebview/qfxwebview.pro +++ /dev/null @@ -1,8 +0,0 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative -macx:CONFIG -= app_bundle - -SOURCES += tst_qfxwebview.cpp - -# Define SRCDIR equal to test's source directory -DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp b/tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp deleted file mode 100644 index a8a0854..0000000 --- a/tests/auto/declarative/qfxwebview/tst_qfxwebview.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -#include "../../../shared/util.h" -#include -#include -#include -#include -#include -#include -#include - -class tst_qfxwebview : public QObject -{ - Q_OBJECT -public: - tst_qfxwebview() {} - -private slots: - void basicProperties(); - void setHtml(); - void cleanupTestCase(); - - -private: - void checkNoErrors(const QmlComponent& component); - QmlEngine engine; - QString tmpDir() const - { - static QString tmpd = QDir::tempPath()+"/tst_qfxwebview-" - + QDateTime::currentDateTime().toString(QLatin1String("yyyyMMddhhmmss")); - return tmpd; - } -}; - -void removeRecursive(const QString& dirname) -{ - QDir dir(dirname); - QFileInfoList entries(dir.entryInfoList(QDir::Dirs|QDir::Files|QDir::NoDotAndDotDot)); - for (int i = 0; i < entries.count(); ++i) - if (entries[i].isDir()) - removeRecursive(entries[i].filePath()); - else - dir.remove(entries[i].fileName()); - QDir().rmdir(dirname); -} - -void tst_qfxwebview::cleanupTestCase() -{ - removeRecursive(tmpDir()); -} - -void tst_qfxwebview::checkNoErrors(const QmlComponent& component) -{ - if (component.isError()) { - QList errors = component.errors(); - for (int ii = 0; ii < errors.count(); ++ii) { - const QmlError &error = errors.at(ii); - QByteArray errorStr = QByteArray::number(error.line()) + ":" + - QByteArray::number(error.column()) + ":" + - error.description().toUtf8(); - qWarning() << errorStr; - } - } - QVERIFY(!component.isError()); -} - -void tst_qfxwebview::basicProperties() -{ - QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/basic.qml")); - checkNoErrors(component); - QWebSettings::enablePersistentStorage(tmpDir()); - - QmlGraphicsWebView *wv = qobject_cast(component.create()); - QVERIFY(wv != 0); - QTRY_COMPARE(wv->progress(), 1.0); - QCOMPARE(wv->title(),QString("Basic")); - QTRY_COMPARE(wv->icon().width(), 48); - QCOMPARE(wv->icon(),QPixmap(SRCDIR "/data/basic.png")); - QCOMPARE(wv->statusText(),QString("")); - QFile htmlfile(SRCDIR "/data/basic.html"); - QVERIFY(htmlfile.open(QIODevice::ReadOnly)); - QString actualhtml____ = wv->html(); // "____" is to make errors line up for easier reading - QString expectedhtml = htmlfile.readAll(); - actualhtml____.replace(QRegExp("\\s+"),""); - expectedhtml.replace(QRegExp("\\s+"),""); - QCOMPARE(actualhtml____,expectedhtml); // same, ignoring whitespace - QCOMPARE(wv->width(), 123.0); - QCOMPARE(wv->webPageWidth(), 0); - QCOMPARE(wv->preferredWidth(), 0); - QCOMPARE(wv->zoomFactor(), 1.0); - QCOMPARE(wv->url(), QUrl::fromLocalFile(SRCDIR "/data/basic.html")); - QCOMPARE(wv->status(), QmlGraphicsWebView::Ready); - QVERIFY(wv->reloadAction()); - QVERIFY(wv->reloadAction()->isEnabled()); - QVERIFY(wv->backAction()); - QVERIFY(!wv->backAction()->isEnabled()); - QVERIFY(wv->forwardAction()); - QVERIFY(!wv->forwardAction()->isEnabled()); - QVERIFY(wv->stopAction()); - QVERIFY(!wv->stopAction()->isEnabled()); -} - -void tst_qfxwebview::setHtml() -{ - QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/sethtml.qml")); - checkNoErrors(component); - QmlGraphicsWebView *wv = qobject_cast(component.create()); - QVERIFY(wv != 0); - QCOMPARE(wv->html(),QString("

This is a string set on the WebView

")); -} - -QTEST_MAIN(tst_qfxwebview) - -#include "tst_qfxwebview.moc" diff --git a/tests/auto/declarative/qmlgraphicswebview/data/basic.html b/tests/auto/declarative/qmlgraphicswebview/data/basic.html new file mode 100644 index 0000000..c262f12 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicswebview/data/basic.html @@ -0,0 +1,12 @@ + +Basic + + + + + + + +
This is a basic test.
+ + diff --git a/tests/auto/declarative/qmlgraphicswebview/data/basic.png b/tests/auto/declarative/qmlgraphicswebview/data/basic.png new file mode 100644 index 0000000..35717cc Binary files /dev/null and b/tests/auto/declarative/qmlgraphicswebview/data/basic.png differ diff --git a/tests/auto/declarative/qmlgraphicswebview/data/basic.qml b/tests/auto/declarative/qmlgraphicswebview/data/basic.qml new file mode 100644 index 0000000..5394837 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicswebview/data/basic.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +WebView { + url: "basic.html" +} diff --git a/tests/auto/declarative/qmlgraphicswebview/data/sethtml.qml b/tests/auto/declarative/qmlgraphicswebview/data/sethtml.qml new file mode 100644 index 0000000..063b5a8 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicswebview/data/sethtml.qml @@ -0,0 +1,5 @@ +import Qt 4.6 + +WebView { + html: "

This is a string set on the WebView" +} diff --git a/tests/auto/declarative/qmlgraphicswebview/qmlgraphicswebview.pro b/tests/auto/declarative/qmlgraphicswebview/qmlgraphicswebview.pro new file mode 100644 index 0000000..cce3df2 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicswebview/qmlgraphicswebview.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + +SOURCES += tst_qmlgraphicswebview.cpp + +# Define SRCDIR equal to test's source directory +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp new file mode 100644 index 0000000..a8a0854 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp @@ -0,0 +1,153 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include "../../../shared/util.h" +#include +#include +#include +#include +#include +#include +#include + +class tst_qfxwebview : public QObject +{ + Q_OBJECT +public: + tst_qfxwebview() {} + +private slots: + void basicProperties(); + void setHtml(); + void cleanupTestCase(); + + +private: + void checkNoErrors(const QmlComponent& component); + QmlEngine engine; + QString tmpDir() const + { + static QString tmpd = QDir::tempPath()+"/tst_qfxwebview-" + + QDateTime::currentDateTime().toString(QLatin1String("yyyyMMddhhmmss")); + return tmpd; + } +}; + +void removeRecursive(const QString& dirname) +{ + QDir dir(dirname); + QFileInfoList entries(dir.entryInfoList(QDir::Dirs|QDir::Files|QDir::NoDotAndDotDot)); + for (int i = 0; i < entries.count(); ++i) + if (entries[i].isDir()) + removeRecursive(entries[i].filePath()); + else + dir.remove(entries[i].fileName()); + QDir().rmdir(dirname); +} + +void tst_qfxwebview::cleanupTestCase() +{ + removeRecursive(tmpDir()); +} + +void tst_qfxwebview::checkNoErrors(const QmlComponent& component) +{ + if (component.isError()) { + QList errors = component.errors(); + for (int ii = 0; ii < errors.count(); ++ii) { + const QmlError &error = errors.at(ii); + QByteArray errorStr = QByteArray::number(error.line()) + ":" + + QByteArray::number(error.column()) + ":" + + error.description().toUtf8(); + qWarning() << errorStr; + } + } + QVERIFY(!component.isError()); +} + +void tst_qfxwebview::basicProperties() +{ + QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/basic.qml")); + checkNoErrors(component); + QWebSettings::enablePersistentStorage(tmpDir()); + + QmlGraphicsWebView *wv = qobject_cast(component.create()); + QVERIFY(wv != 0); + QTRY_COMPARE(wv->progress(), 1.0); + QCOMPARE(wv->title(),QString("Basic")); + QTRY_COMPARE(wv->icon().width(), 48); + QCOMPARE(wv->icon(),QPixmap(SRCDIR "/data/basic.png")); + QCOMPARE(wv->statusText(),QString("")); + QFile htmlfile(SRCDIR "/data/basic.html"); + QVERIFY(htmlfile.open(QIODevice::ReadOnly)); + QString actualhtml____ = wv->html(); // "____" is to make errors line up for easier reading + QString expectedhtml = htmlfile.readAll(); + actualhtml____.replace(QRegExp("\\s+"),""); + expectedhtml.replace(QRegExp("\\s+"),""); + QCOMPARE(actualhtml____,expectedhtml); // same, ignoring whitespace + QCOMPARE(wv->width(), 123.0); + QCOMPARE(wv->webPageWidth(), 0); + QCOMPARE(wv->preferredWidth(), 0); + QCOMPARE(wv->zoomFactor(), 1.0); + QCOMPARE(wv->url(), QUrl::fromLocalFile(SRCDIR "/data/basic.html")); + QCOMPARE(wv->status(), QmlGraphicsWebView::Ready); + QVERIFY(wv->reloadAction()); + QVERIFY(wv->reloadAction()->isEnabled()); + QVERIFY(wv->backAction()); + QVERIFY(!wv->backAction()->isEnabled()); + QVERIFY(wv->forwardAction()); + QVERIFY(!wv->forwardAction()->isEnabled()); + QVERIFY(wv->stopAction()); + QVERIFY(!wv->stopAction()->isEnabled()); +} + +void tst_qfxwebview::setHtml() +{ + QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/sethtml.qml")); + checkNoErrors(component); + QmlGraphicsWebView *wv = qobject_cast(component.create()); + QVERIFY(wv != 0); + QCOMPARE(wv->html(),QString("

This is a string set on the WebView

")); +} + +QTEST_MAIN(tst_qfxwebview) + +#include "tst_qfxwebview.moc" -- cgit v0.12 From f528ab987a8d91e1f3f4049b754a008f1ffdd946 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 6 Nov 2009 11:03:57 +1000 Subject: rename --- .../qmlgraphicswebview/tst_qmlgraphicswebview.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp index a8a0854..346bdc7 100644 --- a/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp +++ b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp @@ -48,11 +48,11 @@ #include #include -class tst_qfxwebview : public QObject +class tst_qmlgraphicswebview : public QObject { Q_OBJECT public: - tst_qfxwebview() {} + tst_qmlgraphicswebview() {} private slots: void basicProperties(); @@ -65,7 +65,7 @@ private: QmlEngine engine; QString tmpDir() const { - static QString tmpd = QDir::tempPath()+"/tst_qfxwebview-" + static QString tmpd = QDir::tempPath()+"/tst_qmlgraphicswebview-" + QDateTime::currentDateTime().toString(QLatin1String("yyyyMMddhhmmss")); return tmpd; } @@ -83,12 +83,12 @@ void removeRecursive(const QString& dirname) QDir().rmdir(dirname); } -void tst_qfxwebview::cleanupTestCase() +void tst_qmlgraphicswebview::cleanupTestCase() { removeRecursive(tmpDir()); } -void tst_qfxwebview::checkNoErrors(const QmlComponent& component) +void tst_qmlgraphicswebview::checkNoErrors(const QmlComponent& component) { if (component.isError()) { QList errors = component.errors(); @@ -103,7 +103,7 @@ void tst_qfxwebview::checkNoErrors(const QmlComponent& component) QVERIFY(!component.isError()); } -void tst_qfxwebview::basicProperties() +void tst_qmlgraphicswebview::basicProperties() { QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/basic.qml")); checkNoErrors(component); @@ -139,7 +139,7 @@ void tst_qfxwebview::basicProperties() QVERIFY(!wv->stopAction()->isEnabled()); } -void tst_qfxwebview::setHtml() +void tst_qmlgraphicswebview::setHtml() { QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/sethtml.qml")); checkNoErrors(component); @@ -148,6 +148,6 @@ void tst_qfxwebview::setHtml() QCOMPARE(wv->html(),QString("

This is a string set on the WebView

")); } -QTEST_MAIN(tst_qfxwebview) +QTEST_MAIN(tst_qmlgraphicswebview) -#include "tst_qfxwebview.moc" +#include "tst_qmlgraphicswebview.moc" -- cgit v0.12 From cf6bc08676638b01c0f8a40e001b8fb303aaa5f5 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 6 Nov 2009 11:05:50 +1000 Subject: Update semantics of targets/properties and target/property. This is in preparation for renaming targets -> matchTargets and properties to matchProperties. --- demos/declarative/flickr/flickr-desktop.qml | 2 +- demos/declarative/flickr/mobile/GridDelegate.qml | 2 +- demos/declarative/webbrowser/webbrowser.qml | 2 +- src/declarative/util/qmlanimation.cpp | 141 ++++++++++++--------- .../declarative/animations/data/badproperty1.qml | 2 +- .../auto/declarative/animations/tst_animations.cpp | 5 +- 6 files changed, 86 insertions(+), 68 deletions(-) diff --git a/demos/declarative/flickr/flickr-desktop.qml b/demos/declarative/flickr/flickr-desktop.qml index 337f77c..6dd12eb 100644 --- a/demos/declarative/flickr/flickr-desktop.qml +++ b/demos/declarative/flickr/flickr-desktop.qml @@ -92,7 +92,7 @@ Item { SequentialAnimation { ParentAction { } NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" } - PropertyAction { target: wrapper; properties: "z" } + PropertyAction { targets: wrapper; properties: "z" } } } ] diff --git a/demos/declarative/flickr/mobile/GridDelegate.qml b/demos/declarative/flickr/mobile/GridDelegate.qml index 9b9fb24..6c12896 100644 --- a/demos/declarative/flickr/mobile/GridDelegate.qml +++ b/demos/declarative/flickr/mobile/GridDelegate.qml @@ -62,7 +62,7 @@ SequentialAnimation { ParentAction { } NumberAnimation { properties: "x,y"; duration: 500; easing: "easeInOutQuad" } - PropertyAction { target: wrapper; properties: "z" } + PropertyAction { targets: wrapper; properties: "z" } } } ] diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml index cfc2aa7..6cce4c3 100644 --- a/demos/declarative/webbrowser/webbrowser.qml +++ b/demos/declarative/webbrowser/webbrowser.qml @@ -149,7 +149,7 @@ Item { transitions: [ Transition { NumberAnimation { - target: header + targets: header properties: "progressOff" easing: "easeInOutQuad" duration: 300 diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp index bd4c6f7..20e13af 100644 --- a/src/declarative/util/qmlanimation.cpp +++ b/src/declarative/util/qmlanimation.cpp @@ -1014,19 +1014,26 @@ void QmlPropertyAction::transition(QmlStateActions &actions, QStringList props = d->properties.isEmpty() ? QStringList() : d->properties.split(QLatin1Char(',')); for (int ii = 0; ii < props.count(); ++ii) props[ii] = props.at(ii).trimmed(); - if (!d->propertyName.isEmpty() && !props.contains(d->propertyName)) - props.append(d->propertyName); - - bool targetNeedsReset = false; - if (d->userProperty.isValid() && props.isEmpty() && !target()) { - props.append(d->userProperty.value.name()); - d->target = d->userProperty.value.object(); - targetNeedsReset = true; - } + + bool hasSelectors = !props.isEmpty() || !d->targets.isEmpty() || !d->exclude.isEmpty(); + bool hasTarget = !d->propertyName.isEmpty() || d->target; + + if (hasSelectors && hasTarget) { + qmlInfo(tr("targets/properties/exclude and target/property are mutually exclusive."), this); + return; + } QmlSetPropertyAnimationAction *data = new QmlSetPropertyAnimationAction; - QSet objs; + if (hasTarget && d->value.isValid()) { + Action myAction; + myAction.property = d->createProperty(target(), d->propertyName); + if (myAction.property.isValid()) { + myAction.toValue = d->value; + data->actions << myAction; + } + } + for (int ii = 0; ii < actions.count(); ++ii) { Action &action = actions[ii]; @@ -1038,9 +1045,7 @@ void QmlPropertyAction::transition(QmlStateActions &actions, if ((d->targets.isEmpty() || d->targets.contains(obj) || (!same && d->targets.contains(sObj))) && (!d->exclude.contains(obj)) && (same || (!d->exclude.contains(sObj))) && - (props.contains(propertyName) || (!same && props.contains(sPropertyName))) && - (!target() || target() == obj || (!same && target() == sObj))) { - objs.insert(obj); + (props.contains(propertyName) || (!same && props.contains(sPropertyName)))) { Action myAction = action; if (d->value.isValid()) @@ -1049,18 +1054,20 @@ void QmlPropertyAction::transition(QmlStateActions &actions, modified << action.property; data->actions << myAction; action.fromValue = myAction.toValue; - } - } + } else if (d->userProperty.isValid() && + !hasSelectors && !hasTarget) { + if ((d->userProperty.value.object() == obj || (!same && d->userProperty.value.object() == sObj)) && + (d->userProperty.value.name() == propertyName || (!same && d->userProperty.value.name() == sPropertyName))) { + //### same as above. merge + Action myAction = action; - if (d->value.isValid() && target() && !objs.contains(target())) { - QObject *obj = target(); - for (int jj = 0; jj < props.count(); ++jj) { - Action myAction; - myAction.property = d->createProperty(obj, props.at(jj)); - if (!myAction.property.isValid()) - continue; - myAction.toValue = d->value; - data->actions << myAction; + if (d->value.isValid()) + myAction.toValue = d->value; + + modified << action.property; + data->actions << myAction; + action.fromValue = myAction.toValue; + } } } @@ -1069,8 +1076,6 @@ void QmlPropertyAction::transition(QmlStateActions &actions, } else { delete data; } - if (targetNeedsReset) - d->target = 0; } QML_DEFINE_TYPE(Qt,4,6,PropertyAction,QmlPropertyAction) @@ -1933,24 +1938,37 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions, QStringList props = d->properties.isEmpty() ? QStringList() : d->properties.split(QLatin1Char(',')); for (int ii = 0; ii < props.count(); ++ii) props[ii] = props.at(ii).trimmed(); - if (!d->propertyName.isEmpty() && !props.contains(d->propertyName)) - props.append(d->propertyName); - bool useType = (props.isEmpty() && d->defaultToInterpolatorType) ? true : false; + bool hasSelectors = !props.isEmpty() || !d->targets.isEmpty() || !d->exclude.isEmpty(); + bool hasTarget = !d->propertyName.isEmpty() || d->target; - bool targetNeedsReset = false; - if (d->userProperty.isValid() && props.isEmpty() && !target()) { - props.append(d->userProperty.value.name()); - d->target = d->userProperty.value.object(); - targetNeedsReset = true; + if (hasSelectors && hasTarget) { + qmlInfo(tr("targets/properties/exclude and target/property are mutually exclusive."), this); + return; } + bool useType = (props.isEmpty() && d->propertyName.isEmpty() && d->defaultToInterpolatorType) ? true : false; + PropertyUpdater *data = new PropertyUpdater; data->interpolatorType = d->interpolatorType; data->interpolator = d->interpolator; data->reverse = direction == Backward ? true : false; - QSet objs; + //an explicit animation has been specified + if (hasTarget && d->toIsDefined) { + Action myAction; + myAction.property = d->createProperty(target(), d->propertyName); + if (myAction.property.isValid()) { + if (d->fromIsDefined) { + d->convertVariant(d->from, d->interpolatorType ? d->interpolatorType : myAction.property.propertyType()); + myAction.fromValue = d->from; + } + d->convertVariant(d->to, d->interpolatorType ? d->interpolatorType : myAction.property.propertyType()); + myAction.toValue = d->to; + data->actions << myAction; + } + } + for (int ii = 0; ii < actions.count(); ++ii) { Action &action = actions[ii]; @@ -1963,16 +1981,13 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions, if ((d->targets.isEmpty() || d->targets.contains(obj) || (!same && d->targets.contains(sObj))) && (!d->exclude.contains(obj)) && (same || (!d->exclude.contains(sObj))) && (props.contains(propertyName) || (!same && props.contains(sPropertyName)) - || (useType && action.property.propertyType() == d->interpolatorType)) && - (!target() || target() == obj || (!same && target() == sObj))) { - objs.insert(obj); + || (useType && action.property.propertyType() == d->interpolatorType))) { Action myAction = action; - if (d->fromIsDefined) { + if (d->fromIsDefined) myAction.fromValue = d->from; - } else { + else myAction.fromValue = QVariant(); - } if (d->toIsDefined) myAction.toValue = d->to; @@ -1983,25 +1998,29 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions, data->actions << myAction; action.fromValue = myAction.toValue; - } - } - - if (d->toIsDefined && target() && !objs.contains(target())) { - QObject *obj = target(); - for (int jj = 0; jj < props.count(); ++jj) { - Action myAction; - myAction.property = d->createProperty(obj, props.at(jj)); - if (!myAction.property.isValid()) - continue; - - if (d->fromIsDefined) { - d->convertVariant(d->from, d->interpolatorType ? d->interpolatorType : myAction.property.propertyType()); - myAction.fromValue = d->from; - } - d->convertVariant(d->to, d->interpolatorType ? d->interpolatorType : myAction.property.propertyType()); - myAction.toValue = d->to; - data->actions << myAction; - } + } else if (d->userProperty.isValid() && + !hasSelectors && !hasTarget) { + if ((d->userProperty.value.object() == obj || (!same && d->userProperty.value.object() == sObj)) && + (d->userProperty.value.name() == propertyName || (!same && d->userProperty.value.name() == sPropertyName))) { + //### same as above. merge + Action myAction = action; + + if (d->fromIsDefined) + myAction.fromValue = d->from; + else + myAction.fromValue = QVariant(); + if (d->toIsDefined) + myAction.toValue = d->to; + + d->convertVariant(myAction.fromValue, d->interpolatorType ? d->interpolatorType : myAction.property.propertyType()); + d->convertVariant(myAction.toValue, d->interpolatorType ? d->interpolatorType : myAction.property.propertyType()); + + modified << action.property; + + data->actions << myAction; + action.fromValue = myAction.toValue; + } + } } if (data->actions.count()) { @@ -2009,8 +2028,6 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions, } else { delete data; } - if (targetNeedsReset) - d->target = 0; } QML_DEFINE_TYPE(Qt,4,6,PropertyAnimation,QmlPropertyAnimation) diff --git a/tests/auto/declarative/animations/data/badproperty1.qml b/tests/auto/declarative/animations/data/badproperty1.qml index 78da34a..df1a98d 100644 --- a/tests/auto/declarative/animations/data/badproperty1.qml +++ b/tests/auto/declarative/animations/data/badproperty1.qml @@ -19,6 +19,6 @@ Rectangle { PropertyChanges { target: MyRect; border.color: "blue" } } transitions: Transition { - ColorAnimation { target: MyRect; to: "red"; properties: "pen.colr"; duration: 1000 } + ColorAnimation { target: MyRect; to: "red"; property: "pen.colr"; duration: 1000 } } } diff --git a/tests/auto/declarative/animations/tst_animations.cpp b/tests/auto/declarative/animations/tst_animations.cpp index ca383bb..418a3dc 100644 --- a/tests/auto/declarative/animations/tst_animations.cpp +++ b/tests/auto/declarative/animations/tst_animations.cpp @@ -198,11 +198,12 @@ void tst_animations::badProperties() { QmlEngine engine; QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/badproperty1.qml")); + QTest::ignoreMessage(QtWarningMsg, "QML QmlColorAnimation (file://" SRCDIR "/data/badproperty1.qml:22:9) Cannot animate non-existant property \"pen.colr\""); QmlGraphicsRectangle *rect = qobject_cast(c.create()); QVERIFY(rect); - QTest::ignoreMessage(QtWarningMsg, "QML QmlColorAnimation (file://" SRCDIR "/data/badproperty1.qml:22:9) Cannot animate non-existant property \"pen.colr\""); - rect->setState("state1"); + //### should we warn here are well? + //rect->setState("state1"); } } -- cgit v0.12 From f18031dba7860289342a0d11ead1d2b20c971664 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 6 Nov 2009 11:11:35 +1000 Subject: qmlinfo test --- src/declarative/qml/qmlinfo.cpp | 12 +- tests/auto/declarative/declarative.pro | 1 + .../auto/declarative/qmlinfo/data/NestedObject.qml | 8 ++ .../declarative/qmlinfo/data/nestedQmlObject.qml | 8 ++ tests/auto/declarative/qmlinfo/data/qmlObject.qml | 8 ++ tests/auto/declarative/qmlinfo/qmlinfo.pro | 7 ++ tests/auto/declarative/qmlinfo/tst_qmlinfo.cpp | 139 +++++++++++++++++++++ 7 files changed, 177 insertions(+), 6 deletions(-) create mode 100644 tests/auto/declarative/qmlinfo/data/NestedObject.qml create mode 100644 tests/auto/declarative/qmlinfo/data/nestedQmlObject.qml create mode 100644 tests/auto/declarative/qmlinfo/data/qmlObject.qml create mode 100644 tests/auto/declarative/qmlinfo/qmlinfo.pro create mode 100644 tests/auto/declarative/qmlinfo/tst_qmlinfo.cpp diff --git a/src/declarative/qml/qmlinfo.cpp b/src/declarative/qml/qmlinfo.cpp index c0d9eca..f62f5fd 100644 --- a/src/declarative/qml/qmlinfo.cpp +++ b/src/declarative/qml/qmlinfo.cpp @@ -80,18 +80,18 @@ void qmlInfo(const QString& msg, QObject* object) pos += QLatin1Char(' '); pos += QLatin1String(object->metaObject()->className()); } - QmlDeclarativeData *ddata = QmlDeclarativeData::get(object); + QmlDeclarativeData *ddata = object?QmlDeclarativeData::get(object):0; pos += QLatin1String(" ("); if (ddata) { if (ddata->outerContext) { pos += ddata->outerContext->baseUrl().toString(); + pos += QLatin1String(":"); + pos += QString::number(ddata->lineNumber); + pos += QLatin1String(":"); + pos += QString::number(ddata->columnNumber); } else { - pos += qApp->translate("QmlInfo","unknown"); + pos += qApp->translate("QmlInfo","unknown location"); } - pos += QLatin1String(":"); - pos += QString::number(ddata->lineNumber); - pos += QLatin1String(":"); - pos += QString::number(ddata->columnNumber); } else { pos += qApp->translate("QmlInfo","unknown location"); } diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 716d278..5fafb7d 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -24,6 +24,7 @@ SUBDIRS += \ qmlgraphicsborderimage \ # Cover qmlgraphicsparticles \ # Cover qmlgraphicstext \ # Cover + qmlinfo \ # Cover qmllanguage \ # Cover qmllist \ # Cover qmllistaccessor \ # Cover diff --git a/tests/auto/declarative/qmlinfo/data/NestedObject.qml b/tests/auto/declarative/qmlinfo/data/NestedObject.qml new file mode 100644 index 0000000..ac96d20 --- /dev/null +++ b/tests/auto/declarative/qmlinfo/data/NestedObject.qml @@ -0,0 +1,8 @@ +import Qt 4.6 + +Object { + property var nested + + nested: Object {} +} + diff --git a/tests/auto/declarative/qmlinfo/data/nestedQmlObject.qml b/tests/auto/declarative/qmlinfo/data/nestedQmlObject.qml new file mode 100644 index 0000000..ee98354 --- /dev/null +++ b/tests/auto/declarative/qmlinfo/data/nestedQmlObject.qml @@ -0,0 +1,8 @@ +import Qt 4.6 + +Object { + property var nested + nested: NestedObject { } + property var nested2: nested.nested +} + diff --git a/tests/auto/declarative/qmlinfo/data/qmlObject.qml b/tests/auto/declarative/qmlinfo/data/qmlObject.qml new file mode 100644 index 0000000..b86063b --- /dev/null +++ b/tests/auto/declarative/qmlinfo/data/qmlObject.qml @@ -0,0 +1,8 @@ +import Qt 4.6 + +Object { + property var nested + + nested: Object { + } +} diff --git a/tests/auto/declarative/qmlinfo/qmlinfo.pro b/tests/auto/declarative/qmlinfo/qmlinfo.pro new file mode 100644 index 0000000..dbebf92 --- /dev/null +++ b/tests/auto/declarative/qmlinfo/qmlinfo.pro @@ -0,0 +1,7 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + +SOURCES += tst_qmlinfo.cpp + +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qmlinfo/tst_qmlinfo.cpp b/tests/auto/declarative/qmlinfo/tst_qmlinfo.cpp new file mode 100644 index 0000000..8241045 --- /dev/null +++ b/tests/auto/declarative/qmlinfo/tst_qmlinfo.cpp @@ -0,0 +1,139 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include +#include + +class tst_qmlinfo : public QObject +{ + Q_OBJECT +public: + tst_qmlinfo() {} + +private slots: + void qmlObject(); + void nestedQmlObject(); + void nonQmlObject(); + void nullObject(); + void nonQmlContextedObject(); + +private: + QmlEngine engine; +}; + +inline QUrl TEST_FILE(const QString &filename) +{ + return QUrl::fromLocalFile(QLatin1String(SRCDIR) + QLatin1String("/data/") + filename); +} + +void tst_qmlinfo::qmlObject() +{ + QmlComponent component(&engine, TEST_FILE("qmlObject.qml")); + + QObject *object = component.create(); + QVERIFY(object != 0); + + QString message = "QML " + QString(object->metaObject()->className()) + " (" + component.url().toString() + ":3:1) Test Message"; + QTest::ignoreMessage(QtWarningMsg, qPrintable(message)); + qmlInfo("Test Message", object); + + QObject *nested = qvariant_cast(object->property("nested")); + QVERIFY(nested != 0); + + message = "QML " + QString(nested->metaObject()->className()) + " (" + component.url().toString() + ":6:13) Second Test Message"; + QTest::ignoreMessage(QtWarningMsg, qPrintable(message)); + qmlInfo("Second Test Message", nested); +} + +void tst_qmlinfo::nestedQmlObject() +{ + QmlComponent component(&engine, TEST_FILE("nestedQmlObject.qml")); + + QObject *object = component.create(); + QVERIFY(object != 0); + + QObject *nested = qvariant_cast(object->property("nested")); + QVERIFY(nested != 0); + QObject *nested2 = qvariant_cast(object->property("nested2")); + QVERIFY(nested2 != 0); + + QString message = "QML " + QString(nested->metaObject()->className()) + " (" + component.url().toString() + ":5:13) Outer Object"; + QTest::ignoreMessage(QtWarningMsg, qPrintable(message)); + qmlInfo("Outer Object", nested); + + message = "QML " + QString(nested2->metaObject()->className()) + " (" + TEST_FILE("NestedObject.qml").toString() + ":6:14) Inner Object"; + QTest::ignoreMessage(QtWarningMsg, qPrintable(message)); + qmlInfo("Inner Object", nested2); +} + +void tst_qmlinfo::nonQmlObject() +{ + QObject object; + QTest::ignoreMessage(QtWarningMsg, "QML QObject (unknown location) Test Message"); + qmlInfo("Test Message", &object); + + QPushButton pbObject; + QTest::ignoreMessage(QtWarningMsg, "QML QPushButton (unknown location) Test Message"); + qmlInfo("Test Message", &pbObject); +} + +void tst_qmlinfo::nullObject() +{ + QTest::ignoreMessage(QtWarningMsg, "QML (unknown location) Null Object Test Message"); + qmlInfo("Null Object Test Message", 0); +} + +void tst_qmlinfo::nonQmlContextedObject() +{ + QObject object; + QmlContext context(&engine); + QmlEngine::setContextForObject(&object, &context); + QTest::ignoreMessage(QtWarningMsg, "QML QObject (unknown location) Test Message"); + qmlInfo("Test Message", &object); +} + +QTEST_MAIN(tst_qmlinfo) + +#include "tst_qmlinfo.moc" -- cgit v0.12 From ee124413c936072688477794144e431fb61f8d76 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 6 Nov 2009 11:23:32 +1000 Subject: renaming add zooming test --- .../webview/javascript/data/windowObjects.0.png | Bin 0 -> 7991 bytes .../webview/javascript/data/windowObjects.1.png | Bin 0 -> 7991 bytes .../webview/javascript/data/windowObjects.2.png | Bin 0 -> 7643 bytes .../webview/javascript/data/windowObjects.3.png | Bin 0 -> 7733 bytes .../webview/javascript/data/windowObjects.4.png | Bin 0 -> 8116 bytes .../webview/javascript/data/windowObjects.qml | 2643 ++++++++++++++++++++ .../visual/webview/javascript/test-objects.html | 12 + .../visual/webview/javascript/windowObjects.qml | 26 + .../webview/settings/data/windowObjects.0.png | Bin 7991 -> 0 bytes .../webview/settings/data/windowObjects.1.png | Bin 7991 -> 0 bytes .../webview/settings/data/windowObjects.2.png | Bin 7643 -> 0 bytes .../webview/settings/data/windowObjects.3.png | Bin 7733 -> 0 bytes .../webview/settings/data/windowObjects.4.png | Bin 8116 -> 0 bytes .../visual/webview/settings/data/windowObjects.qml | 2643 -------------------- .../visual/webview/settings/test-objects.html | 12 - .../visual/webview/settings/windowObjects.qml | 26 - .../visual/webview/zooming/data/resolution.0.png | Bin 0 -> 6275 bytes .../visual/webview/zooming/data/resolution.1.png | Bin 0 -> 3553 bytes .../visual/webview/zooming/data/resolution.2.png | Bin 0 -> 5838 bytes .../visual/webview/zooming/data/resolution.3.png | Bin 0 -> 8005 bytes .../visual/webview/zooming/data/resolution.4.png | Bin 0 -> 6087 bytes .../visual/webview/zooming/data/resolution.qml | 1319 ++++++++++ .../declarative/visual/webview/zooming/qtlogo.png | Bin 0 -> 2738 bytes .../visual/webview/zooming/resolution.html | 6 + .../visual/webview/zooming/resolution.qml | 17 + 25 files changed, 4023 insertions(+), 2681 deletions(-) create mode 100644 tests/auto/declarative/visual/webview/javascript/data/windowObjects.0.png create mode 100644 tests/auto/declarative/visual/webview/javascript/data/windowObjects.1.png create mode 100644 tests/auto/declarative/visual/webview/javascript/data/windowObjects.2.png create mode 100644 tests/auto/declarative/visual/webview/javascript/data/windowObjects.3.png create mode 100644 tests/auto/declarative/visual/webview/javascript/data/windowObjects.4.png create mode 100644 tests/auto/declarative/visual/webview/javascript/data/windowObjects.qml create mode 100644 tests/auto/declarative/visual/webview/javascript/test-objects.html create mode 100644 tests/auto/declarative/visual/webview/javascript/windowObjects.qml delete mode 100644 tests/auto/declarative/visual/webview/settings/data/windowObjects.0.png delete mode 100644 tests/auto/declarative/visual/webview/settings/data/windowObjects.1.png delete mode 100644 tests/auto/declarative/visual/webview/settings/data/windowObjects.2.png delete mode 100644 tests/auto/declarative/visual/webview/settings/data/windowObjects.3.png delete mode 100644 tests/auto/declarative/visual/webview/settings/data/windowObjects.4.png delete mode 100644 tests/auto/declarative/visual/webview/settings/data/windowObjects.qml delete mode 100644 tests/auto/declarative/visual/webview/settings/test-objects.html delete mode 100644 tests/auto/declarative/visual/webview/settings/windowObjects.qml create mode 100644 tests/auto/declarative/visual/webview/zooming/data/resolution.0.png create mode 100644 tests/auto/declarative/visual/webview/zooming/data/resolution.1.png create mode 100644 tests/auto/declarative/visual/webview/zooming/data/resolution.2.png create mode 100644 tests/auto/declarative/visual/webview/zooming/data/resolution.3.png create mode 100644 tests/auto/declarative/visual/webview/zooming/data/resolution.4.png create mode 100644 tests/auto/declarative/visual/webview/zooming/data/resolution.qml create mode 100644 tests/auto/declarative/visual/webview/zooming/qtlogo.png create mode 100644 tests/auto/declarative/visual/webview/zooming/resolution.html create mode 100644 tests/auto/declarative/visual/webview/zooming/resolution.qml diff --git a/tests/auto/declarative/visual/webview/javascript/data/windowObjects.0.png b/tests/auto/declarative/visual/webview/javascript/data/windowObjects.0.png new file mode 100644 index 0000000..b5c35d2 Binary files /dev/null and b/tests/auto/declarative/visual/webview/javascript/data/windowObjects.0.png differ diff --git a/tests/auto/declarative/visual/webview/javascript/data/windowObjects.1.png b/tests/auto/declarative/visual/webview/javascript/data/windowObjects.1.png new file mode 100644 index 0000000..b5c35d2 Binary files /dev/null and b/tests/auto/declarative/visual/webview/javascript/data/windowObjects.1.png differ diff --git a/tests/auto/declarative/visual/webview/javascript/data/windowObjects.2.png b/tests/auto/declarative/visual/webview/javascript/data/windowObjects.2.png new file mode 100644 index 0000000..28403c8 Binary files /dev/null and b/tests/auto/declarative/visual/webview/javascript/data/windowObjects.2.png differ diff --git a/tests/auto/declarative/visual/webview/javascript/data/windowObjects.3.png b/tests/auto/declarative/visual/webview/javascript/data/windowObjects.3.png new file mode 100644 index 0000000..241b9f8 Binary files /dev/null and b/tests/auto/declarative/visual/webview/javascript/data/windowObjects.3.png differ diff --git a/tests/auto/declarative/visual/webview/javascript/data/windowObjects.4.png b/tests/auto/declarative/visual/webview/javascript/data/windowObjects.4.png new file mode 100644 index 0000000..1877cb2 Binary files /dev/null and b/tests/auto/declarative/visual/webview/javascript/data/windowObjects.4.png differ diff --git a/tests/auto/declarative/visual/webview/javascript/data/windowObjects.qml b/tests/auto/declarative/visual/webview/javascript/data/windowObjects.qml new file mode 100644 index 0000000..7fce295 --- /dev/null +++ b/tests/auto/declarative/visual/webview/javascript/data/windowObjects.qml @@ -0,0 +1,2643 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 32 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 48 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 64 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 80 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 96 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 112 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 128 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 144 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 160 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 176 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 192 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 208 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 224 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 240 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 256 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 272 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 288 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 304 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 320 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 336 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 352 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 368 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 384 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 400 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 416 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 432 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 448 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 464 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 480 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 496 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 512 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 528 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 544 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 560 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 576 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 592 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 608 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 624 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 640 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 656 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 672 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 688 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 704 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 720 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 736 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 752 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 768 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 784 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 800 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 816 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 832 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 848 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 864 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 880 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 896 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 912 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 928 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 944 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 960 + image: "windowObjects.0.png" + } + Frame { + msec: 976 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 992 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1008 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1024 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1040 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 155; y: 9 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 145; y: 23 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1056 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 137; y: 37 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 127; y: 53 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1072 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 119; y: 67 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 111; y: 77 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1088 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 103; y: 87 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1104 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 97; y: 93 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 91; y: 101 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 87; y: 109 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1120 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 83; y: 117 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 81; y: 125 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1136 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 81; y: 133 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 79; y: 139 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1152 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 79; y: 142 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 79; y: 145 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1168 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 78; y: 146 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 78; y: 147 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1184 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1200 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1216 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1232 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1248 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 82; y: 143 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1264 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1280 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 83; y: 142 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 83; y: 141 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 84; y: 139 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1296 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 85; y: 138 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1312 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1328 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1344 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 86; y: 137 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 87; y: 137 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1360 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 88; y: 137 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1376 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 89; y: 138 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 89; y: 139 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1392 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 90; y: 141 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 90; y: 142 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1408 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 91; y: 144 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1424 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 91; y: 146 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 91; y: 148 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 91; y: 149 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1440 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 91; y: 151 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 91; y: 153 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1456 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 90; y: 154 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 90; y: 155 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1472 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 89; y: 156 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1488 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1504 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1520 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1536 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1552 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1568 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1584 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1600 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1616 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1632 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1648 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1664 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1680 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1696 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1712 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1728 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1744 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1760 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1776 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1792 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1808 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1824 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1840 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1856 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1872 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1888 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1904 + hash: "b1a19797afefa71e30f4594064aa4951" + } + Frame { + msec: 1920 + image: "windowObjects.1.png" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 89; y: 156 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1936 + hash: "fca76207a4fa6f2c4bb01d28aa018f0c" + } + Frame { + msec: 1952 + hash: "fca76207a4fa6f2c4bb01d28aa018f0c" + } + Frame { + msec: 1968 + hash: "fca76207a4fa6f2c4bb01d28aa018f0c" + } + Frame { + msec: 1984 + hash: "fca76207a4fa6f2c4bb01d28aa018f0c" + } + Frame { + msec: 2000 + hash: "fca76207a4fa6f2c4bb01d28aa018f0c" + } + Frame { + msec: 2016 + hash: "fca76207a4fa6f2c4bb01d28aa018f0c" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 89; y: 156 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2032 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2048 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2064 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2080 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2096 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2112 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2128 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2144 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2160 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2176 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2192 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2208 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2224 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2240 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2256 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2272 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2288 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 89; y: 157 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 88; y: 158 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 87; y: 160 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2304 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 87; y: 161 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 83; y: 167 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2320 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 82; y: 169 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 80; y: 175 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2336 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 78; y: 183 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 74; y: 189 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2352 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 72; y: 195 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 68; y: 201 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2368 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 64; y: 207 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 62; y: 213 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2384 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 61; y: 215 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 59; y: 221 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2400 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 58; y: 222 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 57; y: 224 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2416 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2432 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2448 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2464 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2480 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2496 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2512 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2528 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2544 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2560 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2576 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2592 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2608 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2624 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2640 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2656 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2672 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2688 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2704 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2720 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2736 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 49; y: 225 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 50; y: 224 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2752 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 50; y: 223 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2768 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 51; y: 222 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2784 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 51; y: 221 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 52; y: 220 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2800 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 52; y: 218 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2816 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 53; y: 217 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2832 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2848 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2864 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 54; y: 216 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2880 + image: "windowObjects.2.png" + } + Frame { + msec: 2896 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 55; y: 215 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2912 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2928 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 56; y: 214 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2944 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2960 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 2976 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 57; y: 214 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 57; y: 214 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2992 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3008 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3024 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3040 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3056 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3072 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3088 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3104 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 57; y: 214 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3120 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3136 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3152 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3168 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3184 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3200 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3216 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Frame { + msec: 3232 + hash: "6927f81ca01ef75d204994aa82c60c4d" + } + Key { + type: 6 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 3248 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Frame { + msec: 3264 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Frame { + msec: 3280 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Frame { + msec: 3296 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Key { + type: 7 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 3312 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Frame { + msec: 3328 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Frame { + msec: 3344 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Frame { + msec: 3360 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 57; y: 212 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3376 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Frame { + msec: 3392 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Frame { + msec: 3408 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 57; y: 211 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3424 + hash: "2165224e8f66a797ae5c991462fb56d8" + } + Key { + type: 6 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 3440 + hash: "c6ac7e0be8b7b2a80966344389def97a" + } + Frame { + msec: 3456 + hash: "c6ac7e0be8b7b2a80966344389def97a" + } + Frame { + msec: 3472 + hash: "c6ac7e0be8b7b2a80966344389def97a" + } + Frame { + msec: 3488 + hash: "40f333072bb9f1d334d5ae432d9641b9" + } + Frame { + msec: 3504 + hash: "40f333072bb9f1d334d5ae432d9641b9" + } + Key { + type: 7 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 3520 + hash: "40f333072bb9f1d334d5ae432d9641b9" + } + Frame { + msec: 3536 + hash: "40f333072bb9f1d334d5ae432d9641b9" + } + Frame { + msec: 3552 + hash: "40f333072bb9f1d334d5ae432d9641b9" + } + Frame { + msec: 3568 + hash: "40f333072bb9f1d334d5ae432d9641b9" + } + Frame { + msec: 3584 + hash: "40f333072bb9f1d334d5ae432d9641b9" + } + Frame { + msec: 3600 + hash: "40f333072bb9f1d334d5ae432d9641b9" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 58; y: 210 + modifiers: 0 + sendToViewport: true + } + Key { + type: 6 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 3616 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 60; y: 209 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 61; y: 207 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3632 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 62; y: 205 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3648 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 62; y: 204 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 63; y: 203 + modifiers: 0 + sendToViewport: true + } + Key { + type: 7 + key: 83 + modifiers: 0 + text: "73" + autorep: false + count: 1 + } + Frame { + msec: 3664 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 63; y: 202 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 64; y: 200 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3680 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Frame { + msec: 3696 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 65; y: 198 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 66; y: 197 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 67; y: 195 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3712 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 68; y: 194 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 69; y: 192 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3728 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 70; y: 190 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 70; y: 188 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3744 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 70; y: 186 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 70; y: 185 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3760 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 71; y: 183 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 71; y: 181 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3776 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 72; y: 179 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 73; y: 178 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3792 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 73; y: 176 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 73; y: 175 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3808 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 74; y: 174 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 74; y: 173 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3824 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 74; y: 172 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3840 + image: "windowObjects.3.png" + } + Frame { + msec: 3856 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Frame { + msec: 3872 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Frame { + msec: 3888 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Frame { + msec: 3904 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Frame { + msec: 3920 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 75; y: 171 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 76; y: 171 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3936 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Frame { + msec: 3952 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Frame { + msec: 3968 + hash: "96f727ef0dacfda9ea77fb5651493030" + } + Frame { + msec: 3984 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Frame { + msec: 4000 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Frame { + msec: 4016 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Frame { + msec: 4032 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 76; y: 170 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4048 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 77; y: 169 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 78; y: 168 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4064 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 79; y: 168 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4080 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 81; y: 167 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 81; y: 166 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4096 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 82; y: 165 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4112 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 83; y: 164 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4128 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Frame { + msec: 4144 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Frame { + msec: 4160 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Frame { + msec: 4176 + hash: "ed7b3d93d690df73be5cbee8c41a1931" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 83; y: 164 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4192 + hash: "5b3505be865f704640e81cea092d35ba" + } + Frame { + msec: 4208 + hash: "5b3505be865f704640e81cea092d35ba" + } + Frame { + msec: 4224 + hash: "5b3505be865f704640e81cea092d35ba" + } + Frame { + msec: 4240 + hash: "5b3505be865f704640e81cea092d35ba" + } + Frame { + msec: 4256 + hash: "5b3505be865f704640e81cea092d35ba" + } + Frame { + msec: 4272 + hash: "5b3505be865f704640e81cea092d35ba" + } + Frame { + msec: 4288 + hash: "5b3505be865f704640e81cea092d35ba" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 83; y: 164 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4304 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4320 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4336 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4352 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4368 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4384 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4400 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4416 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4432 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4448 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4464 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 85; y: 158 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 85; y: 156 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4480 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 86; y: 154 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 86; y: 152 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4496 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 87; y: 150 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 89; y: 144 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4512 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 93; y: 138 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 99; y: 134 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4528 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 101; y: 128 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 105; y: 122 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4544 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 109; y: 114 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 113; y: 108 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4560 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 114; y: 106 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 114; y: 105 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4576 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 115; y: 104 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 115; y: 102 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4592 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 115; y: 100 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 116; y: 98 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4608 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 120; y: 92 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 122; y: 86 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4624 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 126; y: 76 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 130; y: 66 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4640 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 132; y: 56 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 134; y: 46 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4656 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 136; y: 38 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 138; y: 30 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4672 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 140; y: 22 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 141; y: 20 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4688 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 143; y: 14 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 144; y: 12 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4704 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 144; y: 11 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 144; y: 9 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4720 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 144; y: 7 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 144; y: 6 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4736 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 143; y: 4 + modifiers: 0 + sendToViewport: true + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 143; y: 2 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4752 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Mouse { + type: 5 + button: 0 + buttons: 0 + x: 143; y: 1 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4768 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4784 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4800 + image: "windowObjects.4.png" + } + Frame { + msec: 4816 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4832 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4848 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4864 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4880 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4896 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4912 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4928 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4944 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4960 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4976 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 4992 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5008 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5024 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5040 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5056 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5072 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5088 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5104 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5120 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5136 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5152 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5168 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5184 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5200 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5216 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5232 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5248 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5264 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5280 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5296 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5312 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5328 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5344 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5360 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5376 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5392 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5408 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5424 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5440 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5456 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5472 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5488 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5504 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5520 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5536 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5552 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5568 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } + Frame { + msec: 5584 + hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" + } +} diff --git a/tests/auto/declarative/visual/webview/javascript/test-objects.html b/tests/auto/declarative/visual/webview/javascript/test-objects.html new file mode 100644 index 0000000..ed7d2ea --- /dev/null +++ b/tests/auto/declarative/visual/webview/javascript/test-objects.html @@ -0,0 +1,12 @@ + + + + +

Boring Document

+

+This is a boring document. +It gets the text on this button: + +from QML. +

diff --git a/tests/auto/declarative/visual/webview/javascript/windowObjects.qml b/tests/auto/declarative/visual/webview/javascript/windowObjects.qml new file mode 100644 index 0000000..f1d4097 --- /dev/null +++ b/tests/auto/declarative/visual/webview/javascript/windowObjects.qml @@ -0,0 +1,26 @@ +import Qt 4.6 + +Column { + WebView { + width: 200 + height: 200 + url: "test-objects.html" + javaScriptWindowObjects: + Object { + property string text: btntext.text + WebView.windowObjectName: "qmltext" + } + } + Row { + Text { text: "Input:" } + Rectangle { + width: btntext.width+10 + height: btntext.height+10 + border.color: "black" + TextInput { + id: btntext + text: "Blah" + } + } + } +} diff --git a/tests/auto/declarative/visual/webview/settings/data/windowObjects.0.png b/tests/auto/declarative/visual/webview/settings/data/windowObjects.0.png deleted file mode 100644 index b5c35d2..0000000 Binary files a/tests/auto/declarative/visual/webview/settings/data/windowObjects.0.png and /dev/null differ diff --git a/tests/auto/declarative/visual/webview/settings/data/windowObjects.1.png b/tests/auto/declarative/visual/webview/settings/data/windowObjects.1.png deleted file mode 100644 index b5c35d2..0000000 Binary files a/tests/auto/declarative/visual/webview/settings/data/windowObjects.1.png and /dev/null differ diff --git a/tests/auto/declarative/visual/webview/settings/data/windowObjects.2.png b/tests/auto/declarative/visual/webview/settings/data/windowObjects.2.png deleted file mode 100644 index 28403c8..0000000 Binary files a/tests/auto/declarative/visual/webview/settings/data/windowObjects.2.png and /dev/null differ diff --git a/tests/auto/declarative/visual/webview/settings/data/windowObjects.3.png b/tests/auto/declarative/visual/webview/settings/data/windowObjects.3.png deleted file mode 100644 index 241b9f8..0000000 Binary files a/tests/auto/declarative/visual/webview/settings/data/windowObjects.3.png and /dev/null differ diff --git a/tests/auto/declarative/visual/webview/settings/data/windowObjects.4.png b/tests/auto/declarative/visual/webview/settings/data/windowObjects.4.png deleted file mode 100644 index 1877cb2..0000000 Binary files a/tests/auto/declarative/visual/webview/settings/data/windowObjects.4.png and /dev/null differ diff --git a/tests/auto/declarative/visual/webview/settings/data/windowObjects.qml b/tests/auto/declarative/visual/webview/settings/data/windowObjects.qml deleted file mode 100644 index 7fce295..0000000 --- a/tests/auto/declarative/visual/webview/settings/data/windowObjects.qml +++ /dev/null @@ -1,2643 +0,0 @@ -import Qt.VisualTest 4.6 - -VisualTest { - Frame { - msec: 0 - } - Frame { - msec: 16 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 32 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 48 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 64 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 80 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 96 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 112 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 128 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 144 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 160 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 176 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 192 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 208 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 224 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 240 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 256 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 272 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 288 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 304 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 320 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 336 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 352 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 368 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 384 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 400 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 416 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 432 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 448 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 464 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 480 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 496 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 512 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 528 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 544 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 560 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 576 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 592 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 608 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 624 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 640 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 656 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 672 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 688 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 704 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 720 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 736 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 752 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 768 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 784 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 800 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 816 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 832 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 848 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 864 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 880 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 896 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 912 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 928 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 944 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 960 - image: "windowObjects.0.png" - } - Frame { - msec: 976 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 992 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1008 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1024 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1040 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 155; y: 9 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 145; y: 23 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1056 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 137; y: 37 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 127; y: 53 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1072 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 119; y: 67 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 111; y: 77 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1088 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 103; y: 87 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1104 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 97; y: 93 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 91; y: 101 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 87; y: 109 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1120 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 83; y: 117 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 81; y: 125 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1136 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 81; y: 133 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 79; y: 139 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1152 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 79; y: 142 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 79; y: 145 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1168 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 78; y: 146 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 78; y: 147 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1184 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1200 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1216 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1232 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1248 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 82; y: 143 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1264 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1280 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 83; y: 142 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 83; y: 141 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 84; y: 139 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1296 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 85; y: 138 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1312 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1328 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1344 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 86; y: 137 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 87; y: 137 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1360 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 88; y: 137 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1376 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 89; y: 138 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 89; y: 139 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1392 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 90; y: 141 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 90; y: 142 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1408 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 91; y: 144 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1424 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 91; y: 146 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 91; y: 148 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 91; y: 149 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1440 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 91; y: 151 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 91; y: 153 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1456 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 90; y: 154 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 90; y: 155 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1472 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 89; y: 156 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1488 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1504 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1520 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1536 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1552 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1568 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1584 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1600 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1616 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1632 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1648 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1664 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1680 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1696 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1712 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1728 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1744 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1760 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1776 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1792 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1808 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1824 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1840 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1856 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1872 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1888 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1904 - hash: "b1a19797afefa71e30f4594064aa4951" - } - Frame { - msec: 1920 - image: "windowObjects.1.png" - } - Mouse { - type: 2 - button: 1 - buttons: 1 - x: 89; y: 156 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 1936 - hash: "fca76207a4fa6f2c4bb01d28aa018f0c" - } - Frame { - msec: 1952 - hash: "fca76207a4fa6f2c4bb01d28aa018f0c" - } - Frame { - msec: 1968 - hash: "fca76207a4fa6f2c4bb01d28aa018f0c" - } - Frame { - msec: 1984 - hash: "fca76207a4fa6f2c4bb01d28aa018f0c" - } - Frame { - msec: 2000 - hash: "fca76207a4fa6f2c4bb01d28aa018f0c" - } - Frame { - msec: 2016 - hash: "fca76207a4fa6f2c4bb01d28aa018f0c" - } - Mouse { - type: 3 - button: 1 - buttons: 0 - x: 89; y: 156 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 2032 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2048 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2064 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2080 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2096 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2112 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2128 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2144 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2160 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2176 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2192 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2208 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2224 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2240 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2256 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2272 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2288 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 89; y: 157 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 88; y: 158 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 87; y: 160 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 2304 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 87; y: 161 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 83; y: 167 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 2320 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 82; y: 169 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 80; y: 175 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 2336 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 78; y: 183 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 74; y: 189 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 2352 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 72; y: 195 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 68; y: 201 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 2368 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 64; y: 207 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 62; y: 213 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 2384 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 61; y: 215 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 59; y: 221 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 2400 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 58; y: 222 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 57; y: 224 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 2416 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2432 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2448 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2464 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2480 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2496 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2512 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2528 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2544 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2560 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2576 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2592 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2608 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2624 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2640 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2656 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2672 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2688 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2704 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2720 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2736 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 49; y: 225 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 50; y: 224 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 2752 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 50; y: 223 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 2768 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 51; y: 222 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 2784 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 51; y: 221 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 52; y: 220 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 2800 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 52; y: 218 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 2816 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 53; y: 217 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 2832 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2848 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2864 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 54; y: 216 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 2880 - image: "windowObjects.2.png" - } - Frame { - msec: 2896 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 55; y: 215 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 2912 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2928 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 56; y: 214 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 2944 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2960 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 2976 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 57; y: 214 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 2 - button: 1 - buttons: 1 - x: 57; y: 214 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 2992 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 3008 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 3024 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 3040 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 3056 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 3072 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 3088 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 3104 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Mouse { - type: 3 - button: 1 - buttons: 0 - x: 57; y: 214 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 3120 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 3136 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 3152 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 3168 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 3184 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 3200 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 3216 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Frame { - msec: 3232 - hash: "6927f81ca01ef75d204994aa82c60c4d" - } - Key { - type: 6 - key: 83 - modifiers: 0 - text: "73" - autorep: false - count: 1 - } - Frame { - msec: 3248 - hash: "2165224e8f66a797ae5c991462fb56d8" - } - Frame { - msec: 3264 - hash: "2165224e8f66a797ae5c991462fb56d8" - } - Frame { - msec: 3280 - hash: "2165224e8f66a797ae5c991462fb56d8" - } - Frame { - msec: 3296 - hash: "2165224e8f66a797ae5c991462fb56d8" - } - Key { - type: 7 - key: 83 - modifiers: 0 - text: "73" - autorep: false - count: 1 - } - Frame { - msec: 3312 - hash: "2165224e8f66a797ae5c991462fb56d8" - } - Frame { - msec: 3328 - hash: "2165224e8f66a797ae5c991462fb56d8" - } - Frame { - msec: 3344 - hash: "2165224e8f66a797ae5c991462fb56d8" - } - Frame { - msec: 3360 - hash: "2165224e8f66a797ae5c991462fb56d8" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 57; y: 212 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 3376 - hash: "2165224e8f66a797ae5c991462fb56d8" - } - Frame { - msec: 3392 - hash: "2165224e8f66a797ae5c991462fb56d8" - } - Frame { - msec: 3408 - hash: "2165224e8f66a797ae5c991462fb56d8" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 57; y: 211 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 3424 - hash: "2165224e8f66a797ae5c991462fb56d8" - } - Key { - type: 6 - key: 83 - modifiers: 0 - text: "73" - autorep: false - count: 1 - } - Frame { - msec: 3440 - hash: "c6ac7e0be8b7b2a80966344389def97a" - } - Frame { - msec: 3456 - hash: "c6ac7e0be8b7b2a80966344389def97a" - } - Frame { - msec: 3472 - hash: "c6ac7e0be8b7b2a80966344389def97a" - } - Frame { - msec: 3488 - hash: "40f333072bb9f1d334d5ae432d9641b9" - } - Frame { - msec: 3504 - hash: "40f333072bb9f1d334d5ae432d9641b9" - } - Key { - type: 7 - key: 83 - modifiers: 0 - text: "73" - autorep: false - count: 1 - } - Frame { - msec: 3520 - hash: "40f333072bb9f1d334d5ae432d9641b9" - } - Frame { - msec: 3536 - hash: "40f333072bb9f1d334d5ae432d9641b9" - } - Frame { - msec: 3552 - hash: "40f333072bb9f1d334d5ae432d9641b9" - } - Frame { - msec: 3568 - hash: "40f333072bb9f1d334d5ae432d9641b9" - } - Frame { - msec: 3584 - hash: "40f333072bb9f1d334d5ae432d9641b9" - } - Frame { - msec: 3600 - hash: "40f333072bb9f1d334d5ae432d9641b9" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 58; y: 210 - modifiers: 0 - sendToViewport: true - } - Key { - type: 6 - key: 83 - modifiers: 0 - text: "73" - autorep: false - count: 1 - } - Frame { - msec: 3616 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 60; y: 209 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 61; y: 207 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 3632 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 62; y: 205 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 3648 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 62; y: 204 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 63; y: 203 - modifiers: 0 - sendToViewport: true - } - Key { - type: 7 - key: 83 - modifiers: 0 - text: "73" - autorep: false - count: 1 - } - Frame { - msec: 3664 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 63; y: 202 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 64; y: 200 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 3680 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Frame { - msec: 3696 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 65; y: 198 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 66; y: 197 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 67; y: 195 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 3712 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 68; y: 194 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 69; y: 192 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 3728 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 70; y: 190 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 70; y: 188 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 3744 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 70; y: 186 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 70; y: 185 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 3760 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 71; y: 183 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 71; y: 181 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 3776 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 72; y: 179 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 73; y: 178 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 3792 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 73; y: 176 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 73; y: 175 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 3808 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 74; y: 174 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 74; y: 173 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 3824 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 74; y: 172 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 3840 - image: "windowObjects.3.png" - } - Frame { - msec: 3856 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Frame { - msec: 3872 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Frame { - msec: 3888 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Frame { - msec: 3904 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Frame { - msec: 3920 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 75; y: 171 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 76; y: 171 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 3936 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Frame { - msec: 3952 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Frame { - msec: 3968 - hash: "96f727ef0dacfda9ea77fb5651493030" - } - Frame { - msec: 3984 - hash: "ed7b3d93d690df73be5cbee8c41a1931" - } - Frame { - msec: 4000 - hash: "ed7b3d93d690df73be5cbee8c41a1931" - } - Frame { - msec: 4016 - hash: "ed7b3d93d690df73be5cbee8c41a1931" - } - Frame { - msec: 4032 - hash: "ed7b3d93d690df73be5cbee8c41a1931" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 76; y: 170 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4048 - hash: "ed7b3d93d690df73be5cbee8c41a1931" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 77; y: 169 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 78; y: 168 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4064 - hash: "ed7b3d93d690df73be5cbee8c41a1931" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 79; y: 168 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4080 - hash: "ed7b3d93d690df73be5cbee8c41a1931" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 81; y: 167 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 81; y: 166 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4096 - hash: "ed7b3d93d690df73be5cbee8c41a1931" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 82; y: 165 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4112 - hash: "ed7b3d93d690df73be5cbee8c41a1931" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 83; y: 164 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4128 - hash: "ed7b3d93d690df73be5cbee8c41a1931" - } - Frame { - msec: 4144 - hash: "ed7b3d93d690df73be5cbee8c41a1931" - } - Frame { - msec: 4160 - hash: "ed7b3d93d690df73be5cbee8c41a1931" - } - Frame { - msec: 4176 - hash: "ed7b3d93d690df73be5cbee8c41a1931" - } - Mouse { - type: 2 - button: 1 - buttons: 1 - x: 83; y: 164 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4192 - hash: "5b3505be865f704640e81cea092d35ba" - } - Frame { - msec: 4208 - hash: "5b3505be865f704640e81cea092d35ba" - } - Frame { - msec: 4224 - hash: "5b3505be865f704640e81cea092d35ba" - } - Frame { - msec: 4240 - hash: "5b3505be865f704640e81cea092d35ba" - } - Frame { - msec: 4256 - hash: "5b3505be865f704640e81cea092d35ba" - } - Frame { - msec: 4272 - hash: "5b3505be865f704640e81cea092d35ba" - } - Frame { - msec: 4288 - hash: "5b3505be865f704640e81cea092d35ba" - } - Mouse { - type: 3 - button: 1 - buttons: 0 - x: 83; y: 164 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4304 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4320 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4336 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4352 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4368 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4384 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4400 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4416 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4432 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4448 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4464 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 85; y: 158 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 85; y: 156 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4480 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 86; y: 154 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 86; y: 152 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4496 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 87; y: 150 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 89; y: 144 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4512 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 93; y: 138 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 99; y: 134 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4528 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 101; y: 128 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 105; y: 122 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4544 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 109; y: 114 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 113; y: 108 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4560 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 114; y: 106 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 114; y: 105 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4576 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 115; y: 104 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 115; y: 102 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4592 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 115; y: 100 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 116; y: 98 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4608 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 120; y: 92 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 122; y: 86 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4624 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 126; y: 76 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 130; y: 66 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4640 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 132; y: 56 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 134; y: 46 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4656 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 136; y: 38 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 138; y: 30 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4672 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 140; y: 22 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 141; y: 20 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4688 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 143; y: 14 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 144; y: 12 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4704 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 144; y: 11 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 144; y: 9 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4720 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 144; y: 7 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 144; y: 6 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4736 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 143; y: 4 - modifiers: 0 - sendToViewport: true - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 143; y: 2 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4752 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Mouse { - type: 5 - button: 0 - buttons: 0 - x: 143; y: 1 - modifiers: 0 - sendToViewport: true - } - Frame { - msec: 4768 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4784 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4800 - image: "windowObjects.4.png" - } - Frame { - msec: 4816 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4832 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4848 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4864 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4880 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4896 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4912 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4928 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4944 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4960 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4976 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 4992 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5008 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5024 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5040 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5056 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5072 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5088 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5104 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5120 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5136 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5152 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5168 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5184 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5200 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5216 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5232 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5248 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5264 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5280 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5296 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5312 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5328 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5344 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5360 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5376 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5392 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5408 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5424 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5440 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5456 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5472 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5488 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5504 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5520 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5536 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5552 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5568 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } - Frame { - msec: 5584 - hash: "cb5a42e7ab70e05a8bbecabb587f9e5e" - } -} diff --git a/tests/auto/declarative/visual/webview/settings/test-objects.html b/tests/auto/declarative/visual/webview/settings/test-objects.html deleted file mode 100644 index ed7d2ea..0000000 --- a/tests/auto/declarative/visual/webview/settings/test-objects.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - -

Boring Document

-

-This is a boring document. -It gets the text on this button: - -from QML. -

diff --git a/tests/auto/declarative/visual/webview/settings/windowObjects.qml b/tests/auto/declarative/visual/webview/settings/windowObjects.qml deleted file mode 100644 index f1d4097..0000000 --- a/tests/auto/declarative/visual/webview/settings/windowObjects.qml +++ /dev/null @@ -1,26 +0,0 @@ -import Qt 4.6 - -Column { - WebView { - width: 200 - height: 200 - url: "test-objects.html" - javaScriptWindowObjects: - Object { - property string text: btntext.text - WebView.windowObjectName: "qmltext" - } - } - Row { - Text { text: "Input:" } - Rectangle { - width: btntext.width+10 - height: btntext.height+10 - border.color: "black" - TextInput { - id: btntext - text: "Blah" - } - } - } -} diff --git a/tests/auto/declarative/visual/webview/zooming/data/resolution.0.png b/tests/auto/declarative/visual/webview/zooming/data/resolution.0.png new file mode 100644 index 0000000..7e989c6 Binary files /dev/null and b/tests/auto/declarative/visual/webview/zooming/data/resolution.0.png differ diff --git a/tests/auto/declarative/visual/webview/zooming/data/resolution.1.png b/tests/auto/declarative/visual/webview/zooming/data/resolution.1.png new file mode 100644 index 0000000..60ccc0b Binary files /dev/null and b/tests/auto/declarative/visual/webview/zooming/data/resolution.1.png differ diff --git a/tests/auto/declarative/visual/webview/zooming/data/resolution.2.png b/tests/auto/declarative/visual/webview/zooming/data/resolution.2.png new file mode 100644 index 0000000..6c22494 Binary files /dev/null and b/tests/auto/declarative/visual/webview/zooming/data/resolution.2.png differ diff --git a/tests/auto/declarative/visual/webview/zooming/data/resolution.3.png b/tests/auto/declarative/visual/webview/zooming/data/resolution.3.png new file mode 100644 index 0000000..71dd56f Binary files /dev/null and b/tests/auto/declarative/visual/webview/zooming/data/resolution.3.png differ diff --git a/tests/auto/declarative/visual/webview/zooming/data/resolution.4.png b/tests/auto/declarative/visual/webview/zooming/data/resolution.4.png new file mode 100644 index 0000000..ce03cb6 Binary files /dev/null and b/tests/auto/declarative/visual/webview/zooming/data/resolution.4.png differ diff --git a/tests/auto/declarative/visual/webview/zooming/data/resolution.qml b/tests/auto/declarative/visual/webview/zooming/data/resolution.qml new file mode 100644 index 0000000..0a2b8db --- /dev/null +++ b/tests/auto/declarative/visual/webview/zooming/data/resolution.qml @@ -0,0 +1,1319 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "ac1d9c1cc13813b5e94c692a209a4e36" + } + Frame { + msec: 32 + hash: "1f189a436cf74ae83a03c3bb63c24ec2" + } + Frame { + msec: 48 + hash: "369f761053d5910e00672aa866f698ba" + } + Frame { + msec: 64 + hash: "30a191ae899121ae22d10acee6593415" + } + Frame { + msec: 80 + hash: "7af041898748bb5950643b057ca59eea" + } + Frame { + msec: 96 + hash: "e0a2ed91e78ff9a994deb9649a8afc16" + } + Frame { + msec: 112 + hash: "649ad1a3fb57fb088e4e5cfd749bf2e5" + } + Frame { + msec: 128 + hash: "9053a92e343ebb79bd2831f5ab94a1b5" + } + Frame { + msec: 144 + hash: "dc78b09e27bbc0a2cfec83436eef4446" + } + Frame { + msec: 160 + hash: "2aaa3749f93734dd203e1fea91a9f24a" + } + Frame { + msec: 176 + hash: "8df8dd33eada434231332b81e03430ce" + } + Frame { + msec: 192 + hash: "b5b1beb4dd4720eaa8b888fbef1ba875" + } + Frame { + msec: 208 + hash: "e531d33ef14b58ad843a6be6d7cb0961" + } + Frame { + msec: 224 + hash: "011c0bcca7717b08bc53738718203f7e" + } + Frame { + msec: 240 + hash: "412a630348aa44d56f36f04982035e36" + } + Frame { + msec: 256 + hash: "45528cdc62622b6d01e44466cd85bd38" + } + Frame { + msec: 272 + hash: "0901c99f959d6c10a0b6ea46a282d8fd" + } + Frame { + msec: 288 + hash: "3f200fca4815d555f22912d9fcdc20ee" + } + Frame { + msec: 304 + hash: "5e3c58e2f3a57f4ea48f4315d37ed813" + } + Frame { + msec: 320 + hash: "e8d98ec2d13ef4324feba11be95d0735" + } + Frame { + msec: 336 + hash: "4f3b79b341b63499a20f1e1e2cd979f9" + } + Frame { + msec: 352 + hash: "5ddbc3bc10292bec41531e83c0921c59" + } + Frame { + msec: 368 + hash: "9bc9801e83267689cd2750226f2b08ce" + } + Frame { + msec: 384 + hash: "f87195f2393914a0bbed9a454de01ff5" + } + Frame { + msec: 400 + hash: "4e0fd7f45e53a8d44c416eb9235ec877" + } + Frame { + msec: 416 + hash: "a579d6324fb4bf9ac5ceaba2aa708764" + } + Frame { + msec: 432 + hash: "b9f3f08168fb55ba01e56e670db565de" + } + Frame { + msec: 448 + hash: "cbd63ec868578e295a83170f42b23678" + } + Frame { + msec: 464 + hash: "2ed9d0e09b61dee8b2703e580007d7a5" + } + Frame { + msec: 480 + hash: "92fa2d9ef05140eb9d0fcf78b55f202e" + } + Frame { + msec: 496 + hash: "9a3f9dc04a900020f0e488309d7b4757" + } + Frame { + msec: 512 + hash: "93b4876c3e185ff4875a7447b0bf4f0f" + } + Frame { + msec: 528 + hash: "41b40e36f77d04e62f72ad34aa50709a" + } + Frame { + msec: 544 + hash: "2ea69aeb32fee61b61aa9c4efb2834bf" + } + Frame { + msec: 560 + hash: "0971ac1e05ea2ba387c78d4d103f5ea1" + } + Frame { + msec: 576 + hash: "98e46dff678f293fd6a4e9313ab3aec7" + } + Frame { + msec: 592 + hash: "82b94393071d6c32dd8028e1ee69e7fb" + } + Frame { + msec: 608 + hash: "240df67aa72a24546eb6e043e0d3d205" + } + Frame { + msec: 624 + hash: "56c4113cc341c254ccab66f3bc313154" + } + Frame { + msec: 640 + hash: "20d758c1537ed1a9aff657414b50926c" + } + Frame { + msec: 656 + hash: "ae252d835a05e01c2a12ae820335049a" + } + Frame { + msec: 672 + hash: "4d53256fbb012e738ba3868e2482250d" + } + Frame { + msec: 688 + hash: "261a341cab38986fb2f53b8e430f04a3" + } + Frame { + msec: 704 + hash: "1030f795d310f742ba491a2a90ff52d8" + } + Frame { + msec: 720 + hash: "59d24ebfedd2a87bdbd755d06c4361d2" + } + Frame { + msec: 736 + hash: "a6eaa480b3f93d33ae23bb36b7691b92" + } + Frame { + msec: 752 + hash: "cb6cf1e6e89da3fcbad323f744aef18d" + } + Frame { + msec: 768 + hash: "33a4f07cf7f5d16f006541c61ae2e4ee" + } + Frame { + msec: 784 + hash: "6e857b106486ea0aaa5321d4a7a07eae" + } + Frame { + msec: 800 + hash: "0f80edaf3eecf7a8c015d3fcecc0a494" + } + Frame { + msec: 816 + hash: "24b45d00d70904694c30ebd422c739ce" + } + Frame { + msec: 832 + hash: "c0ca66fefb19294852b9be0c4ba36481" + } + Frame { + msec: 848 + hash: "047846d243e7613193a8ddd526c4268e" + } + Frame { + msec: 864 + hash: "ca85f90e450ccda6b76e6a29a3187a63" + } + Frame { + msec: 880 + hash: "fcd803f5640d054190c2ddc9a6406bb9" + } + Frame { + msec: 896 + hash: "f81152b8a464bfa8343f52efcb0c8b8c" + } + Frame { + msec: 912 + hash: "e86be73d83699584dca986dfdb030b36" + } + Frame { + msec: 928 + hash: "d9798e4ebaf72c35b19a56b336d2ea93" + } + Frame { + msec: 944 + hash: "460f13d8e05b529c0e4fba39b1449ff1" + } + Frame { + msec: 960 + image: "resolution.0.png" + } + Frame { + msec: 976 + hash: "8b2f13580c6de9ec231809330d2d0362" + } + Frame { + msec: 992 + hash: "94a2cc520340573557e6a310f2ea125e" + } + Frame { + msec: 1008 + hash: "a8df78ab2e800349ec887ea6b1f5dcb8" + } + Frame { + msec: 1024 + hash: "0f3a56dbe26d453847ed4847c0e81d1a" + } + Frame { + msec: 1040 + hash: "96c89325862a982235b4b75922ec4669" + } + Frame { + msec: 1056 + hash: "ead6352a4ca47da59422e8d6a5844aa4" + } + Frame { + msec: 1072 + hash: "b50a6b14f15882e2c1ae6e3babeecdf8" + } + Frame { + msec: 1088 + hash: "2f32245c3388b86194e8183a290e99b8" + } + Frame { + msec: 1104 + hash: "2b54d49d30ccbf11ccb5ba8d62ba7d83" + } + Frame { + msec: 1120 + hash: "495b25d87cb6d1d4bdea4d5ec62c698e" + } + Frame { + msec: 1136 + hash: "3d45b061939783b6359fa4cdb908ecc0" + } + Frame { + msec: 1152 + hash: "e9e601c2a65a09b6354fff2c162106d6" + } + Frame { + msec: 1168 + hash: "8cfba8a724e85403b573caf7bbac9d83" + } + Frame { + msec: 1184 + hash: "5910765354645b724e14681cbdea227e" + } + Frame { + msec: 1200 + hash: "4358af7f2ccfc0919614351bfd5a7405" + } + Frame { + msec: 1216 + hash: "032e064336b458a6de03fdc98684cc34" + } + Frame { + msec: 1232 + hash: "c81d87bf83ee7e834a4b15dd103f7082" + } + Frame { + msec: 1248 + hash: "9d4416b55ed3b9e45a2314e9be5a5f2d" + } + Frame { + msec: 1264 + hash: "5b96da1a52a0413f9e8edbc9291a2502" + } + Frame { + msec: 1280 + hash: "aaa4008281ebc60b15616c818816e195" + } + Frame { + msec: 1296 + hash: "81ebf882aeb89648300dfc2e8e2cf11b" + } + Frame { + msec: 1312 + hash: "4e686e6cee12902f92e0ece915386fb3" + } + Frame { + msec: 1328 + hash: "6ff8d9bd6ec4dce414cdc7330646156e" + } + Frame { + msec: 1344 + hash: "dac6334e8b221527ef74b4f93eeef7c3" + } + Frame { + msec: 1360 + hash: "e58dbf419d1831e001e802600803aaa5" + } + Frame { + msec: 1376 + hash: "e8685f9b12c9ccb9d0e471946f1f6f9c" + } + Frame { + msec: 1392 + hash: "0936715ff8d38c2c813ebef0683a3246" + } + Frame { + msec: 1408 + hash: "37ad0a5532af8b083a7d4c4b044075ca" + } + Frame { + msec: 1424 + hash: "52ae25414d353d994cba36918644949a" + } + Frame { + msec: 1440 + hash: "07719485f9a7d0012eb0f3f211f0f21b" + } + Frame { + msec: 1456 + hash: "2d1a4f2c8d4a8d6316a31a81a2d20c61" + } + Frame { + msec: 1472 + hash: "3b279fb9e7b3efe05becc1651ba59493" + } + Frame { + msec: 1488 + hash: "4b9c126dcdf499f9de4e09d4f6ab86bf" + } + Frame { + msec: 1504 + hash: "6a1b8d8ea46949cb65e8f4155ab94819" + } + Frame { + msec: 1520 + hash: "6dbd2106b91ffbbb8a845e6cddbd47d7" + } + Frame { + msec: 1536 + hash: "8244eda92302f2b5cff01f05d438bf20" + } + Frame { + msec: 1552 + hash: "f939bd80ae865e365e554a532ade38f5" + } + Frame { + msec: 1568 + hash: "92d135616eee6737333b3d86d0aa5956" + } + Frame { + msec: 1584 + hash: "ca75854d6e5a77c8e609d65971b5671a" + } + Frame { + msec: 1600 + hash: "b0a113800cd05768b57bac6b9a338b1d" + } + Frame { + msec: 1616 + hash: "7af1a2aa6a201e36c3a969be4330af04" + } + Frame { + msec: 1632 + hash: "e54e8a2cfb0e6678b2a7cc64b8ae08bc" + } + Frame { + msec: 1648 + hash: "5d212c7efd9cf7d3eb5219b0bbe766d7" + } + Frame { + msec: 1664 + hash: "f4f2c95380c0f76c9e89820cdbeb5b31" + } + Frame { + msec: 1680 + hash: "b8eefbf5ade1a6b9eef9608f66a46474" + } + Frame { + msec: 1696 + hash: "d699ace9babbb152aad2fa852114c099" + } + Frame { + msec: 1712 + hash: "ceb3dea0d2b93cc5882a2b38ab3d1b95" + } + Frame { + msec: 1728 + hash: "08175810bfb80e1c5816b0d0aebbac4a" + } + Frame { + msec: 1744 + hash: "86abce93f50e7e7ebbd90690cfb20dd2" + } + Frame { + msec: 1760 + hash: "2918979f2682bd32beb5eaf7ecb3e463" + } + Frame { + msec: 1776 + hash: "b165ab96b0d51d41578bf99cbf7f6d02" + } + Frame { + msec: 1792 + hash: "d56cfdb2c65372cb36aeb13fd9c73deb" + } + Frame { + msec: 1808 + hash: "c53f0e4dc8204e5892ed4f367a6bade3" + } + Frame { + msec: 1824 + hash: "b3ae62e13149160f3695ed5c116411aa" + } + Frame { + msec: 1840 + hash: "057e4a0428ea2ff9893becd40e6d2977" + } + Frame { + msec: 1856 + hash: "10c050131093cc0d3f4b80c44eb1218b" + } + Frame { + msec: 1872 + hash: "17ce5a6dace37f4eb316f37ea26a8a2c" + } + Frame { + msec: 1888 + hash: "6e00c7e74bfaed5cf06aba54c8b73e57" + } + Frame { + msec: 1904 + hash: "5a03b1b698ca28d2afd9c67aef3bc2e9" + } + Frame { + msec: 1920 + image: "resolution.1.png" + } + Frame { + msec: 1936 + hash: "0fab102a33521e8893afdb6a11a3c5c9" + } + Frame { + msec: 1952 + hash: "232e8f1b060ef55e37a372bec4435d11" + } + Frame { + msec: 1968 + hash: "2107724eac0d1b8735060876f80d303a" + } + Frame { + msec: 1984 + hash: "cf5d12d2707975ad364750d5ba787944" + } + Frame { + msec: 2000 + hash: "2457c88828c2cb39feb1d34556077139" + } + Frame { + msec: 2016 + hash: "5f08d6dab8199b3f0f57d32cf2da4d67" + } + Frame { + msec: 2032 + hash: "2457c88828c2cb39feb1d34556077139" + } + Frame { + msec: 2048 + hash: "cf5d12d2707975ad364750d5ba787944" + } + Frame { + msec: 2064 + hash: "2107724eac0d1b8735060876f80d303a" + } + Frame { + msec: 2080 + hash: "232e8f1b060ef55e37a372bec4435d11" + } + Frame { + msec: 2096 + hash: "0a93c515cd328978ebd8103539a2fd63" + } + Frame { + msec: 2112 + hash: "63d6c7beac12e3bd83f9ef58c233c7d2" + } + Frame { + msec: 2128 + hash: "5a03b1b698ca28d2afd9c67aef3bc2e9" + } + Frame { + msec: 2144 + hash: "6e00c7e74bfaed5cf06aba54c8b73e57" + } + Frame { + msec: 2160 + hash: "17ce5a6dace37f4eb316f37ea26a8a2c" + } + Frame { + msec: 2176 + hash: "10c050131093cc0d3f4b80c44eb1218b" + } + Frame { + msec: 2192 + hash: "057e4a0428ea2ff9893becd40e6d2977" + } + Frame { + msec: 2208 + hash: "b3ae62e13149160f3695ed5c116411aa" + } + Frame { + msec: 2224 + hash: "c53f0e4dc8204e5892ed4f367a6bade3" + } + Frame { + msec: 2240 + hash: "d56cfdb2c65372cb36aeb13fd9c73deb" + } + Frame { + msec: 2256 + hash: "b165ab96b0d51d41578bf99cbf7f6d02" + } + Frame { + msec: 2272 + hash: "2918979f2682bd32beb5eaf7ecb3e463" + } + Frame { + msec: 2288 + hash: "86abce93f50e7e7ebbd90690cfb20dd2" + } + Frame { + msec: 2304 + hash: "08175810bfb80e1c5816b0d0aebbac4a" + } + Frame { + msec: 2320 + hash: "ceb3dea0d2b93cc5882a2b38ab3d1b95" + } + Frame { + msec: 2336 + hash: "d699ace9babbb152aad2fa852114c099" + } + Frame { + msec: 2352 + hash: "b8eefbf5ade1a6b9eef9608f66a46474" + } + Frame { + msec: 2368 + hash: "f4f2c95380c0f76c9e89820cdbeb5b31" + } + Frame { + msec: 2384 + hash: "5d212c7efd9cf7d3eb5219b0bbe766d7" + } + Frame { + msec: 2400 + hash: "e54e8a2cfb0e6678b2a7cc64b8ae08bc" + } + Frame { + msec: 2416 + hash: "d9408487f747ffb8eff5e1da92207285" + } + Frame { + msec: 2432 + hash: "e6b3fa1829535ac90d1548f45aadb9be" + } + Frame { + msec: 2448 + hash: "ca75854d6e5a77c8e609d65971b5671a" + } + Frame { + msec: 2464 + hash: "92d135616eee6737333b3d86d0aa5956" + } + Frame { + msec: 2480 + hash: "f939bd80ae865e365e554a532ade38f5" + } + Frame { + msec: 2496 + hash: "8244eda92302f2b5cff01f05d438bf20" + } + Frame { + msec: 2512 + hash: "6dbd2106b91ffbbb8a845e6cddbd47d7" + } + Frame { + msec: 2528 + hash: "6a1b8d8ea46949cb65e8f4155ab94819" + } + Frame { + msec: 2544 + hash: "4b9c126dcdf499f9de4e09d4f6ab86bf" + } + Frame { + msec: 2560 + hash: "3b279fb9e7b3efe05becc1651ba59493" + } + Frame { + msec: 2576 + hash: "bb40b884b56defb61ad86757fd51b9e6" + } + Frame { + msec: 2592 + hash: "07719485f9a7d0012eb0f3f211f0f21b" + } + Frame { + msec: 2608 + hash: "52ae25414d353d994cba36918644949a" + } + Frame { + msec: 2624 + hash: "37ad0a5532af8b083a7d4c4b044075ca" + } + Frame { + msec: 2640 + hash: "0936715ff8d38c2c813ebef0683a3246" + } + Frame { + msec: 2656 + hash: "e8685f9b12c9ccb9d0e471946f1f6f9c" + } + Frame { + msec: 2672 + hash: "e58dbf419d1831e001e802600803aaa5" + } + Frame { + msec: 2688 + hash: "dac6334e8b221527ef74b4f93eeef7c3" + } + Frame { + msec: 2704 + hash: "6ff8d9bd6ec4dce414cdc7330646156e" + } + Frame { + msec: 2720 + hash: "4e686e6cee12902f92e0ece915386fb3" + } + Frame { + msec: 2736 + hash: "81ebf882aeb89648300dfc2e8e2cf11b" + } + Frame { + msec: 2752 + hash: "aaa4008281ebc60b15616c818816e195" + } + Frame { + msec: 2768 + hash: "5b96da1a52a0413f9e8edbc9291a2502" + } + Frame { + msec: 2784 + hash: "9d4416b55ed3b9e45a2314e9be5a5f2d" + } + Frame { + msec: 2800 + hash: "c81d87bf83ee7e834a4b15dd103f7082" + } + Frame { + msec: 2816 + hash: "9fdf30d57c49a6644377ba40140b1969" + } + Frame { + msec: 2832 + hash: "4358af7f2ccfc0919614351bfd5a7405" + } + Frame { + msec: 2848 + hash: "5910765354645b724e14681cbdea227e" + } + Frame { + msec: 2864 + hash: "8cfba8a724e85403b573caf7bbac9d83" + } + Frame { + msec: 2880 + image: "resolution.2.png" + } + Frame { + msec: 2896 + hash: "3d45b061939783b6359fa4cdb908ecc0" + } + Frame { + msec: 2912 + hash: "495b25d87cb6d1d4bdea4d5ec62c698e" + } + Frame { + msec: 2928 + hash: "2b54d49d30ccbf11ccb5ba8d62ba7d83" + } + Frame { + msec: 2944 + hash: "2f32245c3388b86194e8183a290e99b8" + } + Frame { + msec: 2960 + hash: "b50a6b14f15882e2c1ae6e3babeecdf8" + } + Frame { + msec: 2976 + hash: "ead6352a4ca47da59422e8d6a5844aa4" + } + Frame { + msec: 2992 + hash: "96c89325862a982235b4b75922ec4669" + } + Frame { + msec: 3008 + hash: "0f3a56dbe26d453847ed4847c0e81d1a" + } + Frame { + msec: 3024 + hash: "a8df78ab2e800349ec887ea6b1f5dcb8" + } + Frame { + msec: 3040 + hash: "94a2cc520340573557e6a310f2ea125e" + } + Frame { + msec: 3056 + hash: "8b2f13580c6de9ec231809330d2d0362" + } + Frame { + msec: 3072 + hash: "5f76ef4f6b8e703fd0822859cd9a1353" + } + Frame { + msec: 3088 + hash: "460f13d8e05b529c0e4fba39b1449ff1" + } + Frame { + msec: 3104 + hash: "d9798e4ebaf72c35b19a56b336d2ea93" + } + Frame { + msec: 3120 + hash: "e86be73d83699584dca986dfdb030b36" + } + Frame { + msec: 3136 + hash: "f81152b8a464bfa8343f52efcb0c8b8c" + } + Frame { + msec: 3152 + hash: "fcd803f5640d054190c2ddc9a6406bb9" + } + Frame { + msec: 3168 + hash: "ca85f90e450ccda6b76e6a29a3187a63" + } + Frame { + msec: 3184 + hash: "047846d243e7613193a8ddd526c4268e" + } + Frame { + msec: 3200 + hash: "c0ca66fefb19294852b9be0c4ba36481" + } + Frame { + msec: 3216 + hash: "d4a075656790c4f2c50addcd2cc660b5" + } + Frame { + msec: 3232 + hash: "0f80edaf3eecf7a8c015d3fcecc0a494" + } + Frame { + msec: 3248 + hash: "6e857b106486ea0aaa5321d4a7a07eae" + } + Frame { + msec: 3264 + hash: "33a4f07cf7f5d16f006541c61ae2e4ee" + } + Frame { + msec: 3280 + hash: "cb6cf1e6e89da3fcbad323f744aef18d" + } + Frame { + msec: 3296 + hash: "a6eaa480b3f93d33ae23bb36b7691b92" + } + Frame { + msec: 3312 + hash: "59d24ebfedd2a87bdbd755d06c4361d2" + } + Frame { + msec: 3328 + hash: "1030f795d310f742ba491a2a90ff52d8" + } + Frame { + msec: 3344 + hash: "261a341cab38986fb2f53b8e430f04a3" + } + Frame { + msec: 3360 + hash: "4d53256fbb012e738ba3868e2482250d" + } + Frame { + msec: 3376 + hash: "ae252d835a05e01c2a12ae820335049a" + } + Frame { + msec: 3392 + hash: "20d758c1537ed1a9aff657414b50926c" + } + Frame { + msec: 3408 + hash: "56c4113cc341c254ccab66f3bc313154" + } + Frame { + msec: 3424 + hash: "240df67aa72a24546eb6e043e0d3d205" + } + Frame { + msec: 3440 + hash: "82b94393071d6c32dd8028e1ee69e7fb" + } + Frame { + msec: 3456 + hash: "98e46dff678f293fd6a4e9313ab3aec7" + } + Frame { + msec: 3472 + hash: "0971ac1e05ea2ba387c78d4d103f5ea1" + } + Frame { + msec: 3488 + hash: "2ea69aeb32fee61b61aa9c4efb2834bf" + } + Frame { + msec: 3504 + hash: "41b40e36f77d04e62f72ad34aa50709a" + } + Frame { + msec: 3520 + hash: "93b4876c3e185ff4875a7447b0bf4f0f" + } + Frame { + msec: 3536 + hash: "9a3f9dc04a900020f0e488309d7b4757" + } + Frame { + msec: 3552 + hash: "92fa2d9ef05140eb9d0fcf78b55f202e" + } + Frame { + msec: 3568 + hash: "2ed9d0e09b61dee8b2703e580007d7a5" + } + Frame { + msec: 3584 + hash: "cbd63ec868578e295a83170f42b23678" + } + Frame { + msec: 3600 + hash: "b9f3f08168fb55ba01e56e670db565de" + } + Frame { + msec: 3616 + hash: "a579d6324fb4bf9ac5ceaba2aa708764" + } + Frame { + msec: 3632 + hash: "4e0fd7f45e53a8d44c416eb9235ec877" + } + Frame { + msec: 3648 + hash: "f87195f2393914a0bbed9a454de01ff5" + } + Frame { + msec: 3664 + hash: "9bc9801e83267689cd2750226f2b08ce" + } + Frame { + msec: 3680 + hash: "5ddbc3bc10292bec41531e83c0921c59" + } + Frame { + msec: 3696 + hash: "4f3b79b341b63499a20f1e1e2cd979f9" + } + Frame { + msec: 3712 + hash: "e8d98ec2d13ef4324feba11be95d0735" + } + Frame { + msec: 3728 + hash: "5e3c58e2f3a57f4ea48f4315d37ed813" + } + Frame { + msec: 3744 + hash: "3f200fca4815d555f22912d9fcdc20ee" + } + Frame { + msec: 3760 + hash: "0901c99f959d6c10a0b6ea46a282d8fd" + } + Frame { + msec: 3776 + hash: "a186b8e984c999e8609472a7a5fa0610" + } + Frame { + msec: 3792 + hash: "412a630348aa44d56f36f04982035e36" + } + Frame { + msec: 3808 + hash: "011c0bcca7717b08bc53738718203f7e" + } + Frame { + msec: 3824 + hash: "e531d33ef14b58ad843a6be6d7cb0961" + } + Frame { + msec: 3840 + image: "resolution.3.png" + } + Frame { + msec: 3856 + hash: "8df8dd33eada434231332b81e03430ce" + } + Frame { + msec: 3872 + hash: "2aaa3749f93734dd203e1fea91a9f24a" + } + Frame { + msec: 3888 + hash: "dc78b09e27bbc0a2cfec83436eef4446" + } + Frame { + msec: 3904 + hash: "9053a92e343ebb79bd2831f5ab94a1b5" + } + Frame { + msec: 3920 + hash: "649ad1a3fb57fb088e4e5cfd749bf2e5" + } + Frame { + msec: 3936 + hash: "3579849956c1101000ef09949aa4c0f9" + } + Frame { + msec: 3952 + hash: "7af041898748bb5950643b057ca59eea" + } + Frame { + msec: 3968 + hash: "30a191ae899121ae22d10acee6593415" + } + Frame { + msec: 3984 + hash: "369f761053d5910e00672aa866f698ba" + } + Frame { + msec: 4000 + hash: "1f189a436cf74ae83a03c3bb63c24ec2" + } + Frame { + msec: 4016 + hash: "ac1d9c1cc13813b5e94c692a209a4e36" + } + Frame { + msec: 4032 + hash: "f0e0b5c041bcf38d8d9144d466ad74a9" + } + Frame { + msec: 4048 + hash: "38a35c94ebcf33f6720fea33821a54e1" + } + Frame { + msec: 4064 + hash: "061d139f43a3dd63daf887b82721f42f" + } + Frame { + msec: 4080 + hash: "623747b5fe99e5ffaa62f4daa3f840ef" + } + Frame { + msec: 4096 + hash: "4dd5081a387ffda296811b64b9235d7d" + } + Frame { + msec: 4112 + hash: "1598cf2fe996f99ab4c15f84d89cd7bd" + } + Frame { + msec: 4128 + hash: "30cac85bf1a622d438a64b6ccb59a8ca" + } + Frame { + msec: 4144 + hash: "114e54ae3e1493750a022f1c019e7f77" + } + Frame { + msec: 4160 + hash: "a585efc3aae3a426e6af5f4a8cc23b10" + } + Frame { + msec: 4176 + hash: "c0f315549baad93dd885d58b185e7ed7" + } + Frame { + msec: 4192 + hash: "3a00f5f034bef58ca341bf9e1056f46f" + } + Frame { + msec: 4208 + hash: "b3022d07dee989499a35aea21e07e4c1" + } + Frame { + msec: 4224 + hash: "e722464809e94fb7d8c752506f0d3ac2" + } + Frame { + msec: 4240 + hash: "82ea3d06367ce9dc582dbdbc186cc70a" + } + Frame { + msec: 4256 + hash: "359040facbe531c7f6b805b8bfc5b17a" + } + Frame { + msec: 4272 + hash: "264c7b65bae7e3945d87c17edfda6889" + } + Frame { + msec: 4288 + hash: "d941ec8e363942af02f36d4672521801" + } + Frame { + msec: 4304 + hash: "e46e145b4d07d1697c1d9efce80c80de" + } + Frame { + msec: 4320 + hash: "d8bed5c42bc5725d811db4dacdab1581" + } + Frame { + msec: 4336 + hash: "aa221160b4a11b30cb73eaa8ccaa9dfd" + } + Frame { + msec: 4352 + hash: "f411483477906d83f872b306cd021406" + } + Frame { + msec: 4368 + hash: "d9c52e4f99416fa1043a9c34a1c29f5a" + } + Frame { + msec: 4384 + hash: "ec2890446f34b8a5d47ae97ba2853d0f" + } + Frame { + msec: 4400 + hash: "6a3e6ef7d832fa7ec813b38171cb3602" + } + Frame { + msec: 4416 + hash: "6dfd75b6cb780f7d80466f3450d0b255" + } + Frame { + msec: 4432 + hash: "170774843dc6f28f51f07c445e046bd8" + } + Frame { + msec: 4448 + hash: "eab348bef656739d9723d3bd659c43ff" + } + Frame { + msec: 4464 + hash: "f06e546bb710002cdf1cefd51ffa47c4" + } + Frame { + msec: 4480 + hash: "52f7ff1348d9aa7cdf43cd81f0a71625" + } + Frame { + msec: 4496 + hash: "55a5b1befa3b7a4674a62d492b5527ea" + } + Frame { + msec: 4512 + hash: "699c093fddc6b9293a011d8d6eccd36d" + } + Frame { + msec: 4528 + hash: "b988e1ad7dc7d26ffeea8f71a69a9abf" + } + Frame { + msec: 4544 + hash: "8dea2b47492f83f961a47536a10aad0c" + } + Frame { + msec: 4560 + hash: "925ea8105779ffd801a3c62129d64bed" + } + Frame { + msec: 4576 + hash: "aa5d957c4f452b1f1c70ea672ce4a0b9" + } + Frame { + msec: 4592 + hash: "85d3ea97a1fb152ae8ad65a17693a16d" + } + Frame { + msec: 4608 + hash: "069b2bc8b86f822c5e7ceca3664e78a6" + } + Frame { + msec: 4624 + hash: "209071b7f72d8c25b9ce27c05397fe56" + } + Frame { + msec: 4640 + hash: "068dea708612620d34bd57c6affb44b1" + } + Frame { + msec: 4656 + hash: "36b53a0845220645059fed803a6ffcbc" + } + Frame { + msec: 4672 + hash: "2c84e15006a39a554eb2047bae9d4f6f" + } + Frame { + msec: 4688 + hash: "1bdab31534f4b5a7e9d27ede3e9acb57" + } + Frame { + msec: 4704 + hash: "688689eeb584b0c74f0322af35857dd5" + } + Frame { + msec: 4720 + hash: "024939fea5b6c6f9d3e26a0abf42ae3c" + } + Frame { + msec: 4736 + hash: "2efb2f47c6f0be3743f0f4dc7a66b08e" + } + Frame { + msec: 4752 + hash: "4631f3756af880693d3654c16cbe47bb" + } + Frame { + msec: 4768 + hash: "2fd77649c1e1ade97534ef530ad05612" + } + Frame { + msec: 4784 + hash: "5d13517bac111c8af49c444d41a42ea1" + } + Frame { + msec: 4800 + image: "resolution.4.png" + } + Frame { + msec: 4816 + hash: "8bd8efe405a42730304dcc120a6e718c" + } + Frame { + msec: 4832 + hash: "a83c543977e3f1dd4c020375eb3273fd" + } + Frame { + msec: 4848 + hash: "c52f38469fec77afc7f0a44b992e3d0d" + } + Frame { + msec: 4864 + hash: "af645449d6ec3f42449ffc59193aaaa4" + } + Frame { + msec: 4880 + hash: "2eb982cf754c77c109158076957775ae" + } + Frame { + msec: 4896 + hash: "9bf2fd4a4e45f302b34b7f038937d3d7" + } + Frame { + msec: 4912 + hash: "5520e309d68c8eedf76a9392714a6150" + } + Frame { + msec: 4928 + hash: "9dcd043a25e33b788729c0a0531301e7" + } + Frame { + msec: 4944 + hash: "1475b9bcfe08c66135673f4284c9bbcd" + } + Frame { + msec: 4960 + hash: "9af1f355bcf4d5f05b42040ebba75e09" + } + Frame { + msec: 4976 + hash: "8b6e04980ea60ca2ff06053d35c06881" + } + Frame { + msec: 4992 + hash: "def466e377a44afc4b2a9a9ebb258f86" + } + Frame { + msec: 5008 + hash: "18f6d6f5a3fdaee0037580df0f4f9ef0" + } + Frame { + msec: 5024 + hash: "ae2579498558f6f93489999c7c82cbcd" + } + Frame { + msec: 5040 + hash: "623d8e756c2c131150554272df231bf9" + } + Frame { + msec: 5056 + hash: "c13146576229848b8a1e1b382fbf749d" + } + Frame { + msec: 5072 + hash: "f963a399aeea1d34ec3bd30a5b991035" + } + Frame { + msec: 5088 + hash: "45a4db021ba0a53ad783c14a3b66aa38" + } + Frame { + msec: 5104 + hash: "2031618470e3bb3a3435fe0e270a15d4" + } + Frame { + msec: 5120 + hash: "f7cc01c301f29110db8364fecc8751f1" + } + Frame { + msec: 5136 + hash: "2d366fa500257ec0a12863f3637d0c47" + } + Frame { + msec: 5152 + hash: "4ba700e7f9ffba4889ca26d903a63029" + } + Frame { + msec: 5168 + hash: "329bec5e3d6a131b4bd9a056659bdb3e" + } + Frame { + msec: 5184 + hash: "48f7356707cdbcb401c135207ee38821" + } + Frame { + msec: 5200 + hash: "5314e448affe60d193d07a784035ecce" + } + Frame { + msec: 5216 + hash: "c87e98becdf99c214ad4987985b4af07" + } + Frame { + msec: 5232 + hash: "ea81d2a967b619980d7e42937ec74668" + } + Frame { + msec: 5248 + hash: "845319d4e0f6ee97697e59c606220e7a" + } +} diff --git a/tests/auto/declarative/visual/webview/zooming/qtlogo.png b/tests/auto/declarative/visual/webview/zooming/qtlogo.png new file mode 100644 index 0000000..399bd0b Binary files /dev/null and b/tests/auto/declarative/visual/webview/zooming/qtlogo.png differ diff --git a/tests/auto/declarative/visual/webview/zooming/resolution.html b/tests/auto/declarative/visual/webview/zooming/resolution.html new file mode 100644 index 0000000..75b1e3f --- /dev/null +++ b/tests/auto/declarative/visual/webview/zooming/resolution.html @@ -0,0 +1,6 @@ + + +

Resolution

+

+This test shows how zooming can include different resolutions. + diff --git a/tests/auto/declarative/visual/webview/zooming/resolution.qml b/tests/auto/declarative/visual/webview/zooming/resolution.qml new file mode 100644 index 0000000..8336c0f --- /dev/null +++ b/tests/auto/declarative/visual/webview/zooming/resolution.qml @@ -0,0 +1,17 @@ +import Qt 4.6 + +WebView { + width: 200 * zoomFactor + height: 250 * zoomFactor + scale: 1/zoomFactor + url: "resolution.html" + zoomFactor: + SequentialAnimation { + running: true + repeat: true + NumberAnimation { from: 1; to: 0.25; duration: 2000 } + NumberAnimation { from: 0.25; to: 1; duration: 2000 } + NumberAnimation { from: 1; to: 5; duration: 2000 } + NumberAnimation { from: 5; to: 1; duration: 2000 } + } +} -- cgit v0.12 From b67eb53839bd1b9513935b62be845274a1641584 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 6 Nov 2009 11:33:49 +1000 Subject: Remove dead code --- src/declarative/qml/qmlintegercache.cpp | 29 ----------------------------- src/declarative/qml/qmlintegercache_p.h | 2 -- 2 files changed, 31 deletions(-) diff --git a/src/declarative/qml/qmlintegercache.cpp b/src/declarative/qml/qmlintegercache.cpp index b20b6eb..d1927b3 100644 --- a/src/declarative/qml/qmlintegercache.cpp +++ b/src/declarative/qml/qmlintegercache.cpp @@ -82,33 +82,4 @@ int QmlIntegerCache::value(const QString &id) return d?d->value:-1; } -QmlIntegerCache *QmlIntegerCache::createForEnums(QmlType *type, QmlEngine *engine) -{ - Q_ASSERT(type); - Q_ASSERT(engine); - - QmlIntegerCache *cache = new QmlIntegerCache(engine); - - const QMetaObject *mo = type->metaObject(); - - for (int ii = mo->enumeratorCount() - 1; ii >= 0; --ii) { - QMetaEnum enumerator = mo->enumerator(ii); - - for (int jj = 0; jj < enumerator.keyCount(); ++jj) { - QString name = QString::fromUtf8(enumerator.key(jj)); - int value = enumerator.value(jj); - - if (!name.at(0).isUpper()) - continue; - - if (cache->stringCache.contains(name)) - continue; - - cache->add(name, value); - } - } - - return cache; -} - QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlintegercache_p.h b/src/declarative/qml/qmlintegercache_p.h index 7816004..2b10dcc 100644 --- a/src/declarative/qml/qmlintegercache_p.h +++ b/src/declarative/qml/qmlintegercache_p.h @@ -73,8 +73,6 @@ public: int value(const QString &); inline int value(const QScriptDeclarativeClass::Identifier &id) const; - static QmlIntegerCache *createForEnums(QmlType *, QmlEngine *); - protected: virtual void clear(); -- cgit v0.12 From b5218f60e701f8df9c331636921cf9d604af60af Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 6 Nov 2009 11:51:18 +1000 Subject: Test errors, actions. --- .../qmlgraphicswebview/tst_qmlgraphicswebview.cpp | 110 +++++++++++++++++++-- 1 file changed, 102 insertions(+), 8 deletions(-) diff --git a/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp index 346bdc7..864f4b5 100644 --- a/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp +++ b/tests/auto/declarative/qmlgraphicswebview/tst_qmlgraphicswebview.cpp @@ -56,6 +56,8 @@ public: private slots: void basicProperties(); + void historyNav(); + void loadError(); void setHtml(); void cleanupTestCase(); @@ -71,7 +73,21 @@ private: } }; -void removeRecursive(const QString& dirname) +static QString strippedHtml(QString html) +{ + html.replace(QRegExp("\\s+"),""); + return html; +} + +static QString fileContents(const QString& filename) +{ + QFile file(filename); + Q_ASSERT(file.open(QIODevice::ReadOnly)); + return file.readAll(); +} + + +static void removeRecursive(const QString& dirname) { QDir dir(dirname); QFileInfoList entries(dir.entryInfoList(QDir::Dirs|QDir::Files|QDir::NoDotAndDotDot)); @@ -116,13 +132,7 @@ void tst_qmlgraphicswebview::basicProperties() QTRY_COMPARE(wv->icon().width(), 48); QCOMPARE(wv->icon(),QPixmap(SRCDIR "/data/basic.png")); QCOMPARE(wv->statusText(),QString("")); - QFile htmlfile(SRCDIR "/data/basic.html"); - QVERIFY(htmlfile.open(QIODevice::ReadOnly)); - QString actualhtml____ = wv->html(); // "____" is to make errors line up for easier reading - QString expectedhtml = htmlfile.readAll(); - actualhtml____.replace(QRegExp("\\s+"),""); - expectedhtml.replace(QRegExp("\\s+"),""); - QCOMPARE(actualhtml____,expectedhtml); // same, ignoring whitespace + QCOMPARE(strippedHtml(fileContents(SRCDIR "/data/basic.html")), strippedHtml(wv->html())); QCOMPARE(wv->width(), 123.0); QCOMPARE(wv->webPageWidth(), 0); QCOMPARE(wv->preferredWidth(), 0); @@ -139,6 +149,90 @@ void tst_qmlgraphicswebview::basicProperties() QVERIFY(!wv->stopAction()->isEnabled()); } +void tst_qmlgraphicswebview::historyNav() +{ + QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/basic.qml")); + checkNoErrors(component); + QWebSettings::enablePersistentStorage(tmpDir()); + + QmlGraphicsWebView *wv = qobject_cast(component.create()); + QVERIFY(wv != 0); + for (int i=1; i<=2; ++i) { + QTRY_COMPARE(wv->progress(), 1.0); + QCOMPARE(wv->title(),QString("Basic")); + QTRY_COMPARE(wv->icon().width(), 48); + QCOMPARE(wv->icon(),QPixmap(SRCDIR "/data/basic.png")); + QCOMPARE(wv->statusText(),QString("")); + QCOMPARE(strippedHtml(fileContents(SRCDIR "/data/basic.html")), strippedHtml(wv->html())); + QCOMPARE(wv->width(), 123.0); + QCOMPARE(wv->webPageWidth(), 0); + QCOMPARE(wv->preferredWidth(), 0); + QCOMPARE(wv->zoomFactor(), 1.0); + QCOMPARE(wv->url(), QUrl::fromLocalFile(SRCDIR "/data/basic.html")); + QCOMPARE(wv->status(), QmlGraphicsWebView::Ready); + QVERIFY(wv->reloadAction()); + QVERIFY(wv->reloadAction()->isEnabled()); + QVERIFY(wv->backAction()); + QVERIFY(!wv->backAction()->isEnabled()); + QVERIFY(wv->forwardAction()); + QVERIFY(!wv->forwardAction()->isEnabled()); + QVERIFY(wv->stopAction()); + QVERIFY(!wv->stopAction()->isEnabled()); + + wv->reloadAction()->trigger(); + } + + wv->setUrl(QUrl::fromLocalFile(SRCDIR "/data/forward.html")); + QTRY_COMPARE(wv->progress(), 1.0); + QCOMPARE(wv->title(),QString("Forward")); + QCOMPARE(strippedHtml(fileContents(SRCDIR "/data/forward.html")), strippedHtml(wv->html())); + QCOMPARE(wv->url(), QUrl::fromLocalFile(SRCDIR "/data/forward.html")); + QCOMPARE(wv->status(), QmlGraphicsWebView::Ready); + QVERIFY(wv->reloadAction()); + QVERIFY(wv->reloadAction()->isEnabled()); + QVERIFY(wv->backAction()); + QVERIFY(wv->backAction()->isEnabled()); + QVERIFY(wv->forwardAction()); + QVERIFY(!wv->forwardAction()->isEnabled()); + QVERIFY(wv->stopAction()); + QVERIFY(!wv->stopAction()->isEnabled()); + + wv->backAction()->trigger(); + + QTRY_COMPARE(wv->progress(), 1.0); + QCOMPARE(wv->title(),QString("Basic")); + QCOMPARE(strippedHtml(fileContents(SRCDIR "/data/basic.html")), strippedHtml(wv->html())); + QCOMPARE(wv->url(), QUrl::fromLocalFile(SRCDIR "/data/basic.html")); + QCOMPARE(wv->status(), QmlGraphicsWebView::Ready); + QVERIFY(wv->reloadAction()); + QVERIFY(wv->reloadAction()->isEnabled()); + QVERIFY(wv->backAction()); + QVERIFY(!wv->backAction()->isEnabled()); + QVERIFY(wv->forwardAction()); + QVERIFY(wv->forwardAction()->isEnabled()); + QVERIFY(wv->stopAction()); + QVERIFY(!wv->stopAction()->isEnabled()); +} + +void tst_qmlgraphicswebview::loadError() +{ + QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/loadError.qml")); + checkNoErrors(component); + QWebSettings::enablePersistentStorage(tmpDir()); + + QmlGraphicsWebView *wv = qobject_cast(component.create()); + QVERIFY(wv != 0); + for (int i=1; i<=2; ++i) { + QTRY_COMPARE(wv->progress(), 1.0); + QCOMPARE(wv->title(),QString("")); + QCOMPARE(wv->statusText(),QString("")); // HTML 'status bar' text, not error message + QCOMPARE(wv->url(), QUrl::fromLocalFile(SRCDIR "/data/does-not-exist.html")); // Unlike QWebPage, which loses url + QCOMPARE(wv->status(), QmlGraphicsWebView::Error); + + wv->reloadAction()->trigger(); + } +} + void tst_qmlgraphicswebview::setHtml() { QmlComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/sethtml.qml")); -- cgit v0.12 From c53098a6795a485ebbdb21bf15a1df933e63a551 Mon Sep 17 00:00:00 2001 From: Warwick Allison Date: Fri, 6 Nov 2009 11:52:54 +1000 Subject: Don't lose the URL just because it is an error. (properties should be orthogonal) --- src/declarative/graphicsitems/qmlgraphicswebview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qmlgraphicswebview.cpp b/src/declarative/graphicsitems/qmlgraphicswebview.cpp index 4ac208c..5ce0ee8 100644 --- a/src/declarative/graphicsitems/qmlgraphicswebview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicswebview.cpp @@ -362,7 +362,7 @@ void QmlGraphicsWebView::pageUrlChanged() expandToWebPage(); if ((d->url.isEmpty() && page()->mainFrame()->url() != QUrl(QLatin1String("about:blank"))) - || d->url != page()->mainFrame()->url()) + || d->url != page()->mainFrame()->url() && !page()->mainFrame()->url().isEmpty()) { d->url = page()->mainFrame()->url(); if (d->url == QUrl(QLatin1String("about:blank"))) -- cgit v0.12 From bce122040d2df5ae650e6de17d41568f1ba7c184 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 6 Nov 2009 12:11:03 +1000 Subject: More valuetype tests --- .../declarative/valuetypes/data/deletedObject.js | 13 +++++++++ .../declarative/valuetypes/data/deletedObject.qml | 12 ++++++++ .../declarative/valuetypes/data/variantCopy.qml | 13 +++++++++ .../auto/declarative/valuetypes/tst_valuetypes.cpp | 33 ++++++++++++++++++++++ 4 files changed, 71 insertions(+) create mode 100644 tests/auto/declarative/valuetypes/data/deletedObject.js create mode 100644 tests/auto/declarative/valuetypes/data/deletedObject.qml create mode 100644 tests/auto/declarative/valuetypes/data/variantCopy.qml diff --git a/tests/auto/declarative/valuetypes/data/deletedObject.js b/tests/auto/declarative/valuetypes/data/deletedObject.js new file mode 100644 index 0000000..f554a0f --- /dev/null +++ b/tests/auto/declarative/valuetypes/data/deletedObject.js @@ -0,0 +1,13 @@ +var savedReference; + +function startup() +{ + savedReference = object.rect; + print("Test: " + savedReference.x); +} + +function afterDelete() +{ + print("Test: " + savedReference.x); +} + diff --git a/tests/auto/declarative/valuetypes/data/deletedObject.qml b/tests/auto/declarative/valuetypes/data/deletedObject.qml new file mode 100644 index 0000000..05459f4 --- /dev/null +++ b/tests/auto/declarative/valuetypes/data/deletedObject.qml @@ -0,0 +1,12 @@ +import Test 1.0 +import Qt 4.6 + +MyTypeObject { + property var object + + Script { source: "deletedObject.js" } + + object: MyTypeObject {} + Component.onCompleted: startup() + onRunScript: afterDelete() +} diff --git a/tests/auto/declarative/valuetypes/data/variantCopy.qml b/tests/auto/declarative/valuetypes/data/variantCopy.qml new file mode 100644 index 0000000..691a56c --- /dev/null +++ b/tests/auto/declarative/valuetypes/data/variantCopy.qml @@ -0,0 +1,13 @@ +import Test 1.0 + +MyTypeObject { + property var object + object: MyTypeObject { + rect.x: 19 + rect.y: 33 + rect.width: 5 + rect.height: 99 + } + + rect: object.rect +} diff --git a/tests/auto/declarative/valuetypes/tst_valuetypes.cpp b/tests/auto/declarative/valuetypes/tst_valuetypes.cpp index d09bdf5..9821a01 100644 --- a/tests/auto/declarative/valuetypes/tst_valuetypes.cpp +++ b/tests/auto/declarative/valuetypes/tst_valuetypes.cpp @@ -70,6 +70,8 @@ private slots: void valueSources(); void valueInterceptors(); void bindingConflict(); + void deletedObject(); + void variantCopy(); void cppClasses(); private: @@ -503,6 +505,37 @@ void tst_valuetypes::bindingConflict() delete t; \ } +// Test that accessing a reference to a valuetype after the owning object is deleted +// doesn't crash +void tst_valuetypes::deletedObject() +{ + QmlComponent component(&engine, TEST_FILE("deletedObject.qml")); + QTest::ignoreMessage(QtDebugMsg, "Test: 2"); + MyTypeObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + + QObject *dObject = qvariant_cast(object->property("object")); + QVERIFY(dObject != 0); + delete dObject; + + QTest::ignoreMessage(QtDebugMsg, "Test: undefined"); + object->emitRunScript(); + + delete object; +} + +// Test that value types can be assigned to another value type property +void tst_valuetypes::variantCopy() +{ + QmlComponent component(&engine, TEST_FILE("variantCopy.qml")); + MyTypeObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + + QCOMPARE(object->rect(), QRect(19, 33, 5, 99)); + + delete object; +} + // Test that the value type classes can be used manually void tst_valuetypes::cppClasses() { -- cgit v0.12 From 8e94e7d95f7fbc142a1a5faf3347aa165ff2426e Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 6 Nov 2009 12:44:19 +1000 Subject: Update valuetype tests Add a new test, and make the old variantCopy pass --- src/declarative/qml/qmlengine.cpp | 17 +--- src/declarative/qml/qmlvaluetypescriptclass.cpp | 101 ++++++++++----------- src/declarative/qml/qmlvaluetypescriptclass_p.h | 18 ++-- .../valuetypes/data/bindingVariantCopy.qml | 13 +++ .../valuetypes/data/scriptVariantCopy.qml | 14 +++ .../declarative/valuetypes/data/variantCopy.qml | 13 --- .../auto/declarative/valuetypes/tst_valuetypes.cpp | 26 +++++- 7 files changed, 105 insertions(+), 97 deletions(-) create mode 100644 tests/auto/declarative/valuetypes/data/bindingVariantCopy.qml create mode 100644 tests/auto/declarative/valuetypes/data/scriptVariantCopy.qml delete mode 100644 tests/auto/declarative/valuetypes/data/variantCopy.qml diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index e46205d..177818f 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -908,7 +908,7 @@ QVariant QmlEnginePrivate::scriptValueToVariant(const QScriptValue &val) else if (dc == contextClass) return QVariant(); - QScriptClass *sc = val.scriptClass(); + QScriptDeclarativeClass *sc = QScriptDeclarativeClass::scriptClass(val); if (!sc) { return val.toVariant(); } else if (sc == valueTypeClass) { @@ -929,20 +929,7 @@ QVariant QmlScriptClass::toVariant(QmlEngine *engine, const QScriptValue &val) QmlEnginePrivate *ep = static_cast(QObjectPrivate::get(engine)); - QScriptDeclarativeClass *dc = QScriptDeclarativeClass::scriptClass(val); - if (dc == ep->objectClass) - return QVariant::fromValue(ep->objectClass->toQObject(val)); - else if (dc == ep->contextClass) - return QVariant(); - - QScriptClass *sc = val.scriptClass(); - if (!sc) { - return val.toVariant(); - } else if (sc == ep->valueTypeClass) { - return ep->valueTypeClass->toVariant(val); - } - - return QVariant(); + return ep->scriptValueToVariant(val); } // XXX this beyonds in QUrl::toLocalFile() diff --git a/src/declarative/qml/qmlvaluetypescriptclass.cpp b/src/declarative/qml/qmlvaluetypescriptclass.cpp index 0c30992..e939e80 100644 --- a/src/declarative/qml/qmlvaluetypescriptclass.cpp +++ b/src/declarative/qml/qmlvaluetypescriptclass.cpp @@ -44,15 +44,14 @@ QT_BEGIN_NAMESPACE -struct QmlValueTypeReference { +struct QmlValueTypeReference : public QScriptDeclarativeClass::Object { QmlValueType *type; QGuard object; int property; }; -Q_DECLARE_METATYPE(QmlValueTypeReference); QmlValueTypeScriptClass::QmlValueTypeScriptClass(QmlEngine *bindEngine) -: QScriptClass(QmlEnginePrivate::getScriptEngine(bindEngine)), engine(bindEngine) +: QScriptDeclarativeClass(QmlEnginePrivate::getScriptEngine(bindEngine)), engine(bindEngine) { } @@ -62,89 +61,83 @@ QmlValueTypeScriptClass::~QmlValueTypeScriptClass() QScriptValue QmlValueTypeScriptClass::newObject(QObject *object, int coreIndex, QmlValueType *type) { - QmlValueTypeReference ref = { type, object, coreIndex }; - QScriptEngine *scriptEngine = QmlEnginePrivate::getScriptEngine(engine); - return scriptEngine->newObject(this, scriptEngine->newVariant(qVariantFromValue(ref))); + QmlValueTypeReference *ref = new QmlValueTypeReference; + ref->type = type; + ref->object = object; + ref->property = coreIndex; + return QScriptDeclarativeClass::newObject(QmlEnginePrivate::getScriptEngine(engine), this, ref); } -QmlValueTypeScriptClass::QueryFlags -QmlValueTypeScriptClass::queryProperty(const QScriptValue &object, - const QScriptString &name, - QueryFlags flags, uint *id) +QScriptClass::QueryFlags +QmlValueTypeScriptClass::queryProperty(Object *obj, const Identifier &name, + QScriptClass::QueryFlags) { - Q_UNUSED(flags); - QmlValueTypeReference ref = - qvariant_cast(object.data().toVariant()); + QmlValueTypeReference *ref = static_cast(obj); - if (!ref.object) + m_lastIndex = -1; + + if (!ref->object) return 0; - QByteArray propName = name.toString().toUtf8(); + QByteArray propName = toString(name).toUtf8(); - int idx = ref.type->metaObject()->indexOfProperty(propName.constData()); - if (idx == -1) + m_lastIndex = ref->type->metaObject()->indexOfProperty(propName.constData()); + if (m_lastIndex == -1) return 0; - *id = idx; - QMetaProperty prop = ref.object->metaObject()->property(idx); + QMetaProperty prop = ref->object->metaObject()->property(m_lastIndex); - QmlValueTypeScriptClass::QueryFlags rv = - QmlValueTypeScriptClass::HandlesReadAccess; + QScriptClass::QueryFlags rv = + QScriptClass::HandlesReadAccess; if (prop.isWritable()) - rv |= QmlValueTypeScriptClass::HandlesWriteAccess; + rv |= QScriptClass::HandlesWriteAccess; return rv; } -QScriptValue QmlValueTypeScriptClass::property(const QScriptValue &object, - const QScriptString &name, - uint id) +QScriptValue QmlValueTypeScriptClass::property(Object *obj, const Identifier &) { - Q_UNUSED(name); - QmlValueTypeReference ref = - qvariant_cast(object.data().toVariant()); - - if (!ref.object) - return QScriptValue(); + QmlValueTypeReference *ref = static_cast(obj); - ref.type->read(ref.object, ref.property); - - QMetaProperty p = ref.type->metaObject()->property(id); - QVariant rv = p.read(ref.type); + QMetaProperty p = ref->type->metaObject()->property(m_lastIndex); + ref->type->read(ref->object, ref->property); + QVariant rv = p.read(ref->type); return static_cast(QObjectPrivate::get(engine))->scriptValueFromVariant(rv); } -void QmlValueTypeScriptClass::setProperty(QScriptValue &object, - const QScriptString &name, - uint id, +void QmlValueTypeScriptClass::setProperty(Object *obj, const Identifier &, const QScriptValue &value) { - Q_UNUSED(name); - QmlValueTypeReference ref = - qvariant_cast(object.data().toVariant()); - - if (!ref.object) - return; + QmlValueTypeReference *ref = static_cast(obj); QVariant v = QmlScriptClass::toVariant(engine, value); - ref.type->read(ref.object, ref.property); - QMetaProperty p = ref.type->metaObject()->property(id); - p.write(ref.type, v); - ref.type->write(ref.object, ref.property, 0); + ref->type->read(ref->object, ref->property); + QMetaProperty p = ref->type->metaObject()->property(m_lastIndex); + p.write(ref->type, v); + ref->type->write(ref->object, ref->property, 0); } -QVariant QmlValueTypeScriptClass::toVariant(const QScriptValue &val) +QVariant QmlValueTypeScriptClass::toVariant(Object *obj, bool *ok) { - QmlValueTypeReference ref = - qvariant_cast(val.data().toVariant()); + QmlValueTypeReference *ref = static_cast(obj); - if (!ref.object) + if (ok) *ok = true; + + if (ref->object) { + ref->type->read(ref->object, ref->property); + return ref->type->value(); + } else { return QVariant(); + } +} + +QVariant QmlValueTypeScriptClass::toVariant(const QScriptValue &value) +{ + Q_ASSERT(scriptClass(value) == this); - QMetaProperty p = ref.object->metaObject()->property(ref.property); - return p.read(ref.object); + return toVariant(object(value), 0); } QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlvaluetypescriptclass_p.h b/src/declarative/qml/qmlvaluetypescriptclass_p.h index bd31ec1..19020b2 100644 --- a/src/declarative/qml/qmlvaluetypescriptclass_p.h +++ b/src/declarative/qml/qmlvaluetypescriptclass_p.h @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE class QmlEngine; class QmlValueType; -class QmlValueTypeScriptClass : public QScriptClass +class QmlValueTypeScriptClass : public QScriptDeclarativeClass { public: QmlValueTypeScriptClass(QmlEngine *); @@ -67,20 +67,16 @@ public: QScriptValue newObject(QObject *object, int coreIndex, QmlValueType *); - virtual QueryFlags queryProperty(const QScriptValue &object, - const QScriptString &name, - QueryFlags flags, uint *id); - virtual QScriptValue property(const QScriptValue &object, - const QScriptString &name, - uint id); - virtual void setProperty(QScriptValue &object, - const QScriptString &name, - uint id, - const QScriptValue &value); + virtual QScriptClass::QueryFlags queryProperty(Object *, const Identifier &, + QScriptClass::QueryFlags flags); + virtual QScriptValue property(Object *, const Identifier &); + virtual void setProperty(Object *, const Identifier &name, const QScriptValue &); + virtual QVariant toVariant(Object *, bool *ok = 0); QVariant toVariant(const QScriptValue &); private: QmlEngine *engine; + int m_lastIndex; }; QT_END_NAMESPACE diff --git a/tests/auto/declarative/valuetypes/data/bindingVariantCopy.qml b/tests/auto/declarative/valuetypes/data/bindingVariantCopy.qml new file mode 100644 index 0000000..691a56c --- /dev/null +++ b/tests/auto/declarative/valuetypes/data/bindingVariantCopy.qml @@ -0,0 +1,13 @@ +import Test 1.0 + +MyTypeObject { + property var object + object: MyTypeObject { + rect.x: 19 + rect.y: 33 + rect.width: 5 + rect.height: 99 + } + + rect: object.rect +} diff --git a/tests/auto/declarative/valuetypes/data/scriptVariantCopy.qml b/tests/auto/declarative/valuetypes/data/scriptVariantCopy.qml new file mode 100644 index 0000000..29157e8 --- /dev/null +++ b/tests/auto/declarative/valuetypes/data/scriptVariantCopy.qml @@ -0,0 +1,14 @@ +import Test 1.0 + +MyTypeObject { + property var object + object: MyTypeObject { + rect.x: 19 + rect.y: 33 + rect.width: 5 + rect.height: 99 + } + + onRunScript: rect = object.rect +} + diff --git a/tests/auto/declarative/valuetypes/data/variantCopy.qml b/tests/auto/declarative/valuetypes/data/variantCopy.qml deleted file mode 100644 index 691a56c..0000000 --- a/tests/auto/declarative/valuetypes/data/variantCopy.qml +++ /dev/null @@ -1,13 +0,0 @@ -import Test 1.0 - -MyTypeObject { - property var object - object: MyTypeObject { - rect.x: 19 - rect.y: 33 - rect.width: 5 - rect.height: 99 - } - - rect: object.rect -} diff --git a/tests/auto/declarative/valuetypes/tst_valuetypes.cpp b/tests/auto/declarative/valuetypes/tst_valuetypes.cpp index 9821a01..d42bfc5 100644 --- a/tests/auto/declarative/valuetypes/tst_valuetypes.cpp +++ b/tests/auto/declarative/valuetypes/tst_valuetypes.cpp @@ -71,7 +71,8 @@ private slots: void valueInterceptors(); void bindingConflict(); void deletedObject(); - void variantCopy(); + void bindingVariantCopy(); + void scriptVariantCopy(); void cppClasses(); private: @@ -524,10 +525,10 @@ void tst_valuetypes::deletedObject() delete object; } -// Test that value types can be assigned to another value type property -void tst_valuetypes::variantCopy() +// Test that value types can be assigned to another value type property in a binding +void tst_valuetypes::bindingVariantCopy() { - QmlComponent component(&engine, TEST_FILE("variantCopy.qml")); + QmlComponent component(&engine, TEST_FILE("bindingVariantCopy.qml")); MyTypeObject *object = qobject_cast(component.create()); QVERIFY(object != 0); @@ -536,6 +537,23 @@ void tst_valuetypes::variantCopy() delete object; } +// Test that value types can be assigned to another value type property in script +void tst_valuetypes::scriptVariantCopy() +{ + QmlComponent component(&engine, TEST_FILE("scriptVariantCopy.qml")); + MyTypeObject *object = qobject_cast(component.create()); + QVERIFY(object != 0); + + QCOMPARE(object->rect(), QRect(2, 3, 109, 102)); + + object->emitRunScript(); + + QCOMPARE(object->rect(), QRect(19, 33, 5, 99)); + + delete object; +} + + // Test that the value type classes can be used manually void tst_valuetypes::cppClasses() { -- cgit v0.12 From aff81e3fb3253d99cb42f68d08b2979d946153f4 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 6 Nov 2009 12:01:41 +1000 Subject: Rename targets -> matchTargets and properties -> matchProperties. --- demos/declarative/calculator/calculator.qml | 4 +- demos/declarative/flickr/common/ImageDetails.qml | 2 +- demos/declarative/flickr/common/MediaLineEdit.qml | 2 +- demos/declarative/flickr/common/ScrollBar.qml | 2 +- demos/declarative/flickr/common/Star.qml | 2 +- demos/declarative/flickr/flickr-desktop.qml | 8 +- demos/declarative/flickr/flickr-mobile.qml | 4 +- demos/declarative/flickr/mobile/GridDelegate.qml | 6 +- demos/declarative/flickr/mobile/ImageDetails.qml | 2 +- demos/declarative/flickr/mobile/TitleBar.qml | 2 +- demos/declarative/minehunt/minehunt.qml | 2 +- demos/declarative/twitter/content/HomeTitleBar.qml | 2 +- .../declarative/twitter/content/MultiTitleBar.qml | 2 +- demos/declarative/twitter/content/TitleBar.qml | 2 +- demos/declarative/twitter/twitter.qml | 2 +- .../declarative/webbrowser/fieldtext/FieldText.qml | 2 +- demos/declarative/webbrowser/webbrowser.qml | 8 +- doc/src/declarative/animation.qdoc | 12 +- .../snippets/declarative/listview/highlight.qml | 2 +- examples/declarative/anchors/anchor-changes.qml | 2 +- examples/declarative/animations/easing.qml | 4 +- examples/declarative/behaviours/test.qml | 8 +- examples/declarative/layouts/Button.qml | 2 +- examples/declarative/layouts/positioners.qml | 26 ++-- examples/declarative/listview/dynamic.qml | 2 +- examples/declarative/listview/highlight.qml | 2 +- examples/declarative/listview/recipes.qml | 2 +- examples/declarative/loader/Browser.qml | 10 +- examples/declarative/parallax/qml/ParallaxView.qml | 2 +- examples/declarative/scrollbar/ScrollBar.qml | 2 +- examples/declarative/scrollbar/display.qml | 2 +- examples/declarative/searchbox/SearchBox.qml | 4 +- examples/declarative/slideswitch/Switch.qml | 2 +- examples/declarative/snow/ImageBatch.qml | 12 +- examples/declarative/states/transitions.qml | 8 +- .../declarative/tutorials/helloworld/tutorial3.qml | 2 +- .../samegame/samegame4/content/BoomBlock.qml | 2 +- examples/declarative/velocity/Day.qml | 2 +- examples/declarative/webview/autosize.qml | 2 +- examples/declarative/webview/content/FieldText.qml | 2 +- examples/declarative/xmldata/yahoonews.qml | 4 +- src/declarative/QmlChanges.txt | 2 + src/declarative/util/qmlanimation.cpp | 168 ++++++++++++++------- src/declarative/util/qmlanimation_p.h | 8 +- .../auto/declarative/animations/data/badtype4.qml | 4 +- .../declarative/animations/data/dotproperty.qml | 4 +- .../declarative/animations/data/mixedtype1.qml | 2 +- .../declarative/animations/data/mixedtype2.qml | 2 +- .../declarative/behaviors/data/nonSelecting.qml | 2 +- .../declarative/behaviors/data/nonSelecting2.qml | 26 ++++ tests/auto/declarative/behaviors/tst_behaviors.cpp | 27 +++- .../declarative/layouts/data/grid-animated.qml | 6 +- .../layouts/data/horizontal-animated.qml | 6 +- .../declarative/layouts/data/vertical-animated.qml | 6 +- .../visual/bindinganimation/bindinganimation.qml | 2 +- tests/auto/declarative/visual/easing/easing.qml | 2 +- 56 files changed, 273 insertions(+), 166 deletions(-) create mode 100644 tests/auto/declarative/behaviors/data/nonSelecting2.qml diff --git a/demos/declarative/calculator/calculator.qml b/demos/declarative/calculator/calculator.qml index 54af7ad..d9b73ed 100644 --- a/demos/declarative/calculator/calculator.qml +++ b/demos/declarative/calculator/calculator.qml @@ -118,7 +118,7 @@ Rectangle { } transitions: Transition { - NumberAnimation { properties: "x,y,width"; easing: "easeOutBounce"; duration: 500 } - NumberAnimation { properties: "opacity"; easing: "easeInOutQuad"; duration: 500 } + NumberAnimation { matchProperties: "x,y,width"; easing: "easeOutBounce"; duration: 500 } + NumberAnimation { matchProperties: "opacity"; easing: "easeInOutQuad"; duration: 500 } } } diff --git a/demos/declarative/flickr/common/ImageDetails.qml b/demos/declarative/flickr/common/ImageDetails.qml index 19cad06..95c32e8 100644 --- a/demos/declarative/flickr/common/ImageDetails.qml +++ b/demos/declarative/flickr/common/ImageDetails.qml @@ -149,7 +149,7 @@ Flipable { property: "smooth" value: false } - NumberAnimation { easing: "easeInOutQuad"; properties: "angle"; duration: 500 } + NumberAnimation { easing: "easeInOutQuad"; matchProperties: "angle"; duration: 500 } PropertyAction { target: bigImage property: "smooth" diff --git a/demos/declarative/flickr/common/MediaLineEdit.qml b/demos/declarative/flickr/common/MediaLineEdit.qml index b24b296..abc8034 100644 --- a/demos/declarative/flickr/common/MediaLineEdit.qml +++ b/demos/declarative/flickr/common/MediaLineEdit.qml @@ -42,7 +42,7 @@ Item { ] transitions: [ Transition { - NumberAnimation { properties: "x,width"; duration: 500; easing: "easeInOutQuad" } + NumberAnimation { matchProperties: "x,width"; duration: 500; easing: "easeInOutQuad" } } ] diff --git a/demos/declarative/flickr/common/ScrollBar.qml b/demos/declarative/flickr/common/ScrollBar.qml index feebcb0..2c1ec8a 100644 --- a/demos/declarative/flickr/common/ScrollBar.qml +++ b/demos/declarative/flickr/common/ScrollBar.qml @@ -32,7 +32,7 @@ Item { to: "*" NumberAnimation { target: container - properties: "opacity" + matchProperties: "opacity" duration: 400 } } diff --git a/demos/declarative/flickr/common/Star.qml b/demos/declarative/flickr/common/Star.qml index 173021b..c5abcca 100644 --- a/demos/declarative/flickr/common/Star.qml +++ b/demos/declarative/flickr/common/Star.qml @@ -37,7 +37,7 @@ Item { transitions: [ Transition { NumberAnimation { - properties: "opacity,scale,x,y" + matchProperties: "opacity,scale,x,y" easing: "easeOutBounce" } } diff --git a/demos/declarative/flickr/flickr-desktop.qml b/demos/declarative/flickr/flickr-desktop.qml index 6dd12eb..9c85237 100644 --- a/demos/declarative/flickr/flickr-desktop.qml +++ b/demos/declarative/flickr/flickr-desktop.qml @@ -84,15 +84,15 @@ Item { from: "*"; to: "Details" SequentialAnimation { ParentAction { } - NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" } + NumberAnimation { matchProperties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" } } }, Transition { from: "Details"; to: "*" SequentialAnimation { ParentAction { } - NumberAnimation { properties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" } - PropertyAction { targets: wrapper; properties: "z" } + NumberAnimation { matchProperties: "x,y,scale,opacity,angle"; duration: 500; easing: "easeInOutQuad" } + PropertyAction { matchTargets: wrapper; matchProperties: "z" } } } ] @@ -178,7 +178,7 @@ Item { transitions: [ Transition { from: "*"; to: "*" - NumberAnimation { properties: "y"; duration: 1000; easing: "easeOutBounce(amplitude:0.5)" } + NumberAnimation { matchProperties: "y"; duration: 1000; easing: "easeOutBounce(amplitude:0.5)" } } ] } diff --git a/demos/declarative/flickr/flickr-mobile.qml b/demos/declarative/flickr/flickr-mobile.qml index 0a89c4f..583f992 100644 --- a/demos/declarative/flickr/flickr-mobile.qml +++ b/demos/declarative/flickr/flickr-mobile.qml @@ -38,7 +38,7 @@ Item { } transitions: Transition { - NumberAnimation { properties: "x"; duration: 500; easing: "easeInOutQuad" } + NumberAnimation { matchProperties: "x"; duration: 500; easing: "easeInOutQuad" } } } @@ -76,7 +76,7 @@ Item { } transitions: Transition { - NumberAnimation { properties: "x"; duration: 500; easing: "easeInOutQuad" } + NumberAnimation { matchProperties: "x"; duration: 500; easing: "easeInOutQuad" } } } } diff --git a/demos/declarative/flickr/mobile/GridDelegate.qml b/demos/declarative/flickr/mobile/GridDelegate.qml index 6c12896..3a42507 100644 --- a/demos/declarative/flickr/mobile/GridDelegate.qml +++ b/demos/declarative/flickr/mobile/GridDelegate.qml @@ -55,14 +55,14 @@ Transition { from: "Show"; to: "Details" ParentAction { } - NumberAnimation { properties: "x,y"; duration: 500; easing: "easeInOutQuad" } + NumberAnimation { matchProperties: "x,y"; duration: 500; easing: "easeInOutQuad" } }, Transition { from: "Details"; to: "Show" SequentialAnimation { ParentAction { } - NumberAnimation { properties: "x,y"; duration: 500; easing: "easeInOutQuad" } - PropertyAction { targets: wrapper; properties: "z" } + NumberAnimation { matchProperties: "x,y"; duration: 500; easing: "easeInOutQuad" } + PropertyAction { matchTargets: wrapper; matchProperties: "z" } } } ] diff --git a/demos/declarative/flickr/mobile/ImageDetails.qml b/demos/declarative/flickr/mobile/ImageDetails.qml index 1963bf5..9116428 100644 --- a/demos/declarative/flickr/mobile/ImageDetails.qml +++ b/demos/declarative/flickr/mobile/ImageDetails.qml @@ -117,7 +117,7 @@ Flipable { transitions: Transition { SequentialAnimation { PropertyAction { target: bigImage; property: "smooth"; value: false } - NumberAnimation { easing: "easeInOutQuad"; properties: "angle"; duration: 500 } + NumberAnimation { easing: "easeInOutQuad"; matchProperties: "angle"; duration: 500 } PropertyAction { target: bigImage; property: "smooth"; value: !flickable.moving } } } diff --git a/demos/declarative/flickr/mobile/TitleBar.qml b/demos/declarative/flickr/mobile/TitleBar.qml index 07b9762..0341585 100644 --- a/demos/declarative/flickr/mobile/TitleBar.qml +++ b/demos/declarative/flickr/mobile/TitleBar.qml @@ -71,6 +71,6 @@ Item { } transitions: Transition { - NumberAnimation { properties: "x"; easing: "easeInOutQuad" } + NumberAnimation { matchProperties: "x"; easing: "easeInOutQuad" } } } diff --git a/demos/declarative/minehunt/minehunt.qml b/demos/declarative/minehunt/minehunt.qml index e71ce90..596e82d 100644 --- a/demos/declarative/minehunt/minehunt.qml +++ b/demos/declarative/minehunt/minehunt.qml @@ -93,7 +93,7 @@ Item { } NumberAnimation { easing: "easeInOutQuad" - properties: "angle" + matchProperties: "angle" } ScriptAction{ script: if(modelData.hasMine && modelData.flipped){expl.explode = true;} diff --git a/demos/declarative/twitter/content/HomeTitleBar.qml b/demos/declarative/twitter/content/HomeTitleBar.qml index f0d6d75..b4f24ea 100644 --- a/demos/declarative/twitter/content/HomeTitleBar.qml +++ b/demos/declarative/twitter/content/HomeTitleBar.qml @@ -114,7 +114,7 @@ Item { transitions: [ Transition { from: "*"; to: "*" - NumberAnimation { properties: "x,y,width,height"; easing: "easeInOutQuad" } + NumberAnimation { matchProperties: "x,y,width,height"; easing: "easeInOutQuad" } } ] } diff --git a/demos/declarative/twitter/content/MultiTitleBar.qml b/demos/declarative/twitter/content/MultiTitleBar.qml index ef7de65..ef8a450 100644 --- a/demos/declarative/twitter/content/MultiTitleBar.qml +++ b/demos/declarative/twitter/content/MultiTitleBar.qml @@ -18,7 +18,7 @@ Item { } ] transitions: [ - Transition { NumberAnimation { properties: "x,y"; duration: 500; easing: "easeInOutQuad" } } + Transition { NumberAnimation { matchProperties: "x,y"; duration: 500; easing: "easeInOutQuad" } } ] } diff --git a/demos/declarative/twitter/content/TitleBar.qml b/demos/declarative/twitter/content/TitleBar.qml index 07b9762..0341585 100644 --- a/demos/declarative/twitter/content/TitleBar.qml +++ b/demos/declarative/twitter/content/TitleBar.qml @@ -71,6 +71,6 @@ Item { } transitions: Transition { - NumberAnimation { properties: "x"; easing: "easeInOutQuad" } + NumberAnimation { matchProperties: "x"; easing: "easeInOutQuad" } } } diff --git a/demos/declarative/twitter/twitter.qml b/demos/declarative/twitter/twitter.qml index 6cc67a1..db1ae39 100644 --- a/demos/declarative/twitter/twitter.qml +++ b/demos/declarative/twitter/twitter.qml @@ -87,7 +87,7 @@ Item { } ] transitions: [ - Transition { NumberAnimation { properties: "x,y"; duration: 500; easing: "easeInOutQuad" } } + Transition { NumberAnimation { matchProperties: "x,y"; duration: 500; easing: "easeInOutQuad" } } ] } } diff --git a/demos/declarative/webbrowser/fieldtext/FieldText.qml b/demos/declarative/webbrowser/fieldtext/FieldText.qml index b1c1938..6b1d271 100644 --- a/demos/declarative/webbrowser/fieldtext/FieldText.qml +++ b/demos/declarative/webbrowser/fieldtext/FieldText.qml @@ -149,7 +149,7 @@ Item { to: "*" reversible: true NumberAnimation { - properties: "opacity,leftMargin,rightMargin" + matchProperties: "opacity,leftMargin,rightMargin" duration: 200 } ColorAnimation { diff --git a/demos/declarative/webbrowser/webbrowser.qml b/demos/declarative/webbrowser/webbrowser.qml index 6cce4c3..6be3e09 100644 --- a/demos/declarative/webbrowser/webbrowser.qml +++ b/demos/declarative/webbrowser/webbrowser.qml @@ -149,8 +149,8 @@ Item { transitions: [ Transition { NumberAnimation { - targets: header - properties: "progressOff" + matchTargets: header + matchProperties: "progressOff" easing: "easeInOutQuad" duration: 300 } @@ -341,7 +341,7 @@ Item { transitions: [ Transition { NumberAnimation { - properties: "opacity" + matchProperties: "opacity" easing: "easeInOutQuad" duration: 300 } @@ -397,7 +397,7 @@ Item { transitions: [ Transition { NumberAnimation { - properties: "opacity" + matchProperties: "opacity" easing: "easeInOutQuad" duration: 320 } diff --git a/doc/src/declarative/animation.qdoc b/doc/src/declarative/animation.qdoc index ef18de3..ba45d81 100644 --- a/doc/src/declarative/animation.qdoc +++ b/doc/src/declarative/animation.qdoc @@ -113,7 +113,7 @@ For example, a transition could describe how an item moves from its initial posi transitions: [ Transition { NumberAnimation { - properties: "x,y" + matchProperties: "x,y" easing: "easeOutBounce" duration: 200 } @@ -123,7 +123,7 @@ transitions: [ As you can see from the above example, transitions make use of the same basic animation classes introduced above. However, you generally use a different set of properties when working with transitions. In the example, -no target or property has been specified. Instead, we have specified properties, which acts as a selector to +no target or property has been specified. Instead, we have specified matchProperties, which acts as a selector to determine which property changes to animate; in this case, we will animate any x,y properties that have changed on any objects. @@ -156,13 +156,13 @@ Transition { NumberAnimation { duration: 1000 easing: "easeOutBounce" - target: box1 - properties: "x,y" + matchTargets: box1 + matchProperties: "x,y" } NumberAnimation { duration: 1000 - target: box2 - properties: "x,y" + matchTargets: box2 + matchProperties: "x,y" } } } diff --git a/doc/src/snippets/declarative/listview/highlight.qml b/doc/src/snippets/declarative/listview/highlight.qml index 7970ede..b016f9a 100644 --- a/doc/src/snippets/declarative/listview/highlight.qml +++ b/doc/src/snippets/declarative/listview/highlight.qml @@ -30,7 +30,7 @@ Rectangle { } ] transitions: [ - Transition { NumberAnimation { properties: "x"; duration: 200 } } + Transition { NumberAnimation { matchProperties: "x"; duration: 200 } } ] } } diff --git a/examples/declarative/anchors/anchor-changes.qml b/examples/declarative/anchors/anchor-changes.qml index f6fd35d..2ebe1c0 100644 --- a/examples/declarative/anchors/anchor-changes.qml +++ b/examples/declarative/anchors/anchor-changes.qml @@ -41,6 +41,6 @@ Item { } transitions : Transition { - NumberAnimation { properties: "y,height" } + NumberAnimation { matchProperties: "y,height" } } } diff --git a/examples/declarative/animations/easing.qml b/examples/declarative/animations/easing.qml index 59e9b17..a9ba05f 100644 --- a/examples/declarative/animations/easing.qml +++ b/examples/declarative/animations/easing.qml @@ -80,8 +80,8 @@ Rectangle { transitions: Transition { ParallelAnimation { - NumberAnimation { properties: "x"; easing: type; duration: 1000 } - ColorAnimation { properties: "color"; easing: type; duration: 1000 } + NumberAnimation { matchProperties: "x"; easing: type; duration: 1000 } + ColorAnimation { matchProperties: "color"; easing: type; duration: 1000 } } } } diff --git a/examples/declarative/behaviours/test.qml b/examples/declarative/behaviours/test.qml index 946559b..4a44fd7 100644 --- a/examples/declarative/behaviours/test.qml +++ b/examples/declarative/behaviours/test.qml @@ -61,7 +61,7 @@ Rectangle { SequentialAnimation { NumberAnimation { target: bluerect - properties: "y" + property: "y" from: 0 to: 10 easing: "easeOutBounce(amplitude:30)" @@ -69,7 +69,7 @@ Rectangle { } NumberAnimation { target: bluerect - properties: "y" + property: "y" from: 10 to: 0 easing: "easeOutBounce(amplitude:30)" @@ -83,14 +83,14 @@ Rectangle { SequentialAnimation { NumberAnimation { target: bluerect - properties: "opacity" + property: "opacity" to: 0 duration: 150 } PropertyAction {} NumberAnimation { target: bluerect - properties: "opacity" + property: "opacity" to: 1 duration: 150 } diff --git a/examples/declarative/layouts/Button.qml b/examples/declarative/layouts/Button.qml index 44d0c7b..215b536 100644 --- a/examples/declarative/layouts/Button.qml +++ b/examples/declarative/layouts/Button.qml @@ -17,6 +17,6 @@ Rectangle { border.color: "black"; color: "steelblue"; radius: 5; width: pix.wid transitions: Transition{ - NumberAnimation { properties:"x,left"; easing:"easeInOutQuad"; duration:200 } + NumberAnimation { matchProperties:"x,left"; easing:"easeInOutQuad"; duration:200 } } } diff --git a/examples/declarative/layouts/positioners.qml b/examples/declarative/layouts/positioners.qml index 90efde2..129effe 100644 --- a/examples/declarative/layouts/positioners.qml +++ b/examples/declarative/layouts/positioners.qml @@ -11,17 +11,17 @@ Rectangle { y: 0 move: Transition { NumberAnimation { - properties: "y"; easing: "easeOutBounce" + matchProperties: "y"; easing: "easeOutBounce" } } add: Transition { NumberAnimation { - properties: "y"; from: 500; duration:500; easing: "easeOutQuad" + matchProperties: "y"; from: 500; duration:500; easing: "easeOutQuad" } } remove: Transition { NumberAnimation { - properties:"y"; to: 500; duration:500; easing: "easeInQuad" + matchProperties:"y"; to: 500; duration:500; easing: "easeInQuad" } } Rectangle { color: "red"; width: 100; height: 50; border.color: "black"; radius: 15 } @@ -36,23 +36,23 @@ Rectangle { y: 300 move: Transition { NumberAnimation { - properties: "x"; easing: "easeOutBounce" + matchProperties: "x"; easing: "easeOutBounce" } } add: Transition { NumberAnimation { - properties: "x"; from: 500; duration:500; easing: "easeOutQuad" + matchProperties: "x"; from: 500; duration:500; easing: "easeOutQuad" } NumberAnimation { - properties: "opacity"; from: 0; duration: 500; + matchProperties: "opacity"; from: 0; duration: 500; } } remove: Transition { NumberAnimation { - properties: "x"; to: 500; duration:500; easing: "easeInQuad" + matchProperties: "x"; to: 500; duration:500; easing: "easeInQuad" } NumberAnimation { - properties: "opacity"; from: 1; duration: 500 + matchProperties: "opacity"; from: 1; duration: 500 } } Rectangle { color: "red"; width: 50; height: 100; border.color: "black"; radius: 15 } @@ -103,25 +103,25 @@ Rectangle { remove: Transition { NumberAnimation { - properties: "opacity"; from: 1; to: 0; duration: 500 + matchProperties: "opacity"; from: 1; to: 0; duration: 500 } NumberAnimation { - properties: "x,y"; easing: "easeOutBounce" + matchProperties: "x,y"; easing: "easeOutBounce" } } move: Transition { NumberAnimation { - properties: "x,y"; easing: "easeOutBounce" + matchProperties: "x,y"; easing: "easeOutBounce" } } add: Transition { NumberAnimation { - properties: "opacity"; from: 0; to: 1; duration: 500 + matchProperties: "opacity"; from: 0; to: 1; duration: 500 } NumberAnimation { - properties: "x,y"; easing: "easeOutBounce" + matchProperties: "x,y"; easing: "easeOutBounce" } } diff --git a/examples/declarative/listview/dynamic.qml b/examples/declarative/listview/dynamic.qml index 2607527..101b708 100644 --- a/examples/declarative/listview/dynamic.qml +++ b/examples/declarative/listview/dynamic.qml @@ -122,7 +122,7 @@ Rectangle { PropertyChanges { target: verticalScrollBar; opacity: 1 } } ] - transitions: [ Transition { NumberAnimation { properties: "opacity"; duration: 400 } } ] + transitions: [ Transition { NumberAnimation { matchProperties: "opacity"; duration: 400 } } ] } Row { diff --git a/examples/declarative/listview/highlight.qml b/examples/declarative/listview/highlight.qml index be1f62d..9665499 100644 --- a/examples/declarative/listview/highlight.qml +++ b/examples/declarative/listview/highlight.qml @@ -31,7 +31,7 @@ Rectangle { transitions: [ Transition { NumberAnimation { - properties: "x"; duration: 200 + matchProperties: "x"; duration: 200 } } ] diff --git a/examples/declarative/listview/recipes.qml b/examples/declarative/listview/recipes.qml index 3410f56..c133351 100644 --- a/examples/declarative/listview/recipes.qml +++ b/examples/declarative/listview/recipes.qml @@ -124,7 +124,7 @@ Rectangle { ParallelAnimation { ColorAnimation { property: "color"; duration: 500 } NumberAnimation { - duration: 300; properties: "detailsOpacity,x,viewportY,height,width" + duration: 300; matchProperties: "detailsOpacity,x,viewportY,height,width" } } } diff --git a/examples/declarative/loader/Browser.qml b/examples/declarative/loader/Browser.qml index 9139346..f3a1182 100644 --- a/examples/declarative/loader/Browser.qml +++ b/examples/declarative/loader/Browser.qml @@ -132,12 +132,12 @@ Rectangle { Transition { to: "current" SequentialAnimation { - NumberAnimation { properties: "x"; duration: 250 } + NumberAnimation { matchProperties: "x"; duration: 250 } } }, Transition { - NumberAnimation { properties: "x"; duration: 250 } - NumberAnimation { properties: "x"; duration: 250 } + NumberAnimation { matchProperties: "x"; duration: 250 } + NumberAnimation { matchProperties: "x"; duration: 250 } } ] } @@ -171,11 +171,11 @@ Rectangle { Transition { to: "current" SequentialAnimation { - NumberAnimation { properties: "x"; duration: 250 } + NumberAnimation { matchProperties: "x"; duration: 250 } } }, Transition { - NumberAnimation { properties: "x"; duration: 250 } + NumberAnimation { matchProperties: "x"; duration: 250 } } ] } diff --git a/examples/declarative/parallax/qml/ParallaxView.qml b/examples/declarative/parallax/qml/ParallaxView.qml index ac84b47..98dd246 100644 --- a/examples/declarative/parallax/qml/ParallaxView.qml +++ b/examples/declarative/parallax/qml/ParallaxView.qml @@ -80,7 +80,7 @@ Item { } transitions: Transition { NumberAnimation { - properties: "scale,y" + matchProperties: "scale,y" } } } diff --git a/examples/declarative/scrollbar/ScrollBar.qml b/examples/declarative/scrollbar/ScrollBar.qml index 802b537..f68775c 100644 --- a/examples/declarative/scrollbar/ScrollBar.qml +++ b/examples/declarative/scrollbar/ScrollBar.qml @@ -2,7 +2,7 @@ import Qt 4.6 Item { id: scrollBar - // The properties that define the scrollbar's state. + // The matchProperties that define the scrollbar's state. // position and pageSize are in the range 0.0 - 1.0. They are relative to the // height of the page, i.e. a pageSize of 0.5 means that you can see 50% // of the height of the view. diff --git a/examples/declarative/scrollbar/display.qml b/examples/declarative/scrollbar/display.qml index 536a8b7..0b9f95a 100644 --- a/examples/declarative/scrollbar/display.qml +++ b/examples/declarative/scrollbar/display.qml @@ -27,7 +27,7 @@ Rectangle { from: "*" to: "*" NumberAnimation { - properties: "opacity" + matchProperties: "opacity" duration: 400 } } diff --git a/examples/declarative/searchbox/SearchBox.qml b/examples/declarative/searchbox/SearchBox.qml index 7077a11..42b5d67 100644 --- a/examples/declarative/searchbox/SearchBox.qml +++ b/examples/declarative/searchbox/SearchBox.qml @@ -50,11 +50,11 @@ FocusScope { transitions: [ Transition { from: ""; to: "hasText" - NumberAnimation { exclude: typeSomething; properties: "opacity" } + NumberAnimation { exclude: typeSomething; matchProperties: "opacity" } }, Transition { from: "hasText"; to: "" - NumberAnimation { properties: "opacity" } + NumberAnimation { matchProperties: "opacity" } } ] } diff --git a/examples/declarative/slideswitch/Switch.qml b/examples/declarative/slideswitch/Switch.qml index 1620805..4e13976 100644 --- a/examples/declarative/slideswitch/Switch.qml +++ b/examples/declarative/slideswitch/Switch.qml @@ -52,7 +52,7 @@ Item { ] transitions: [ Transition { - NumberAnimation { properties: "x"; easing: "easeInOutQuad"; duration: 200 } + NumberAnimation { matchProperties: "x"; easing: "easeInOutQuad"; duration: 200 } } ] } diff --git a/examples/declarative/snow/ImageBatch.qml b/examples/declarative/snow/ImageBatch.qml index 95b9b97..1d738b2 100644 --- a/examples/declarative/snow/ImageBatch.qml +++ b/examples/declarative/snow/ImageBatch.qml @@ -23,7 +23,7 @@ GridView { transitions: Transition { SequentialAnimation { PauseAnimation { duration: 150 } - PropertyAction { properties: "z" } + PropertyAction { matchProperties: "z" } } } model: XmlListModel { @@ -42,7 +42,7 @@ GridView { width: grid.imageWidth; height: grid.imageHeight; Image { id: flickrImage; source: url; fillMode: Image.PreserveAspectFit; smooth: true; anchors.fill: parent; - opacity: (status == Image.Ready)?1:0; opacity: Behavior { NumberAnimation { properties: "opacity" } } } + opacity: (status == Image.Ready)?1:0; opacity: Behavior { NumberAnimation { } } } Loading { anchors.centerIn: parent; visible: flickrImage.status!=1 } states: State { @@ -55,15 +55,15 @@ GridView { to: "selected" SequentialAnimation { PauseAnimation { duration: 150 } - PropertyAction { properties: "z" } - NumberAnimation { properties: "scale"; duration: 150; } + PropertyAction { matchProperties: "z" } + NumberAnimation { matchProperties: "scale"; duration: 150; } } }, Transition { from: "selected" SequentialAnimation { - NumberAnimation { properties: "scale"; duration: 150 } - PropertyAction { properties: "z" } + NumberAnimation { matchProperties: "scale"; duration: 150 } + PropertyAction { matchProperties: "z" } } } ] diff --git a/examples/declarative/states/transitions.qml b/examples/declarative/states/transitions.qml index ba97d9be..925d90e 100644 --- a/examples/declarative/states/transitions.qml +++ b/examples/declarative/states/transitions.qml @@ -48,23 +48,23 @@ Rectangle { } ] - // transitions define how the properties change. + // transitions define how the matchProperties change. transitions: [ // When transitioning to 'Position1' move x,y over a duration of 1 second, // with easeOutBounce easing function. Transition { from: "*"; to: "Position1" - NumberAnimation { properties: "x,y"; easing: "easeOutBounce"; duration: 1000 } + NumberAnimation { matchProperties: "x,y"; easing: "easeOutBounce"; duration: 1000 } }, // When transitioning to 'Position2' move x,y over a duration of 2 seconds, // with easeInOutQuad easing function. Transition { from: "*"; to: "Position2" - NumberAnimation { properties: "x,y"; easing: "easeInOutQuad"; duration: 2000 } + NumberAnimation { matchProperties: "x,y"; easing: "easeInOutQuad"; duration: 2000 } }, // For any other state changes move x,y linearly over duration of 200ms. Transition { - NumberAnimation { properties: "x,y"; duration: 200 } + NumberAnimation { matchProperties: "x,y"; duration: 200 } } ] } diff --git a/examples/declarative/tutorials/helloworld/tutorial3.qml b/examples/declarative/tutorials/helloworld/tutorial3.qml index 534d663..52c3fe8 100644 --- a/examples/declarative/tutorials/helloworld/tutorial3.qml +++ b/examples/declarative/tutorials/helloworld/tutorial3.qml @@ -28,7 +28,7 @@ Rectangle { transitions: Transition { from: ""; to: "down"; reversible: true ParallelAnimation { - NumberAnimation { properties: "y,rotation"; duration: 500; easing: "easeInOutQuad" } + NumberAnimation { matchProperties: "y,rotation"; duration: 500; easing: "easeInOutQuad" } ColorAnimation { property: "color"; duration: 500 } } } diff --git a/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml b/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml index 4c2ba43..2eb2ceb 100644 --- a/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml +++ b/examples/declarative/tutorials/samegame/samegame4/content/BoomBlock.qml @@ -24,7 +24,7 @@ Item { id:block } } opacity: 0 - opacity: Behavior { NumberAnimation { properties:"opacity"; duration: 200 } } + opacity: Behavior { NumberAnimation { matchProperties:"opacity"; duration: 200 } } anchors.fill: parent } //![2] diff --git a/examples/declarative/velocity/Day.qml b/examples/declarative/velocity/Day.qml index 030fa13..3a7ffa9 100644 --- a/examples/declarative/velocity/Day.qml +++ b/examples/declarative/velocity/Day.qml @@ -71,7 +71,7 @@ Rectangle { } transitions: Transition { - NumberAnimation { properties: "rotation,scale"; duration: 200 } + NumberAnimation { matchProperties: "rotation,scale"; duration: 200 } } } } diff --git a/examples/declarative/webview/autosize.qml b/examples/declarative/webview/autosize.qml index 74c6844..1614906 100644 --- a/examples/declarative/webview/autosize.qml +++ b/examples/declarative/webview/autosize.qml @@ -1,7 +1,7 @@ import Qt 4.6 // The WebView size is determined by the width, height, -// preferredWidth, and preferredHeight properties. +// preferredWidth, and preferredHeight matchProperties. Rectangle { id: rect color: "white" diff --git a/examples/declarative/webview/content/FieldText.qml b/examples/declarative/webview/content/FieldText.qml index b1c1938..6b1d271 100644 --- a/examples/declarative/webview/content/FieldText.qml +++ b/examples/declarative/webview/content/FieldText.qml @@ -149,7 +149,7 @@ Item { to: "*" reversible: true NumberAnimation { - properties: "opacity,leftMargin,rightMargin" + matchProperties: "opacity,leftMargin,rightMargin" duration: 200 } ColorAnimation { diff --git a/examples/declarative/xmldata/yahoonews.qml b/examples/declarative/xmldata/yahoonews.qml index 7d8b8a2..4add361 100644 --- a/examples/declarative/xmldata/yahoonews.qml +++ b/examples/declarative/xmldata/yahoonews.qml @@ -61,8 +61,8 @@ Rectangle { transitions: Transition { from: "*"; to: "Details"; reversible: true SequentialAnimation { - NumberAnimation { duration: 200; properties: "height"; easing: "easeOutQuad" } - NumberAnimation { duration: 200; properties: "opacity" } + NumberAnimation { duration: 200; matchProperties: "height"; easing: "easeOutQuad" } + NumberAnimation { duration: 200; matchProperties: "opacity" } } } } diff --git a/src/declarative/QmlChanges.txt b/src/declarative/QmlChanges.txt index c85ef77..97cefd5 100644 --- a/src/declarative/QmlChanges.txt +++ b/src/declarative/QmlChanges.txt @@ -70,6 +70,8 @@ ListView: wrap -> keyNavigationWraps ListView: autoHighlight -> highlightFollowsCurrentItem GridView: wrap -> keyNavigationWraps GridView: autoHighlight -> highlightFollowsCurrentItem +Animation: targets -> matchTargets +Animation: properties -> matchProperties Additions: MouseRegion: add "acceptedButtons" property diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp index 20e13af..7c5bc50 100644 --- a/src/declarative/util/qmlanimation.cpp +++ b/src/declarative/util/qmlanimation.cpp @@ -422,21 +422,6 @@ void QmlAbstractAnimation::setGroup(QmlAnimationGroup *g) setParent(g); } -/*! - \qmlproperty Object PropertyAction::target - This property holds an explicit target object to animate. - - The exact effect of the \c target property depends on how the animation - is being used. Refer to the \l animation documentation for details. -*/ - -/*! - \qmlproperty Object PropertyAnimation::target - This property holds an explicit target object to animate. - - The exact effect of the \c target property depends on how the animation - is being used. Refer to the \l animation documentation for details. -*/ QObject *QmlAbstractAnimation::target() const { Q_D(const QmlAbstractAnimation); @@ -459,21 +444,6 @@ void QmlAbstractAnimation::setTarget(QObject *o) emit targetChanged(d->target, d->propertyName); } -/*! - \qmlproperty string PropertyAction::property - This property holds an explicit property to animated. - - The exact effect of the \c property property depends on how the animation - is being used. Refer to the \l animation documentation for details. -*/ - -/*! - \qmlproperty string PropertyAnimation::property - This property holds an explicit property to animated. - - The exact effect of the \c property property depends on how the animation - is being used. Refer to the \l animation documentation for details. -*/ QString QmlAbstractAnimation::property() const { Q_D(const QmlAbstractAnimation); @@ -880,7 +850,7 @@ QML_DEFINE_TYPE(Qt,4,6,ScriptAction,QmlScriptAction) Set \c thewebview.url to the value set for the destination state: \code - PropertyAction { target: thewebview; property: "url" } + PropertyAction { matchTargets: thewebview; matchProperties: "url" } \endcode The PropertyAction is immediate - @@ -909,8 +879,33 @@ void QmlPropertyActionPrivate::init() } /*! - \qmlproperty string PropertyAction::properties - This property holds the properties to be immediately set, comma-separated. + \qmlproperty Object PropertyAction::target + This property holds an explicit target object to animate. + + The exact effect of the \c target property depends on how the animation + is being used. Refer to the \l animation documentation for details. +*/ + +/*! + \qmlproperty string PropertyAction::property + This property holds an explicit property to animated. + + The exact effect of the \c property property depends on how the animation + is being used. Refer to the \l animation documentation for details. +*/ + +/*! + \qmlproperty string PropertyAction::matchProperties + This property holds a comma-separated list of property names this action + will match against. These names are used in conjunction with matchTargets + to create a list of properties that the action will set, assuming those + properties have changed. + + This property is typically used for an action appearing as part of a Transition. + + By default, no property names will be matched. + + \sa matchTargets PropertyAnimation::matchProperties */ QString QmlPropertyAction::properties() const { @@ -928,9 +923,16 @@ void QmlPropertyAction::setProperties(const QString &p) } /*! - \qmlproperty list PropertyAction::targets - This property holds the items selected to be affected by this animation (all if not set). - \sa exclude + \qmlproperty list PropertyAction::matchTargets + This property holds a list of objects this action will match against. + These objects are used in conjunction with matchProperties to create a list of properties + that the action will set, assuming those properties have changed. + + This property is typically used for an action appearing as part of a Transition. + + By default, all changing targets will be matched. + + \sa exclude matchProperties PropertyAnimation::matchTargets */ QList *QmlPropertyAction::targets() { @@ -939,9 +941,9 @@ QList *QmlPropertyAction::targets() } /*! - \qmlproperty list PropertyAction::exclude - This property holds the items not to be affected by this animation. - \sa targets + \qmlproperty list PropertyAction::exclude + This property holds the objects not to be affected by this animation. + \sa matchTargets */ QList *QmlPropertyAction::exclude() { @@ -1019,7 +1021,7 @@ void QmlPropertyAction::transition(QmlStateActions &actions, bool hasTarget = !d->propertyName.isEmpty() || d->target; if (hasSelectors && hasTarget) { - qmlInfo(tr("targets/properties/exclude and target/property are mutually exclusive."), this); + qmlInfo(tr("matchTargets/matchProperties/exclude and target/property are mutually exclusive."), this); return; } @@ -1227,7 +1229,7 @@ QML_DEFINE_TYPE(Qt,4,6,ParentAction,QmlParentAction) Animate a set of properties over 200ms, from their values in the start state to their values in the end state of the transition: \code - NumberAnimation { properties: "x,y,scale"; duration: 200 } + NumberAnimation { matchProperties: "x,y,scale"; duration: 200 } \endcode */ @@ -1790,11 +1792,47 @@ void QmlPropertyAnimation::setEasing(const QString &e) } /*! - \qmlproperty string PropertyAnimation::properties - This property holds the properties this animation should be applied to. + \qmlproperty Object PropertyAnimation::target + This property holds an explicit target object to animate. + + The exact effect of the \c target property depends on how the animation + is being used. Refer to the \l animation documentation for details. +*/ + +/*! + \qmlproperty string PropertyAnimation::property + This property holds an explicit property to animated. + + The exact effect of the \c property property depends on how the animation + is being used. Refer to the \l animation documentation for details. +*/ + +/*! + \qmlproperty string PropertyAnimation::matchProperties + This property holds a comma-separated list of property names this animation + will match against. These names are used in conjunction with matchTargets + to create a list of properties that the animation will animate, assuming those + properties have changed. + + In the following example, the change in 'x' will be animated by the transition, while + the change in 'y' will not. + \qml + State { + PropertyChanges { + target: myItem + x: 15; y: 15 + } + } + Transition { + PropertyAnimation { + matchProperties: "x" + } + } + \endqml + + This property is typically used for an animation appearing as part of a Transition. - This is a comma-separated list of properties that should use - this animation when they change. + By default, no property names will be matched. */ QString QmlPropertyAnimation::properties() const { @@ -1813,9 +1851,37 @@ void QmlPropertyAnimation::setProperties(const QString &prop) } /*! - \qmlproperty list PropertyAnimation::targets - This property holds the items selected to be affected by this animation (all if not set). - \sa exclude + \qmlproperty list PropertyAnimation::matchTargets + This property holds a list of objects this animation will match against. + These objects are used in conjunction with matchProperties to create a list of properties + that the animation will animate, assuming those properties have changed. + + In the following example, the changes to \c myItem will be animated by the transition, while + the changes to \c myOtherItem will not. + \qml + State { + PropertyChanges { + target: myItem + x: 15; y: 15 + } + PropertyChanges { + target: myOtherItem + x: 30; y: 30 + } + } + Transition { + PropertyAnimation { + matchTargets: myItem + matchProperties: "x,y" + } + } + \endqml + + This property is typically used for an animation appearing as part of a Transition. + + By default, all changing targets will be matched. + + \sa exclude matchProperties */ QList *QmlPropertyAnimation::targets() { @@ -1824,9 +1890,9 @@ QList *QmlPropertyAnimation::targets() } /*! - \qmlproperty list PropertyAnimation::exclude + \qmlproperty list PropertyAnimation::exclude This property holds the items not to be affected by this animation. - \sa targets + \sa matchTargets */ QList *QmlPropertyAnimation::exclude() { @@ -1943,7 +2009,7 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions, bool hasTarget = !d->propertyName.isEmpty() || d->target; if (hasSelectors && hasTarget) { - qmlInfo(tr("targets/properties/exclude and target/property are mutually exclusive."), this); + qmlInfo(tr("matchTargets/matchProperties/exclude and target/property are mutually exclusive."), this); return; } diff --git a/src/declarative/util/qmlanimation_p.h b/src/declarative/util/qmlanimation_p.h index 214bab9..3a9839e 100644 --- a/src/declarative/util/qmlanimation_p.h +++ b/src/declarative/util/qmlanimation_p.h @@ -191,8 +191,8 @@ class QmlPropertyAction : public QmlAbstractAnimation Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged) Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY targetChanged) - Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged) - Q_PROPERTY(QList* targets READ targets) + Q_PROPERTY(QString matchProperties READ properties WRITE setProperties NOTIFY propertiesChanged) + Q_PROPERTY(QList* matchTargets READ targets) Q_PROPERTY(QList* exclude READ exclude) Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged) @@ -260,8 +260,8 @@ class Q_AUTOTEST_EXPORT QmlPropertyAnimation : public QmlAbstractAnimation Q_PROPERTY(QString easing READ easing WRITE setEasing NOTIFY easingChanged) Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged) Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY targetChanged) - Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged) - Q_PROPERTY(QList* targets READ targets) + Q_PROPERTY(QString matchProperties READ properties WRITE setProperties NOTIFY propertiesChanged) + Q_PROPERTY(QList* matchTargets READ targets) Q_PROPERTY(QList* exclude READ exclude) public: diff --git a/tests/auto/declarative/animations/data/badtype4.qml b/tests/auto/declarative/animations/data/badtype4.qml index 0c0a636..5db6c17 100644 --- a/tests/auto/declarative/animations/data/badtype4.qml +++ b/tests/auto/declarative/animations/data/badtype4.qml @@ -20,7 +20,7 @@ Rectangle { } transitions: Transition { //comment out each in turn to make sure each only animates the relevant property - ColorAnimation { properties: "x,color"; duration: 1000 } //x is real, color is color - NumberAnimation { properties: "x,color"; duration: 1000 } //x is real, color is color + ColorAnimation { matchProperties: "x,color"; duration: 1000 } //x is real, color is color + NumberAnimation { matchProperties: "x,color"; duration: 1000 } //x is real, color is color } } diff --git a/tests/auto/declarative/animations/data/dotproperty.qml b/tests/auto/declarative/animations/data/dotproperty.qml index ee076c2..3ddb002 100644 --- a/tests/auto/declarative/animations/data/dotproperty.qml +++ b/tests/auto/declarative/animations/data/dotproperty.qml @@ -16,9 +16,9 @@ Rectangle { } states: State { name: "state1" - PropertyChanges { target: MyRect; pen.color: "blue" } + PropertyChanges { target: MyRect; border.color: "blue" } } transitions: Transition { - ColorAnimation { properties: "pen.color"; duration: 1000 } + ColorAnimation { matchProperties: "border.color"; duration: 1000 } } } diff --git a/tests/auto/declarative/animations/data/mixedtype1.qml b/tests/auto/declarative/animations/data/mixedtype1.qml index ed50582..5ecf14f 100644 --- a/tests/auto/declarative/animations/data/mixedtype1.qml +++ b/tests/auto/declarative/animations/data/mixedtype1.qml @@ -19,6 +19,6 @@ Rectangle { PropertyChanges { target: MyRect; x: 200; border.width: 10 } } transitions: Transition { - PropertyAnimation { properties: "x,border.width"; duration: 1000 } //x is real, border.width is int + PropertyAnimation { matchProperties: "x,border.width"; duration: 1000 } //x is real, border.width is int } } diff --git a/tests/auto/declarative/animations/data/mixedtype2.qml b/tests/auto/declarative/animations/data/mixedtype2.qml index 4854c2e..645f1d0 100644 --- a/tests/auto/declarative/animations/data/mixedtype2.qml +++ b/tests/auto/declarative/animations/data/mixedtype2.qml @@ -19,6 +19,6 @@ Rectangle { PropertyChanges { target: MyRect; x: 200; color: "blue" } } transitions: Transition { - PropertyAnimation { properties: "x,color"; duration: 1000 } //x is real, color is color + PropertyAnimation { matchProperties: "x,color"; duration: 1000 } //x is real, color is color } } diff --git a/tests/auto/declarative/behaviors/data/nonSelecting.qml b/tests/auto/declarative/behaviors/data/nonSelecting.qml index ae9a9f5..ba36d93 100644 --- a/tests/auto/declarative/behaviors/data/nonSelecting.qml +++ b/tests/auto/declarative/behaviors/data/nonSelecting.qml @@ -8,7 +8,7 @@ Rectangle { width: 100; height: 100; color: "green" x: Behavior { objectName: "MyBehavior"; - NumberAnimation { target: rect; property: "y"; duration: 200; } + NumberAnimation { target: rect; property: "x"; duration: 200; } } } MouseRegion { diff --git a/tests/auto/declarative/behaviors/data/nonSelecting2.qml b/tests/auto/declarative/behaviors/data/nonSelecting2.qml new file mode 100644 index 0000000..e9849eb --- /dev/null +++ b/tests/auto/declarative/behaviors/data/nonSelecting2.qml @@ -0,0 +1,26 @@ +import Qt 4.6 +Rectangle { + width: 400 + height: 400 + Rectangle { + id: rect + objectName: "MyRect" + width: 100; height: 100; color: "green" + x: Behavior { + objectName: "MyBehavior"; + NumberAnimation { matchTargets: rect; matchProperties: "y"; duration: 200; } + } + } + MouseRegion { + id: clicker + anchors.fill: parent + } + states: State { + name: "moved" + when: clicker.pressed + PropertyChanges { + target: rect + x: 200 + } + } +} diff --git a/tests/auto/declarative/behaviors/tst_behaviors.cpp b/tests/auto/declarative/behaviors/tst_behaviors.cpp index da910d9..6343968 100644 --- a/tests/auto/declarative/behaviors/tst_behaviors.cpp +++ b/tests/auto/declarative/behaviors/tst_behaviors.cpp @@ -208,14 +208,27 @@ void tst_behaviors::emptyBehavior() void tst_behaviors::nonSelectingBehavior() { - QmlEngine engine; - QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/nonSelecting.qml")); - QmlGraphicsRectangle *rect = qobject_cast(c.create()); - QVERIFY(rect); + { + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/nonSelecting.qml")); + QmlGraphicsRectangle *rect = qobject_cast(c.create()); + QVERIFY(rect); - rect->setState("moved"); - qreal x = qobject_cast(rect->findChild("MyRect"))->x(); - QCOMPARE(x, qreal(200)); //should change immediately + rect->setState("moved"); + qreal x = qobject_cast(rect->findChild("MyRect"))->x(); + QCOMPARE(x, qreal(200)); //should change immediately + } + + { + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/nonSelecting2.qml")); + QmlGraphicsRectangle *rect = qobject_cast(c.create()); + QVERIFY(rect); + + rect->setState("moved"); + qreal x = qobject_cast(rect->findChild("MyRect"))->x(); + QCOMPARE(x, qreal(200)); //should change immediately + } } void tst_behaviors::reassignedAnimation() diff --git a/tests/auto/declarative/layouts/data/grid-animated.qml b/tests/auto/declarative/layouts/data/grid-animated.qml index 9edccaf..6b128ce 100644 --- a/tests/auto/declarative/layouts/data/grid-animated.qml +++ b/tests/auto/declarative/layouts/data/grid-animated.qml @@ -7,17 +7,17 @@ Item { columns: 3 add: Transition { NumberAnimation { - properties: "x,y"; from: -100 + matchProperties: "x,y"; from: -100 } } remove: Transition { NumberAnimation { - properties: "x,y"; to: -100 + matchProperties: "x,y"; to: -100 } } move: Transition { NumberAnimation { - properties: "x,y"; + matchProperties: "x,y"; } } Rectangle { diff --git a/tests/auto/declarative/layouts/data/horizontal-animated.qml b/tests/auto/declarative/layouts/data/horizontal-animated.qml index f757d18..c29d6df 100644 --- a/tests/auto/declarative/layouts/data/horizontal-animated.qml +++ b/tests/auto/declarative/layouts/data/horizontal-animated.qml @@ -6,17 +6,17 @@ Item { Row { add: Transition { NumberAnimation { - properties: "x"; from: -100 + matchProperties: "x"; from: -100 } } remove: Transition { NumberAnimation { - properties: "x"; to: -100 + matchProperties: "x"; to: -100 } } move: Transition { NumberAnimation { - properties: "x"; + matchProperties: "x"; } } Rectangle { diff --git a/tests/auto/declarative/layouts/data/vertical-animated.qml b/tests/auto/declarative/layouts/data/vertical-animated.qml index f52a78a..fcbc5f7 100644 --- a/tests/auto/declarative/layouts/data/vertical-animated.qml +++ b/tests/auto/declarative/layouts/data/vertical-animated.qml @@ -6,17 +6,17 @@ Item { Column { add: Transition { NumberAnimation { - properties: "y"; from: -100 + matchProperties: "y"; from: -100 } } remove: Transition { NumberAnimation { - properties: "y"; to: -100 + matchProperties: "y"; to: -100 } } move: Transition { NumberAnimation { - properties: "y"; + matchProperties: "y"; } } Rectangle { diff --git a/tests/auto/declarative/visual/bindinganimation/bindinganimation.qml b/tests/auto/declarative/visual/bindinganimation/bindinganimation.qml index 90ef1e5..efbb1b4 100644 --- a/tests/auto/declarative/visual/bindinganimation/bindinganimation.qml +++ b/tests/auto/declarative/visual/bindinganimation/bindinganimation.qml @@ -28,7 +28,7 @@ Rectangle { transitions: [ Transition { NumberAnimation { - properties: "x" + matchProperties: "x" } } ] diff --git a/tests/auto/declarative/visual/easing/easing.qml b/tests/auto/declarative/visual/easing/easing.qml index f81400b..1e8e907 100644 --- a/tests/auto/declarative/visual/easing/easing.qml +++ b/tests/auto/declarative/visual/easing/easing.qml @@ -176,7 +176,7 @@ Rectangle { to: "to" reversible: true NumberAnimation { - properties: "x" + matchProperties: "x" easing: type duration: 1000 } -- cgit v0.12 From 9fe17d149abcec38dcf0a9597b0ae4cea892ffd1 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 6 Nov 2009 12:51:53 +1000 Subject: Missing qfxwebview rename --- tests/auto/declarative/declarative.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index a061d56..0d71bf7 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -14,7 +14,6 @@ SUBDIRS += \ qfxloader \ # Cover qfxtextedit \ # Cover qfxtextinput \ # Cover - qfxwebview \ # Cover qmetaobjectbuilder \ # Cover qmlbinding \ # Cover qmlcontext \ # Cover @@ -25,6 +24,7 @@ SUBDIRS += \ qmlgraphicsborderimage \ # Cover qmlgraphicsparticles \ # Cover qmlgraphicstext \ # Cover + qmlgraphicswebview \ # Cover qmlinfo \ # Cover qmllanguage \ # Cover qmllist \ # Cover -- cgit v0.12 From 53ee58735e70ff185b72dae54fe84c8f6df052aa Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 6 Nov 2009 13:00:45 +1000 Subject: autotest for Connection element --- tests/auto/declarative/declarative.pro | 1 + .../qmlconnection/data/test-connection.qml | 10 +++ .../declarative/qmlconnection/qmlconnection.pro | 8 ++ .../qmlconnection/tst_qmlconnection.cpp | 85 ++++++++++++++++++++++ 4 files changed, 104 insertions(+) create mode 100644 tests/auto/declarative/qmlconnection/data/test-connection.qml create mode 100644 tests/auto/declarative/qmlconnection/qmlconnection.pro create mode 100644 tests/auto/declarative/qmlconnection/tst_qmlconnection.cpp diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 88134f9..04ce641 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -17,6 +17,7 @@ SUBDIRS += \ qfxwebview \ # Cover qmetaobjectbuilder \ # Cover qmlbinding \ # Cover + qmlconnection \ # Cover qmlcontext \ # Cover qmldom \ # Cover qmlecmascript \ # Cover diff --git a/tests/auto/declarative/qmlconnection/data/test-connection.qml b/tests/auto/declarative/qmlconnection/data/test-connection.qml new file mode 100644 index 0000000..9534621 --- /dev/null +++ b/tests/auto/declarative/qmlconnection/data/test-connection.qml @@ -0,0 +1,10 @@ +import Qt 4.6 + +Item { + id: screen; width: 50 + + property bool tested: false + signal testMe + + Connection { sender: screen; signal: "widthChanged()"; script: screen.tested = true } +} diff --git a/tests/auto/declarative/qmlconnection/qmlconnection.pro b/tests/auto/declarative/qmlconnection/qmlconnection.pro new file mode 100644 index 0000000..3d46fa6 --- /dev/null +++ b/tests/auto/declarative/qmlconnection/qmlconnection.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + +SOURCES += tst_qmlconnection.cpp + +# Define SRCDIR equal to test's source directory +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qmlconnection/tst_qmlconnection.cpp b/tests/auto/declarative/qmlconnection/tst_qmlconnection.cpp new file mode 100644 index 0000000..c6d2cc4 --- /dev/null +++ b/tests/auto/declarative/qmlconnection/tst_qmlconnection.cpp @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include +#include +#include +#include +#include "../../../shared/util.h" + +class tst_qmlconnection : public QObject + +{ + Q_OBJECT +public: + tst_qmlconnection(); + +private slots: + void connection(); + +private: + QmlEngine engine; +}; + +tst_qmlconnection::tst_qmlconnection() +{ +} + +void tst_qmlconnection::connection() +{ + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/test-connection.qml")); + QmlGraphicsItem *item = qobject_cast(c.create()); + + QVERIFY(item != 0); + + QCOMPARE(item->property("tested").toBool(), false); + QCOMPARE(item->width(), 50.); + emit item->setWidth(100.); + QCOMPARE(item->width(), 100.); + QCOMPARE(item->property("tested").toBool(), true); + + delete item; +} + +QTEST_MAIN(tst_qmlconnection) + +#include "tst_qmlconnection.moc" -- cgit v0.12 From 9cd41cbd61afd2459c0c3f053aa45a02954ef77c Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 6 Nov 2009 13:13:29 +1000 Subject: Test Keys and KeyNavigation attached props. Fix Keys onPressed --- doc/src/declarative/focus.qdoc | 2 + src/declarative/graphicsitems/qmlgraphicsitem.cpp | 74 ++++++- tests/auto/declarative/declarative.pro | 1 + .../auto/declarative/qmlgraphicsitem/data/keys.qml | 15 ++ .../qmlgraphicsitem/qmlgraphicsitem.pro | 7 + .../qmlgraphicsitem/tst_qmlgraphicsitem.cpp | 237 +++++++++++++++++++++ 6 files changed, 334 insertions(+), 2 deletions(-) create mode 100644 tests/auto/declarative/qmlgraphicsitem/data/keys.qml create mode 100644 tests/auto/declarative/qmlgraphicsitem/qmlgraphicsitem.pro create mode 100644 tests/auto/declarative/qmlgraphicsitem/tst_qmlgraphicsitem.cpp diff --git a/doc/src/declarative/focus.qdoc b/doc/src/declarative/focus.qdoc index ec6a02f..6eca667 100644 --- a/doc/src/declarative/focus.qdoc +++ b/doc/src/declarative/focus.qdoc @@ -75,6 +75,8 @@ Item { \endlist +See also the \l {Keys}{Keys attached property} and {KeyNavigation}{KeyNavigation attached property}. + \section1 Querying the Active Focus Item Whether or not an \l Item has \e {active focus} can be queried through the diff --git a/src/declarative/graphicsitems/qmlgraphicsitem.cpp b/src/declarative/graphicsitems/qmlgraphicsitem.cpp index 77e6db8..a46c2be 100644 --- a/src/declarative/graphicsitems/qmlgraphicsitem.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsitem.cpp @@ -389,6 +389,76 @@ void QmlGraphicsItemKeyFilter::componentComplete() if (m_next) m_next->componentComplete(); } + +/*! + \qmlclass KeyNavigation + \brief The KeyNavigation attached property supports key navigation by arrow keys. + + It is common in key-based UIs to use arrow keys to navigate + between focussed items. The KeyNavigation property provides a + convenient way of specifying which item will gain focus + when an arrow key is pressed. The following example provides + key navigation for a 2x2 grid of items. + + \code + Grid { + columns: 2 + width: 100; height: 100 + Rectangle { + id: item1 + focus: true + width: 50; height: 50 + color: focus ? "red" : "lightgray" + KeyNavigation.right: item2 + KeyNavigation.down: item3 + } + Rectangle { + id: item2 + width: 50; height: 50 + color: focus ? "red" : "lightgray" + KeyNavigation.left: item1 + KeyNavigation.down: item4 + } + Rectangle { + id: item3 + width: 50; height: 50 + color: focus ? "red" : "lightgray" + KeyNavigation.right: item4 + KeyNavigation.up: item1 + } + Rectangle { + id: item4 + width: 50; height: 50 + color: focus ? "red" : "lightgray" + KeyNavigation.left: item3 + KeyNavigation.up: item2 + } + } + \endcode + + KeyNavigation receives key events after the item it is attached to. + If the item accepts an arrow key event, the KeyNavigation + attached property will not receive an event for that key. + + If an item has been set for a direction and the KeyNavigation + attached property receives the corresponding + key press and release events, the events will be accepted by + KeyNaviagtion and will not propagate any further. + + \sa {Keys}{Keys attached property} +*/ + +/*! + \qmlproperty Item KeyNavigation::left + \qmlproperty Item KeyNavigation::right + \qmlproperty Item KeyNavigation::up + \qmlproperty Item KeyNavigation::down + + These properties hold the item to assign focus to + when Key_Left, Key_Right, Key_Up or Key_Down are + pressed. +*/ + class QmlGraphicsKeyNavigationAttachedPrivate : public QObjectPrivate { public: @@ -606,7 +676,7 @@ void QmlGraphicsKeyNavigationAttached::keyReleased(QKeyEvent *event) See \l {Qt::Key}{Qt.Key} for the list of keyboard codes. - \sa KeyEvent + \sa KeyEvent, {KeyNavigation}{KeyNavigation attached property} */ /*! @@ -1119,7 +1189,7 @@ void QmlGraphicsKeysAttached::keyPressed(QKeyEvent *event) // If we specifically handle a key then default to accepted ke.setAccepted(true); int idx = QmlGraphicsKeysAttached::staticMetaObject.indexOfSignal(keySignal); - metaObject()->method(idx).invoke(this, Q_ARG(QmlGraphicsKeysAttached, &ke)); + metaObject()->method(idx).invoke(this, Qt::DirectConnection, Q_ARG(QmlGraphicsKeyEvent*, &ke)); } } if (!ke.isAccepted()) diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 02d5a55..472fd93 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -20,6 +20,7 @@ SUBDIRS += \ qmldom \ # Cover qmlecmascript \ # Cover qmlfontloader \ # Cover + qmlgraphicsitem \ # Cover qmlgraphicsborderimage \ # Cover qmlgraphicsparticles \ # Cover qmlgraphicstext \ # Cover diff --git a/tests/auto/declarative/qmlgraphicsitem/data/keys.qml b/tests/auto/declarative/qmlgraphicsitem/data/keys.qml new file mode 100644 index 0000000..7c16559 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicsitem/data/keys.qml @@ -0,0 +1,15 @@ +import Qt 4.6 + +Item { + focus: true + Keys.onPressed: keysTestObject.keyPress(event.key, event.text, event.modifiers) + Keys.onReleased: { keysTestObject.keyRelease(event.key, event.text, event.modifiers); event.accepted = true; } + Keys.onReturnPressed: keysTestObject.keyPress(event.key, "Return", event.modifiers) + Keys.forwardTo: [ item2 ] + + Item { + id: item2 + Keys.onPressed: keysTestObject.forwardedKey(event.key) + Keys.onReleased: keysTestObject.forwardedKey(event.key) + } +} diff --git a/tests/auto/declarative/qmlgraphicsitem/qmlgraphicsitem.pro b/tests/auto/declarative/qmlgraphicsitem/qmlgraphicsitem.pro new file mode 100644 index 0000000..ddabf9a --- /dev/null +++ b/tests/auto/declarative/qmlgraphicsitem/qmlgraphicsitem.pro @@ -0,0 +1,7 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + +SOURCES += tst_qmlgraphicsitem.cpp + +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qmlgraphicsitem/tst_qmlgraphicsitem.cpp b/tests/auto/declarative/qmlgraphicsitem/tst_qmlgraphicsitem.cpp new file mode 100644 index 0000000..b3b5374 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicsitem/tst_qmlgraphicsitem.cpp @@ -0,0 +1,237 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include +#include +#include +#include +#include + +class tst_QmlGraphicsItem : public QObject + +{ + Q_OBJECT +public: + tst_QmlGraphicsItem(); + +private slots: + void keys(); + void keyNavigation(); + +private: + template + T *findItem(QmlGraphicsItem *parent, const QString &objectName); +}; + +class KeysTestObject : public QObject +{ + Q_OBJECT +public: + KeysTestObject() : mKey(0), mModifiers(0), mForwardedKey(0) {} + + void reset() { + mKey = 0; + mText = QString(); + mModifiers = 0; + mForwardedKey = 0; + } + +public slots: + void keyPress(int key, QString text, int modifiers) { + mKey = key; + mText = text; + mModifiers = modifiers; + } + void keyRelease(int key, QString text, int modifiers) { + mKey = key; + mText = text; + mModifiers = modifiers; + } + void forwardedKey(int key) { + mForwardedKey = key; + } + +public: + int mKey; + QString mText; + int mModifiers; + int mForwardedKey; + +private: +}; + + +tst_QmlGraphicsItem::tst_QmlGraphicsItem() +{ +} + +void tst_QmlGraphicsItem::keys() +{ + QmlView *canvas = new QmlView(0); + canvas->setFixedSize(240,320); + + canvas->setUrl(QUrl("file://" SRCDIR "/data/keys.qml")); + + KeysTestObject *testObject = new KeysTestObject; + canvas->rootContext()->setContextProperty("keysTestObject", testObject); + + canvas->execute(); + canvas->show(); + qApp->processEvents(); + + QEvent wa(QEvent::WindowActivate); + QApplication::sendEvent(canvas, &wa); + QFocusEvent fe(QEvent::FocusIn); + QApplication::sendEvent(canvas, &fe); + + QKeyEvent key(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier, "A", false, 1); + QApplication::sendEvent(canvas, &key); + QCOMPARE(testObject->mKey, int(Qt::Key_A)); + QCOMPARE(testObject->mForwardedKey, int(Qt::Key_A)); + QCOMPARE(testObject->mText, QLatin1String("A")); + QVERIFY(testObject->mModifiers == Qt::NoModifier); + QVERIFY(!key.isAccepted()); + + testObject->reset(); + + key = QKeyEvent(QEvent::KeyRelease, Qt::Key_A, Qt::ShiftModifier, "A", false, 1); + QApplication::sendEvent(canvas, &key); + QCOMPARE(testObject->mKey, int(Qt::Key_A)); + QCOMPARE(testObject->mForwardedKey, int(Qt::Key_A)); + QCOMPARE(testObject->mText, QLatin1String("A")); + QVERIFY(testObject->mModifiers == Qt::ShiftModifier); + QVERIFY(key.isAccepted()); + + testObject->reset(); + + key = QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier, "", false, 1); + QApplication::sendEvent(canvas, &key); + QCOMPARE(testObject->mKey, int(Qt::Key_Return)); + QCOMPARE(testObject->mForwardedKey, int(Qt::Key_Return)); + QCOMPARE(testObject->mText, QLatin1String("Return")); + QVERIFY(testObject->mModifiers == Qt::NoModifier); + QVERIFY(key.isAccepted()); + + delete canvas; + delete testObject; +} + +void tst_QmlGraphicsItem::keyNavigation() +{ + QmlView *canvas = new QmlView(0); + canvas->setFixedSize(240,320); + + canvas->setUrl(QUrl("file://" SRCDIR "/data/keynavigation.qml")); + canvas->execute(); + canvas->show(); + qApp->processEvents(); + + QEvent wa(QEvent::WindowActivate); + QApplication::sendEvent(canvas, &wa); + QFocusEvent fe(QEvent::FocusIn); + QApplication::sendEvent(canvas, &fe); + + QmlGraphicsItem *item = findItem(canvas->root(), "item1"); + QVERIFY(item); + QVERIFY(item->hasFocus()); + + // right + QKeyEvent key(QEvent::KeyPress, Qt::Key_Right, Qt::NoModifier, "", false, 1); + QApplication::sendEvent(canvas, &key); + QVERIFY(key.isAccepted()); + + item = findItem(canvas->root(), "item2"); + QVERIFY(item); + QVERIFY(item->hasFocus()); + + // down + key = QKeyEvent(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier, "", false, 1); + QApplication::sendEvent(canvas, &key); + QVERIFY(key.isAccepted()); + + item = findItem(canvas->root(), "item4"); + QVERIFY(item); + QVERIFY(item->hasFocus()); + + // left + key = QKeyEvent(QEvent::KeyPress, Qt::Key_Left, Qt::NoModifier, "", false, 1); + QApplication::sendEvent(canvas, &key); + QVERIFY(key.isAccepted()); + + item = findItem(canvas->root(), "item3"); + QVERIFY(item); + QVERIFY(item->hasFocus()); + + // up + key = QKeyEvent(QEvent::KeyPress, Qt::Key_Up, Qt::NoModifier, "", false, 1); + QApplication::sendEvent(canvas, &key); + QVERIFY(key.isAccepted()); + + item = findItem(canvas->root(), "item1"); + QVERIFY(item); + QVERIFY(item->hasFocus()); +} + +template +T *tst_QmlGraphicsItem::findItem(QmlGraphicsItem *parent, const QString &objectName) +{ + const QMetaObject &mo = T::staticMetaObject; + //qDebug() << parent->QGraphicsObject::children().count() << "children"; + for (int i = 0; i < parent->QGraphicsObject::children().count(); ++i) { + QmlGraphicsItem *item = qobject_cast(parent->QGraphicsObject::children().at(i)); + if(!item) + continue; + //qDebug() << "try" << item; + if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) + return static_cast(item); + item = findItem(item, objectName); + if (item) + return static_cast(item); + } + + return 0; +} + + + +QTEST_MAIN(tst_QmlGraphicsItem) + +#include "tst_qmlgraphicsitem.moc" -- cgit v0.12 From 9c984b6b421e7cc6c091623f63ed84ce700f1ee1 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 6 Nov 2009 13:28:34 +1000 Subject: Add autotest for target/property matchTargets/matchProperties semantics. --- .../declarative/animations/data/properties.qml | 14 +++ .../declarative/animations/data/properties2.qml | 14 +++ .../declarative/animations/data/properties3.qml | 14 +++ .../declarative/animations/data/properties4.qml | 14 +++ .../declarative/animations/data/properties5.qml | 14 +++ .../animations/data/propertiesTransition.qml | 29 +++++ .../animations/data/propertiesTransition2.qml | 29 +++++ .../animations/data/propertiesTransition3.qml | 29 +++++ .../animations/data/propertiesTransition4.qml | 29 +++++ .../animations/data/propertiesTransition5.qml | 29 +++++ .../animations/data/propertiesTransition6.qml | 29 +++++ .../auto/declarative/animations/tst_animations.cpp | 139 +++++++++++++++++++++ 12 files changed, 383 insertions(+) create mode 100644 tests/auto/declarative/animations/data/properties.qml create mode 100644 tests/auto/declarative/animations/data/properties2.qml create mode 100644 tests/auto/declarative/animations/data/properties3.qml create mode 100644 tests/auto/declarative/animations/data/properties4.qml create mode 100644 tests/auto/declarative/animations/data/properties5.qml create mode 100644 tests/auto/declarative/animations/data/propertiesTransition.qml create mode 100644 tests/auto/declarative/animations/data/propertiesTransition2.qml create mode 100644 tests/auto/declarative/animations/data/propertiesTransition3.qml create mode 100644 tests/auto/declarative/animations/data/propertiesTransition4.qml create mode 100644 tests/auto/declarative/animations/data/propertiesTransition5.qml create mode 100644 tests/auto/declarative/animations/data/propertiesTransition6.qml diff --git a/tests/auto/declarative/animations/data/properties.qml b/tests/auto/declarative/animations/data/properties.qml new file mode 100644 index 0000000..a8023b4 --- /dev/null +++ b/tests/auto/declarative/animations/data/properties.qml @@ -0,0 +1,14 @@ +import Qt 4.6 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + x: NumberAnimation { to: 200; running: true; } + } +} diff --git a/tests/auto/declarative/animations/data/properties2.qml b/tests/auto/declarative/animations/data/properties2.qml new file mode 100644 index 0000000..aab7661 --- /dev/null +++ b/tests/auto/declarative/animations/data/properties2.qml @@ -0,0 +1,14 @@ +import Qt 4.6 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + x: NumberAnimation { matchTargets: theRect; matchProperties: "x"; to: 200; running: true } + } +} diff --git a/tests/auto/declarative/animations/data/properties3.qml b/tests/auto/declarative/animations/data/properties3.qml new file mode 100644 index 0000000..fd21a85 --- /dev/null +++ b/tests/auto/declarative/animations/data/properties3.qml @@ -0,0 +1,14 @@ +import Qt 4.6 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + x: NumberAnimation { target: theRect; property: "x"; to: 300; running: true } + } +} diff --git a/tests/auto/declarative/animations/data/properties4.qml b/tests/auto/declarative/animations/data/properties4.qml new file mode 100644 index 0000000..e23651c --- /dev/null +++ b/tests/auto/declarative/animations/data/properties4.qml @@ -0,0 +1,14 @@ +import Qt 4.6 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + x: NumberAnimation { target: theRect; property: "y"; to: 200; running: true } + } +} diff --git a/tests/auto/declarative/animations/data/properties5.qml b/tests/auto/declarative/animations/data/properties5.qml new file mode 100644 index 0000000..25c9866 --- /dev/null +++ b/tests/auto/declarative/animations/data/properties5.qml @@ -0,0 +1,14 @@ +import Qt 4.6 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + x: NumberAnimation { matchTargets: theRect; matchProperties: "y"; to: 200; running: true } + } +} diff --git a/tests/auto/declarative/animations/data/propertiesTransition.qml b/tests/auto/declarative/animations/data/propertiesTransition.qml new file mode 100644 index 0000000..75603b9 --- /dev/null +++ b/tests/auto/declarative/animations/data/propertiesTransition.qml @@ -0,0 +1,29 @@ +import Qt 4.6 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + } + + states: State { + name: "moved" + PropertyChanges { + target: theRect + x: 200 + } + } + transitions: Transition { + NumberAnimation { matchTargets: theRect; matchProperties: "x" } + } + + MouseRegion { + anchors.fill: parent + onClicked: parent.state = "moved" + } +} diff --git a/tests/auto/declarative/animations/data/propertiesTransition2.qml b/tests/auto/declarative/animations/data/propertiesTransition2.qml new file mode 100644 index 0000000..ae59157 --- /dev/null +++ b/tests/auto/declarative/animations/data/propertiesTransition2.qml @@ -0,0 +1,29 @@ +import Qt 4.6 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + } + + states: State { + name: "moved" + PropertyChanges { + target: theRect + x: 200 + } + } + transitions: Transition { + NumberAnimation { target: theRect; property: "y"; to: 200 } + } + + MouseRegion { + anchors.fill: parent + onClicked: parent.state = "moved" + } +} diff --git a/tests/auto/declarative/animations/data/propertiesTransition3.qml b/tests/auto/declarative/animations/data/propertiesTransition3.qml new file mode 100644 index 0000000..eedba7b --- /dev/null +++ b/tests/auto/declarative/animations/data/propertiesTransition3.qml @@ -0,0 +1,29 @@ +import Qt 4.6 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + } + + states: State { + name: "moved" + PropertyChanges { + target: theRect + x: 200 + } + } + transitions: Transition { + NumberAnimation { matchTargets: theRect; matchProperties: "y" } + } + + MouseRegion { + anchors.fill: parent + onClicked: parent.state = "moved" + } +} diff --git a/tests/auto/declarative/animations/data/propertiesTransition4.qml b/tests/auto/declarative/animations/data/propertiesTransition4.qml new file mode 100644 index 0000000..301f796 --- /dev/null +++ b/tests/auto/declarative/animations/data/propertiesTransition4.qml @@ -0,0 +1,29 @@ +import Qt 4.6 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + } + + states: State { + name: "moved" + PropertyChanges { + target: theRect + x: 200 + } + } + transitions: Transition { + NumberAnimation { target: theRect; matchProperties: "x" } + } + + MouseRegion { + anchors.fill: parent + onClicked: parent.state = "moved" + } +} diff --git a/tests/auto/declarative/animations/data/propertiesTransition5.qml b/tests/auto/declarative/animations/data/propertiesTransition5.qml new file mode 100644 index 0000000..565c519 --- /dev/null +++ b/tests/auto/declarative/animations/data/propertiesTransition5.qml @@ -0,0 +1,29 @@ +import Qt 4.6 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + } + + states: State { + name: "moved" + PropertyChanges { + target: theRect + x: 200 + } + } + transitions: Transition { + NumberAnimation { matchTargets: theRect; property: "x" } + } + + MouseRegion { + anchors.fill: parent + onClicked: parent.state = "moved" + } +} diff --git a/tests/auto/declarative/animations/data/propertiesTransition6.qml b/tests/auto/declarative/animations/data/propertiesTransition6.qml new file mode 100644 index 0000000..b541dab --- /dev/null +++ b/tests/auto/declarative/animations/data/propertiesTransition6.qml @@ -0,0 +1,29 @@ +import Qt 4.6 + +Rectangle { + width: 400 + height: 400 + Rectangle { + id: theRect + objectName: "TheRect" + color: "red" + width: 50; height: 50 + x: 100; y: 100 + } + + states: State { + name: "moved" + PropertyChanges { + target: theRect + x: 200 + } + } + transitions: Transition { + NumberAnimation { matchTargets: theItem; matchProperties: "x" } + } + + MouseRegion { + anchors.fill: parent + onClicked: parent.state = "moved" + } +} diff --git a/tests/auto/declarative/animations/tst_animations.cpp b/tests/auto/declarative/animations/tst_animations.cpp index 418a3dc..a4402cb 100644 --- a/tests/auto/declarative/animations/tst_animations.cpp +++ b/tests/auto/declarative/animations/tst_animations.cpp @@ -59,6 +59,8 @@ private slots: void badTypes(); void badProperties(); void mixedTypes(); + void properties(); + void propertiesTransition(); }; #define QTIMED_COMPARE(lhs, rhs) do { \ @@ -245,6 +247,143 @@ void tst_animations::mixedTypes() } } +void tst_animations::properties() +{ + const int waitDuration = 300; + { + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/properties.qml")); + QmlGraphicsRectangle *rect = qobject_cast(c.create()); + QVERIFY(rect); + + QmlGraphicsRectangle *myRect = rect->findChild("TheRect"); + QVERIFY(myRect); + QTest::qWait(waitDuration); + QTIMED_COMPARE(myRect->x(),qreal(200)); + } + + { + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/properties2.qml")); + QmlGraphicsRectangle *rect = qobject_cast(c.create()); + QVERIFY(rect); + + QmlGraphicsRectangle *myRect = rect->findChild("TheRect"); + QVERIFY(myRect); + QTest::qWait(waitDuration); + QTIMED_COMPARE(myRect->x(),qreal(200)); + } + + { + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/properties3.qml")); + QmlGraphicsRectangle *rect = qobject_cast(c.create()); + QVERIFY(rect); + + QmlGraphicsRectangle *myRect = rect->findChild("TheRect"); + QVERIFY(myRect); + QTest::qWait(waitDuration); + QTIMED_COMPARE(myRect->x(),qreal(300)); + } + + { + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/properties4.qml")); + QmlGraphicsRectangle *rect = qobject_cast(c.create()); + QVERIFY(rect); + + QmlGraphicsRectangle *myRect = rect->findChild("TheRect"); + QVERIFY(myRect); + QTest::qWait(waitDuration); + QTIMED_COMPARE(myRect->y(),qreal(200)); + QTIMED_COMPARE(myRect->x(),qreal(100)); + } + + { + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/properties5.qml")); + QmlGraphicsRectangle *rect = qobject_cast(c.create()); + QVERIFY(rect); + + QmlGraphicsRectangle *myRect = rect->findChild("TheRect"); + QVERIFY(myRect); + QTest::qWait(waitDuration); + QTIMED_COMPARE(myRect->x(),qreal(100)); + QTIMED_COMPARE(myRect->y(),qreal(100)); + } +} + +void tst_animations::propertiesTransition() +{ + const int waitDuration = 300; + { + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/propertiesTransition.qml")); + QmlGraphicsRectangle *rect = qobject_cast(c.create()); + QVERIFY(rect); + + rect->setState("moved"); + QmlGraphicsRectangle *myRect = rect->findChild("TheRect"); + QVERIFY(myRect); + QTest::qWait(waitDuration); + QTIMED_COMPARE(myRect->x(),qreal(200)); + } + + { + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/propertiesTransition2.qml")); + QmlGraphicsRectangle *rect = qobject_cast(c.create()); + QVERIFY(rect); + + QmlGraphicsRectangle *myRect = rect->findChild("TheRect"); + QVERIFY(myRect); + rect->setState("moved"); + QCOMPARE(myRect->x(),qreal(200)); + QCOMPARE(myRect->y(),qreal(100)); + QTest::qWait(waitDuration); + QTIMED_COMPARE(myRect->y(),qreal(200)); + } + + { + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/propertiesTransition3.qml")); + QmlGraphicsRectangle *rect = qobject_cast(c.create()); + QVERIFY(rect); + + QmlGraphicsRectangle *myRect = rect->findChild("TheRect"); + QVERIFY(myRect); + QTest::ignoreMessage(QtWarningMsg, "QML QmlNumberAnimation (file:///home/brasser/depot/kinetic-declarativeui/qt/tests/auto/declarative/animations/data/propertiesTransition4.qml:22:9) targets/properties/exclude and target/property are mutually exclusive."); + rect->setState("moved"); + QCOMPARE(myRect->x(),qreal(200)); + } + + { + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/propertiesTransition4.qml")); + QmlGraphicsRectangle *rect = qobject_cast(c.create()); + QVERIFY(rect); + + QmlGraphicsRectangle *myRect = rect->findChild("TheRect"); + QVERIFY(myRect); + QTest::ignoreMessage(QtWarningMsg, "QML QmlNumberAnimation (file:///home/brasser/depot/kinetic-declarativeui/qt/tests/auto/declarative/animations/data/propertiesTransition5.qml:22:9) targets/properties/exclude and target/property are mutually exclusive."); + rect->setState("moved"); + QCOMPARE(myRect->x(),qreal(200)); + } + + { + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/propertiesTransition5.qml")); + QmlGraphicsRectangle *rect = qobject_cast(c.create()); + QVERIFY(rect); + + //### should output warning at some point -- theItem doesn't exist + QmlGraphicsRectangle *myRect = rect->findChild("TheRect"); + QVERIFY(myRect); + rect->setState("moved"); + QCOMPARE(myRect->x(),qreal(200)); + } +} + QTEST_MAIN(tst_animations) #include "tst_animations.moc" -- cgit v0.12 From 61d479a412e43255bf0681bec1cfb599cb7be886 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 6 Nov 2009 13:29:03 +1000 Subject: More Timer testing --- tests/auto/declarative/qmltimer/tst_qmltimer.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/auto/declarative/qmltimer/tst_qmltimer.cpp b/tests/auto/declarative/qmltimer/tst_qmltimer.cpp index 9c5dc30..cf54647 100644 --- a/tests/auto/declarative/qmltimer/tst_qmltimer.cpp +++ b/tests/auto/declarative/qmltimer/tst_qmltimer.cpp @@ -91,6 +91,9 @@ void tst_qmltimer::notRepeating() QmlComponent component(&engine, QByteArray("import Qt 4.6\nTimer { interval: 100; running: true }"), QUrl("file://")); QmlTimer *timer = qobject_cast(component.create()); QVERIFY(timer != 0); + QVERIFY(timer->isRunning()); + QVERIFY(!timer->isRepeating()); + QCOMPARE(timer->interval(), 100); TimerHelper helper; connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout())); @@ -107,6 +110,7 @@ void tst_qmltimer::notRepeatingStart() QmlComponent component(&engine, QByteArray("import Qt 4.6\nTimer { interval: 100 }"), QUrl("file://")); QmlTimer *timer = qobject_cast(component.create()); QVERIFY(timer != 0); + QVERIFY(!timer->isRunning()); TimerHelper helper; connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout())); @@ -138,6 +142,11 @@ void tst_qmltimer::repeat() QTest::qWait(TIMEOUT_TIMEOUT); QVERIFY(helper.count > oldCount); + + oldCount = helper.count; + timer->stop(); + QTest::qWait(TIMEOUT_TIMEOUT); + QVERIFY(helper.count == oldCount); } void tst_qmltimer::triggeredOnStart() @@ -146,6 +155,7 @@ void tst_qmltimer::triggeredOnStart() QmlComponent component(&engine, QByteArray("import Qt 4.6\nTimer { interval: 100; running: true; triggeredOnStart: true }"), QUrl("file://")); QmlTimer *timer = qobject_cast(component.create()); QVERIFY(timer != 0); + QVERIFY(timer->triggeredOnStart()); TimerHelper helper; connect(timer, SIGNAL(triggered()), &helper, SLOT(timeout())); -- cgit v0.12 From b2f9f3f2157629eae2544cf6fa2215b26e4e5a84 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 6 Nov 2009 13:49:08 +1000 Subject: Test more anchors. --- tests/auto/declarative/anchors/data/anchors.qml | 27 +++++++++++++++++++++++++ tests/auto/declarative/anchors/tst_anchors.cpp | 16 +++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/tests/auto/declarative/anchors/data/anchors.qml b/tests/auto/declarative/anchors/data/anchors.qml index 377dd2d..765e5b6 100644 --- a/tests/auto/declarative/anchors/data/anchors.qml +++ b/tests/auto/declarative/anchors/data/anchors.qml @@ -114,4 +114,31 @@ Rectangle { y: 70; width: 10; height: 10 anchors.horizontalCenter: parent.left } + Rectangle { + id: Rect22; objectName: "Rect22" + width: 10; height: 10 + anchors.centerIn: MasterRect + } + Rectangle { + id: Rect23; objectName: "Rect23" + anchors.left: MasterRect.left + anchors.leftMargin: 5 + anchors.right: MasterRect.right + anchors.rightMargin: 5 + anchors.top: MasterRect.top + anchors.topMargin: 5 + anchors.bottom: MasterRect.bottom + anchors.bottomMargin: 5 + } + Text { + id: text1; objectName: "text1" + y: 200; + text: "Hello" + } + Text { + id: text2; objectName: "text2" + anchors.baseline: text1.baseline + anchors.left: text1.right + text: "World" + } } diff --git a/tests/auto/declarative/anchors/tst_anchors.cpp b/tests/auto/declarative/anchors/tst_anchors.cpp index 8abf04f..c3a857c 100644 --- a/tests/auto/declarative/anchors/tst_anchors.cpp +++ b/tests/auto/declarative/anchors/tst_anchors.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include @@ -131,6 +132,21 @@ void tst_anchors::basicAnchors() QCOMPARE(findItem(view->root(), QLatin1String("Rect20"))->x(), 235.0); QCOMPARE(findItem(view->root(), QLatin1String("Rect21"))->x(), -5.0); + //centerIn + QCOMPARE(findItem(view->root(), QLatin1String("Rect22"))->x(), 69.0); + QCOMPARE(findItem(view->root(), QLatin1String("Rect22"))->y(), 5.0); + + //margins + QCOMPARE(findItem(view->root(), QLatin1String("Rect23"))->x(), 31.0); + QCOMPARE(findItem(view->root(), QLatin1String("Rect23"))->y(), 5.0); + QCOMPARE(findItem(view->root(), QLatin1String("Rect23"))->width(), 86.0); + QCOMPARE(findItem(view->root(), QLatin1String("Rect23"))->height(), 10.0); + + //baseline + QmlGraphicsText *text1 = findItem(view->root(), QLatin1String("text1")); + QmlGraphicsText *text2 = findItem(view->root(), QLatin1String("text2")); + QCOMPARE(text1->y(), text2->y()); + delete view; } -- cgit v0.12 From 74d768ec05d5acfa8ef5b65535c908f2935f2783 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 6 Nov 2009 14:04:45 +1000 Subject: move ListView state to correct directory --- tests/auto/declarative/declarative.pro | 2 +- .../listview/data/listview-enforcerange.qml | 55 -- .../listview/data/listview-sections.qml | 59 -- tests/auto/declarative/listview/data/listview.qml | 46 -- tests/auto/declarative/listview/listview.pro | 8 - tests/auto/declarative/listview/tst_listview.cpp | 853 --------------------- .../data/listview-enforcerange.qml | 55 ++ .../qmlgraphicslistview/data/listview-sections.qml | 59 ++ .../qmlgraphicslistview/data/listview.qml | 46 ++ .../qmlgraphicslistview/qmlgraphicslistview.pro | 8 + .../tst_qmlgraphicslistview.cpp | 853 +++++++++++++++++++++ 11 files changed, 1022 insertions(+), 1022 deletions(-) delete mode 100644 tests/auto/declarative/listview/data/listview-enforcerange.qml delete mode 100644 tests/auto/declarative/listview/data/listview-sections.qml delete mode 100644 tests/auto/declarative/listview/data/listview.qml delete mode 100644 tests/auto/declarative/listview/listview.pro delete mode 100644 tests/auto/declarative/listview/tst_listview.cpp create mode 100644 tests/auto/declarative/qmlgraphicslistview/data/listview-enforcerange.qml create mode 100644 tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml create mode 100644 tests/auto/declarative/qmlgraphicslistview/data/listview.qml create mode 100644 tests/auto/declarative/qmlgraphicslistview/qmlgraphicslistview.pro create mode 100644 tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 82b135f..64672f6 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -7,7 +7,7 @@ SUBDIRS += \ datetimeformatter \ # Cover examples \ layouts \ # Cover - listview \ # Cover + qmlgraphicslistview \ # Cover qmlgraphicsgridview \ # Cover numberformatter \ # Cover pathview \ # Cover diff --git a/tests/auto/declarative/listview/data/listview-enforcerange.qml b/tests/auto/declarative/listview/data/listview-enforcerange.qml deleted file mode 100644 index 46fddae..0000000 --- a/tests/auto/declarative/listview/data/listview-enforcerange.qml +++ /dev/null @@ -1,55 +0,0 @@ -import Qt 4.6 - -Rectangle { - width: 240 - height: 320 - color: "#ffffff" - Component { - id: myDelegate - Item { - id: wrapper - objectName: "wrapper" - height: 20 - width: 240 - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 120 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - x: 200 - text: wrapper.y - } - } - } - - Component { - id: myHighlight - Rectangle { - color: "lightsteelblue" - } - } - - ListView { - id: list - objectName: "list" - width: 240 - height: 320 - model: testModel - delegate: myDelegate - highlight: myHighlight - preferredHighlightBegin: 100 - preferredHighlightEnd: 100 - highlightRangeMode: "StrictlyEnforceRange" - } -} diff --git a/tests/auto/declarative/listview/data/listview-sections.qml b/tests/auto/declarative/listview/data/listview-sections.qml deleted file mode 100644 index 56700be..0000000 --- a/tests/auto/declarative/listview/data/listview-sections.qml +++ /dev/null @@ -1,59 +0,0 @@ -import Qt 4.6 - -Rectangle { - width: 240 - height: 320 - color: "#ffffff" - resources: [ - Component { - id: myDelegate - Item { - id: wrapper - objectName: "wrapper" - height: ListView.prevSection != ListView.section ? 40 : 20; - width: 240 - Rectangle { - y: wrapper.ListView.prevSection != wrapper.ListView.section ? 20 : 0 - height: 20 - width: parent.width - color: wrapper.ListView.isCurrentItem ? "lightsteelblue" : "white" - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 120 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - x: 200 - text: wrapper.y - } - } - Rectangle { - color: "#99bb99" - height: wrapper.ListView.prevSection != wrapper.ListView.section ? 20 : 0 - width: parent.width - visible: wrapper.ListView.prevSection != wrapper.ListView.section ? true : false - Text { text: wrapper.ListView.section } - } - } - } - ] - ListView { - id: list - objectName: "list" - width: 240 - height: 320 - model: testModel - delegate: myDelegate - sectionExpression: "Math.floor(index/5)" - } -} diff --git a/tests/auto/declarative/listview/data/listview.qml b/tests/auto/declarative/listview/data/listview.qml deleted file mode 100644 index b7b838b..0000000 --- a/tests/auto/declarative/listview/data/listview.qml +++ /dev/null @@ -1,46 +0,0 @@ -import Qt 4.6 - -Rectangle { - width: 240 - height: 320 - color: "#ffffff" - resources: [ - Component { - id: myDelegate - Rectangle { - id: wrapper - objectName: "wrapper" - height: 20 - width: 240 - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 120 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - x: 200 - text: wrapper.y - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - } - } - ] - ListView { - id: list - objectName: "list" - width: 240 - height: 320 - model: testModel - delegate: myDelegate - } -} diff --git a/tests/auto/declarative/listview/listview.pro b/tests/auto/declarative/listview/listview.pro deleted file mode 100644 index 23b0706..0000000 --- a/tests/auto/declarative/listview/listview.pro +++ /dev/null @@ -1,8 +0,0 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative -macx:CONFIG -= app_bundle - -SOURCES += tst_listview.cpp - -# Define SRCDIR equal to test's source directory -DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/listview/tst_listview.cpp b/tests/auto/declarative/listview/tst_listview.cpp deleted file mode 100644 index 5575ace..0000000 --- a/tests/auto/declarative/listview/tst_listview.cpp +++ /dev/null @@ -1,853 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -#include -#include -#include -#include -#include -#include - -class tst_QmlGraphicsListView : public QObject -{ - Q_OBJECT -public: - tst_QmlGraphicsListView(); - -private slots: - // Test both QListModelInterface and QAbstractItemModel model types - void qListModelInterface_items(); - void qAbstractItemModel_items(); - - void qListModelInterface_changed(); - void qAbstractItemModel_changed(); - - void qListModelInterface_inserted(); - void qAbstractItemModel_inserted(); - - void qListModelInterface_removed(); - void qAbstractItemModel_removed(); - - void qListModelInterface_moved(); - void qAbstractItemModel_moved(); - - void enforceRange(); - void spacing(); - void sections(); - -private: - template void items(); - template void changed(); - template void inserted(); - template void removed(); - template void moved(); - QmlView *createView(const QString &filename); - template - T *findItem(QmlGraphicsItem *parent, const QString &id, int index=-1); - template - QList findItems(QmlGraphicsItem *parent, const QString &objectName); -}; - -class TestModel : public QListModelInterface -{ - Q_OBJECT -public: - TestModel(QObject *parent = 0) : QListModelInterface(parent) {} - ~TestModel() {} - - enum Roles { Name, Number }; - - QString name(int index) const { return list.at(index).first; } - QString number(int index) const { return list.at(index).second; } - - int count() const { return list.count(); } - - QList roles() const { return QList() << Name << Number; } - QString toString(int role) const { - switch(role) { - case Name: - return "name"; - case Number: - return "number"; - default: - return ""; - } - } - - QHash data(int index, const QList &roles) const { - QHash returnHash; - - for (int i = 0; i < roles.size(); ++i) { - int role = roles.at(i); - QVariant info; - switch(role) { - case Name: - info = list.at(index).first; - break; - case Number: - info = list.at(index).second; - break; - default: - break; - } - returnHash.insert(role, info); - } - return returnHash; - } - - void addItem(const QString &name, const QString &number) { - list.append(QPair(name, number)); - emit itemsInserted(list.count()-1, 1); - } - - void insertItem(int index, const QString &name, const QString &number) { - list.insert(index, QPair(name, number)); - emit itemsInserted(index, 1); - } - - void removeItem(int index) { - list.removeAt(index); - emit itemsRemoved(index, 1); - } - - void moveItem(int from, int to) { - list.move(from, to); - emit itemsMoved(from, to, 1); - } - - void modifyItem(int index, const QString &name, const QString &number) { - list[index] = QPair(name, number); - emit itemsChanged(index, 1, roles()); - } - -private: - QList > list; -}; - - -class TestModel2 : public QAbstractListModel -{ -public: - enum Roles { Name = Qt::UserRole+1, Number = Qt::UserRole+2 }; - - TestModel2(QObject *parent=0) : QAbstractListModel(parent) { - QHash roles; - roles[Name] = "name"; - roles[Number] = "number"; - setRoleNames(roles); - } - - int rowCount(const QModelIndex &parent=QModelIndex()) const { return list.count(); } - QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const { - QVariant rv; - if (role == Name) - rv = list.at(index.row()).first; - else if (role == Number) - rv = list.at(index.row()).second; - - return rv; - } - - int count() const { return rowCount(); } - QString name(int index) const { return list.at(index).first; } - QString number(int index) const { return list.at(index).second; } - - void addItem(const QString &name, const QString &number) { - emit beginInsertRows(QModelIndex(), list.count(), list.count()); - list.append(QPair(name, number)); - emit endInsertRows(); - } - - void insertItem(int index, const QString &name, const QString &number) { - emit beginInsertRows(QModelIndex(), index, index); - list.insert(index, QPair(name, number)); - emit endInsertRows(); - } - - void removeItem(int index) { - emit beginRemoveRows(QModelIndex(), index, index); - list.removeAt(index); - emit endRemoveRows(); - } - - void moveItem(int from, int to) { - emit beginMoveRows(QModelIndex(), from, from, QModelIndex(), to); - list.move(from, to); - emit endMoveRows(); - } - - void modifyItem(int idx, const QString &name, const QString &number) { - list[idx] = QPair(name, number); - emit dataChanged(index(idx,0), index(idx,0)); - } - -private: - QList > list; -}; - -tst_QmlGraphicsListView::tst_QmlGraphicsListView() -{ -} - -template -void tst_QmlGraphicsListView::items() -{ - QmlView *canvas = createView(SRCDIR "/data/listview.qml"); - - T model; - model.addItem("Fred", "12345"); - model.addItem("John", "2345"); - model.addItem("Bob", "54321"); - - QmlContext *ctxt = canvas->rootContext(); - ctxt->setContextProperty("testModel", &model); - - canvas->execute(); - qApp->processEvents(); - - QmlGraphicsListView *listview = findItem(canvas->root(), "list"); - QVERIFY(listview != 0); - - QmlGraphicsItem *viewport = listview->viewport(); - QVERIFY(viewport != 0); - - QCOMPARE(listview->count(), model.count()); - QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item - - for (int i = 0; i < model.count(); ++i) { - QmlGraphicsText *name = findItem(viewport, "textName", i); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(i)); - QmlGraphicsText *number = findItem(viewport, "textNumber", i); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(i)); - } - - listview->incrementCurrentIndex(); - QCOMPARE(listview->currentIndex(), 1); - listview->decrementCurrentIndex(); - QCOMPARE(listview->currentIndex(), 0); - - // set an empty model and confirm that items are destroyed - T model2; - ctxt->setContextProperty("testModel", &model2); - - int itemCount = findItems(viewport, "wrapper").count(); - QVERIFY(itemCount == 0); - - delete canvas; -} - -template -void tst_QmlGraphicsListView::changed() -{ - QmlView *canvas = createView(SRCDIR "/data/listview.qml"); - - T model; - model.addItem("Fred", "12345"); - model.addItem("John", "2345"); - model.addItem("Bob", "54321"); - - QmlContext *ctxt = canvas->rootContext(); - ctxt->setContextProperty("testModel", &model); - - canvas->execute(); - qApp->processEvents(); - - QmlGraphicsFlickable *listview = findItem(canvas->root(), "list"); - QVERIFY(listview != 0); - - QmlGraphicsItem *viewport = listview->viewport(); - QVERIFY(viewport != 0); - - model.modifyItem(1, "Will", "9876"); - QmlGraphicsText *name = findItem(viewport, "textName", 1); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(1)); - QmlGraphicsText *number = findItem(viewport, "textNumber", 1); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(1)); - - delete canvas; -} - -template -void tst_QmlGraphicsListView::inserted() -{ - QmlView *canvas = createView(SRCDIR "/data/listview.qml"); - - T model; - model.addItem("Fred", "12345"); - model.addItem("John", "2345"); - model.addItem("Bob", "54321"); - - QmlContext *ctxt = canvas->rootContext(); - ctxt->setContextProperty("testModel", &model); - - canvas->execute(); - qApp->processEvents(); - - QmlGraphicsListView *listview = findItem(canvas->root(), "list"); - QVERIFY(listview != 0); - - QmlGraphicsItem *viewport = listview->viewport(); - QVERIFY(viewport != 0); - - model.insertItem(1, "Will", "9876"); - - // let transitions settle. - QTest::qWait(1000); - - QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item - - QmlGraphicsText *name = findItem(viewport, "textName", 1); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(1)); - QmlGraphicsText *number = findItem(viewport, "textNumber", 1); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(1)); - - // Confirm items positioned correctly - for (int i = 0; i < model.count(); ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - QVERIFY(item->y() == i*20); - } - - model.insertItem(0, "Foo", "1111"); // zero index, and current item - - // let transitions settle. - QTest::qWait(1000); - - QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item - - name = findItem(viewport, "textName", 0); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(0)); - number = findItem(viewport, "textNumber", 0); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(0)); - - QCOMPARE(listview->currentIndex(), 1); - - // Confirm items positioned correctly - for (int i = 0; i < model.count(); ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - QVERIFY(item->y() == i*20); - } - - for (int i = model.count(); i < 30; ++i) - model.insertItem(i, "Hello", QString::number(i)); - QTest::qWait(1000); - - listview->setViewportY(80); - QTest::qWait(1000); - - // Insert item outside visible area - model.insertItem(1, "Hello", "1324"); - QTest::qWait(1000); - - QVERIFY(listview->viewportY() == 80); - - // Confirm items positioned correctly - int itemCount = findItems(viewport, "wrapper").count() - 1; - for (int i = 5; i < 5+itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - QVERIFY(item->y() == i*20 - 20); - } - - delete canvas; -} - -template -void tst_QmlGraphicsListView::removed() -{ - QmlView *canvas = createView(SRCDIR "/data/listview.qml"); - - T model; - for (int i = 0; i < 30; i++) - model.addItem("Item" + QString::number(i), ""); - - QmlContext *ctxt = canvas->rootContext(); - ctxt->setContextProperty("testModel", &model); - - canvas->execute(); - qApp->processEvents(); - - QmlGraphicsListView *listview = findItem(canvas->root(), "list"); - QVERIFY(listview != 0); - - QmlGraphicsItem *viewport = listview->viewport(); - QVERIFY(viewport != 0); - - model.removeItem(1); - - // let transitions settle. - QTest::qWait(1000); - - QmlGraphicsText *name = findItem(viewport, "textName", 1); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(1)); - QmlGraphicsText *number = findItem(viewport, "textNumber", 1); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(1)); - - // Confirm items positioned correctly - int itemCount = findItems(viewport, "wrapper").count(); - for (int i = 0; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QVERIFY(item->y() == i*20); - } - - // Remove first item (which is the current item); - model.removeItem(0); // post: top item starts at 20 - - // let transitions settle. - QTest::qWait(1000); - - name = findItem(viewport, "textName", 0); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(0)); - number = findItem(viewport, "textNumber", 0); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(0)); - - // Confirm items positioned correctly - itemCount = findItems(viewport, "wrapper").count(); - for (int i = 0; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QCOMPARE(item->y(),i*20.0 + 20.0); - } - - // Remove items not visible - model.removeItem(18); - // let transitions settle. - QTest::qWait(1000); - - // Confirm items positioned correctly - itemCount = findItems(viewport, "wrapper").count(); - for (int i = 0; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QCOMPARE(item->y(),i*20.0+20.0); - } - - // Remove items before visible - listview->setViewportY(80); - listview->setCurrentIndex(10); - - model.removeItem(1); // post: top item will be at 40 - // let transitions settle. - QTest::qWait(1000); - - // Confirm items positioned correctly - for (int i = 2; i < 18; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QCOMPARE(item->y(),40+i*20.0); - } - - listview->setViewportY(40); // That's the top now - // let transitions settle. - QTest::qWait(1000); - - // Confirm items positioned correctly - itemCount = findItems(viewport, "wrapper").count(); - for (int i = 0; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QCOMPARE(item->y(),40+i*20.0); - } - - delete canvas; -} - -template -void tst_QmlGraphicsListView::moved() -{ - QmlView *canvas = createView(SRCDIR "/data/listview.qml"); - - T model; - for (int i = 0; i < 30; i++) - model.addItem("Item" + QString::number(i), ""); - - QmlContext *ctxt = canvas->rootContext(); - ctxt->setContextProperty("testModel", &model); - - canvas->execute(); - qApp->processEvents(); - - QmlGraphicsListView *listview = findItem(canvas->root(), "list"); - QVERIFY(listview != 0); - - QmlGraphicsItem *viewport = listview->viewport(); - QVERIFY(viewport != 0); - - model.moveItem(1, 4); - - // let transitions settle. - QTest::qWait(1000); - - QmlGraphicsText *name = findItem(viewport, "textName", 1); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(1)); - QmlGraphicsText *number = findItem(viewport, "textNumber", 1); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(1)); - - name = findItem(viewport, "textName", 4); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(4)); - number = findItem(viewport, "textNumber", 4); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(4)); - - // Confirm items positioned correctly - int itemCount = findItems(viewport, "wrapper").count(); - for (int i = 0; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QVERIFY(item->y() == i*20); - } - - listview->setViewportY(80); - - // move outside visible area - model.moveItem(1, 18); - - // let transitions settle. - QTest::qWait(1000); - - // Confirm items positioned correctly and indexes correct - for (int i = 3; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QVERIFY(item->y() == i*20 + 20); - name = findItem(viewport, "textName", i); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(i)); - number = findItem(viewport, "textNumber", i); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(i)); - } - - // move from outside visible into visible - model.moveItem(20, 4); - - // let transitions settle. - QTest::qWait(1000); - - // Confirm items positioned correctly and indexes correct - for (int i = 3; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QVERIFY(item->y() == i*20 + 20); - name = findItem(viewport, "textName", i); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(i)); - number = findItem(viewport, "textNumber", i); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(i)); - } - - delete canvas; -} - -void tst_QmlGraphicsListView::enforceRange() -{ - QmlView *canvas = createView(SRCDIR "/data/listview-enforcerange.qml"); - - TestModel model; - for (int i = 0; i < 30; i++) - model.addItem("Item" + QString::number(i), ""); - - QmlContext *ctxt = canvas->rootContext(); - ctxt->setContextProperty("testModel", &model); - - canvas->execute(); - qApp->processEvents(); - - QmlGraphicsListView *listview = findItem(canvas->root(), "list"); - QVERIFY(listview != 0); - - QmlGraphicsItem *viewport = listview->viewport(); - QVERIFY(viewport != 0); - - // view should be positioned at the top of the range. - QmlGraphicsItem *item = findItem(viewport, "wrapper", 0); - QVERIFY(item); - QCOMPARE(listview->viewportY(), -100.0); - - QmlGraphicsText *name = findItem(viewport, "textName", 0); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(0)); - QmlGraphicsText *number = findItem(viewport, "textNumber", 0); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(0)); - - // Check currentIndex is updated when viewport moves - listview->setViewportY(20); - QTest::qWait(1000); - - QCOMPARE(listview->currentIndex(), 6); - - delete canvas; -} - -void tst_QmlGraphicsListView::spacing() -{ - QmlView *canvas = createView(SRCDIR "/data/listview.qml"); - - TestModel model; - for (int i = 0; i < 30; i++) - model.addItem("Item" + QString::number(i), ""); - - QmlContext *ctxt = canvas->rootContext(); - ctxt->setContextProperty("testModel", &model); - - canvas->execute(); - qApp->processEvents(); - - QmlGraphicsListView *listview = findItem(canvas->root(), "list"); - QVERIFY(listview != 0); - - QmlGraphicsItem *viewport = listview->viewport(); - QVERIFY(viewport != 0); - - // Confirm items positioned correctly - int itemCount = findItems(viewport, "wrapper").count(); - for (int i = 0; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QVERIFY(item->y() == i*20); - } - - listview->setSpacing(10); - QVERIFY(listview->spacing() == 10); - - // Confirm items positioned correctly - itemCount = findItems(viewport, "wrapper").count(); - for (int i = 0; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QVERIFY(item->y() == i*30); - } - - listview->setSpacing(0); - - // Confirm items positioned correctly - itemCount = findItems(viewport, "wrapper").count(); - for (int i = 0; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QVERIFY(item->y() == i*20); - } - - delete canvas; -} - -void tst_QmlGraphicsListView::sections() -{ - QmlView *canvas = createView(SRCDIR "/data/listview-sections.qml"); - - TestModel model; - for (int i = 0; i < 30; i++) - model.addItem("Item" + QString::number(i), ""); - - QmlContext *ctxt = canvas->rootContext(); - ctxt->setContextProperty("testModel", &model); - - canvas->execute(); - qApp->processEvents(); - - QmlGraphicsListView *listview = findItem(canvas->root(), "list"); - QVERIFY(listview != 0); - - QmlGraphicsItem *viewport = listview->viewport(); - QVERIFY(viewport != 0); - - // Confirm items positioned correctly - int itemCount = findItems(viewport, "wrapper").count(); - for (int i = 0; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - QVERIFY(item); - QCOMPARE(item->y(), qreal(i*20 + ((i+4)/5) * 20)); - } - - QVERIFY(listview->currentSection() == "0"); - - listview->setViewportY(140); - QVERIFY(listview->currentSection() == "1"); - - delete canvas; -} - -void tst_QmlGraphicsListView::qListModelInterface_items() -{ - items(); -} - -void tst_QmlGraphicsListView::qAbstractItemModel_items() -{ - items(); -} - -void tst_QmlGraphicsListView::qListModelInterface_changed() -{ - changed(); -} - -void tst_QmlGraphicsListView::qAbstractItemModel_changed() -{ - changed(); -} - -void tst_QmlGraphicsListView::qListModelInterface_inserted() -{ - inserted(); -} - -void tst_QmlGraphicsListView::qAbstractItemModel_inserted() -{ - inserted(); -} - -void tst_QmlGraphicsListView::qListModelInterface_removed() -{ - removed(); -} - -void tst_QmlGraphicsListView::qAbstractItemModel_removed() -{ - removed(); -} - -void tst_QmlGraphicsListView::qListModelInterface_moved() -{ - moved(); -} - -void tst_QmlGraphicsListView::qAbstractItemModel_moved() -{ - moved(); -} - - -QmlView *tst_QmlGraphicsListView::createView(const QString &filename) -{ - QmlView *canvas = new QmlView(0); - canvas->setFixedSize(240,320); - - QFile file(filename); - file.open(QFile::ReadOnly); - QString qml = file.readAll(); - canvas->setQml(qml, filename); - - return canvas; -} - -/* - Find an item with the specified objectName. If index is supplied then the - item must also evaluate the {index} expression equal to index -*/ -template -T *tst_QmlGraphicsListView::findItem(QmlGraphicsItem *parent, const QString &objectName, int index) -{ - const QMetaObject &mo = T::staticMetaObject; - //qDebug() << parent->QGraphicsObject::children().count() << "children"; - for (int i = 0; i < parent->QGraphicsObject::children().count(); ++i) { - QmlGraphicsItem *item = qobject_cast(parent->QGraphicsObject::children().at(i)); - if(!item) - continue; - //qDebug() << "try" << item; - if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { - if (index != -1) { - QmlExpression e(qmlContext(item), "index", item); - e.setTrackChange(false); - if (e.value().toInt() == index) - return static_cast(item); - } else { - return static_cast(item); - } - } - item = findItem(item, objectName, index); - if (item) - return static_cast(item); - } - - return 0; -} - -template -QList tst_QmlGraphicsListView::findItems(QmlGraphicsItem *parent, const QString &objectName) -{ - QList items; - const QMetaObject &mo = T::staticMetaObject; - //qDebug() << parent->QGraphicsObject::children().count() << "children"; - for (int i = 0; i < parent->QGraphicsObject::children().count(); ++i) { - QmlGraphicsItem *item = qobject_cast(parent->QGraphicsObject::children().at(i)); - if(!item) - continue; - //qDebug() << "try" << item; - if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) - items.append(static_cast(item)); - items += findItems(item, objectName); - } - - return items; -} - - -QTEST_MAIN(tst_QmlGraphicsListView) - -#include "tst_listview.moc" diff --git a/tests/auto/declarative/qmlgraphicslistview/data/listview-enforcerange.qml b/tests/auto/declarative/qmlgraphicslistview/data/listview-enforcerange.qml new file mode 100644 index 0000000..46fddae --- /dev/null +++ b/tests/auto/declarative/qmlgraphicslistview/data/listview-enforcerange.qml @@ -0,0 +1,55 @@ +import Qt 4.6 + +Rectangle { + width: 240 + height: 320 + color: "#ffffff" + Component { + id: myDelegate + Item { + id: wrapper + objectName: "wrapper" + height: 20 + width: 240 + Text { + text: index + } + Text { + x: 30 + id: textName + objectName: "textName" + text: name + } + Text { + x: 120 + id: textNumber + objectName: "textNumber" + text: number + } + Text { + x: 200 + text: wrapper.y + } + } + } + + Component { + id: myHighlight + Rectangle { + color: "lightsteelblue" + } + } + + ListView { + id: list + objectName: "list" + width: 240 + height: 320 + model: testModel + delegate: myDelegate + highlight: myHighlight + preferredHighlightBegin: 100 + preferredHighlightEnd: 100 + highlightRangeMode: "StrictlyEnforceRange" + } +} diff --git a/tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml b/tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml new file mode 100644 index 0000000..56700be --- /dev/null +++ b/tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml @@ -0,0 +1,59 @@ +import Qt 4.6 + +Rectangle { + width: 240 + height: 320 + color: "#ffffff" + resources: [ + Component { + id: myDelegate + Item { + id: wrapper + objectName: "wrapper" + height: ListView.prevSection != ListView.section ? 40 : 20; + width: 240 + Rectangle { + y: wrapper.ListView.prevSection != wrapper.ListView.section ? 20 : 0 + height: 20 + width: parent.width + color: wrapper.ListView.isCurrentItem ? "lightsteelblue" : "white" + Text { + text: index + } + Text { + x: 30 + id: textName + objectName: "textName" + text: name + } + Text { + x: 120 + id: textNumber + objectName: "textNumber" + text: number + } + Text { + x: 200 + text: wrapper.y + } + } + Rectangle { + color: "#99bb99" + height: wrapper.ListView.prevSection != wrapper.ListView.section ? 20 : 0 + width: parent.width + visible: wrapper.ListView.prevSection != wrapper.ListView.section ? true : false + Text { text: wrapper.ListView.section } + } + } + } + ] + ListView { + id: list + objectName: "list" + width: 240 + height: 320 + model: testModel + delegate: myDelegate + sectionExpression: "Math.floor(index/5)" + } +} diff --git a/tests/auto/declarative/qmlgraphicslistview/data/listview.qml b/tests/auto/declarative/qmlgraphicslistview/data/listview.qml new file mode 100644 index 0000000..b7b838b --- /dev/null +++ b/tests/auto/declarative/qmlgraphicslistview/data/listview.qml @@ -0,0 +1,46 @@ +import Qt 4.6 + +Rectangle { + width: 240 + height: 320 + color: "#ffffff" + resources: [ + Component { + id: myDelegate + Rectangle { + id: wrapper + objectName: "wrapper" + height: 20 + width: 240 + Text { + text: index + } + Text { + x: 30 + id: textName + objectName: "textName" + text: name + } + Text { + x: 120 + id: textNumber + objectName: "textNumber" + text: number + } + Text { + x: 200 + text: wrapper.y + } + color: ListView.isCurrentItem ? "lightsteelblue" : "white" + } + } + ] + ListView { + id: list + objectName: "list" + width: 240 + height: 320 + model: testModel + delegate: myDelegate + } +} diff --git a/tests/auto/declarative/qmlgraphicslistview/qmlgraphicslistview.pro b/tests/auto/declarative/qmlgraphicslistview/qmlgraphicslistview.pro new file mode 100644 index 0000000..f00de39 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicslistview/qmlgraphicslistview.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + +SOURCES += tst_qmlgraphicslistview.cpp + +# Define SRCDIR equal to test's source directory +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp new file mode 100644 index 0000000..5575ace --- /dev/null +++ b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp @@ -0,0 +1,853 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include + +class tst_QmlGraphicsListView : public QObject +{ + Q_OBJECT +public: + tst_QmlGraphicsListView(); + +private slots: + // Test both QListModelInterface and QAbstractItemModel model types + void qListModelInterface_items(); + void qAbstractItemModel_items(); + + void qListModelInterface_changed(); + void qAbstractItemModel_changed(); + + void qListModelInterface_inserted(); + void qAbstractItemModel_inserted(); + + void qListModelInterface_removed(); + void qAbstractItemModel_removed(); + + void qListModelInterface_moved(); + void qAbstractItemModel_moved(); + + void enforceRange(); + void spacing(); + void sections(); + +private: + template void items(); + template void changed(); + template void inserted(); + template void removed(); + template void moved(); + QmlView *createView(const QString &filename); + template + T *findItem(QmlGraphicsItem *parent, const QString &id, int index=-1); + template + QList findItems(QmlGraphicsItem *parent, const QString &objectName); +}; + +class TestModel : public QListModelInterface +{ + Q_OBJECT +public: + TestModel(QObject *parent = 0) : QListModelInterface(parent) {} + ~TestModel() {} + + enum Roles { Name, Number }; + + QString name(int index) const { return list.at(index).first; } + QString number(int index) const { return list.at(index).second; } + + int count() const { return list.count(); } + + QList roles() const { return QList() << Name << Number; } + QString toString(int role) const { + switch(role) { + case Name: + return "name"; + case Number: + return "number"; + default: + return ""; + } + } + + QHash data(int index, const QList &roles) const { + QHash returnHash; + + for (int i = 0; i < roles.size(); ++i) { + int role = roles.at(i); + QVariant info; + switch(role) { + case Name: + info = list.at(index).first; + break; + case Number: + info = list.at(index).second; + break; + default: + break; + } + returnHash.insert(role, info); + } + return returnHash; + } + + void addItem(const QString &name, const QString &number) { + list.append(QPair(name, number)); + emit itemsInserted(list.count()-1, 1); + } + + void insertItem(int index, const QString &name, const QString &number) { + list.insert(index, QPair(name, number)); + emit itemsInserted(index, 1); + } + + void removeItem(int index) { + list.removeAt(index); + emit itemsRemoved(index, 1); + } + + void moveItem(int from, int to) { + list.move(from, to); + emit itemsMoved(from, to, 1); + } + + void modifyItem(int index, const QString &name, const QString &number) { + list[index] = QPair(name, number); + emit itemsChanged(index, 1, roles()); + } + +private: + QList > list; +}; + + +class TestModel2 : public QAbstractListModel +{ +public: + enum Roles { Name = Qt::UserRole+1, Number = Qt::UserRole+2 }; + + TestModel2(QObject *parent=0) : QAbstractListModel(parent) { + QHash roles; + roles[Name] = "name"; + roles[Number] = "number"; + setRoleNames(roles); + } + + int rowCount(const QModelIndex &parent=QModelIndex()) const { return list.count(); } + QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const { + QVariant rv; + if (role == Name) + rv = list.at(index.row()).first; + else if (role == Number) + rv = list.at(index.row()).second; + + return rv; + } + + int count() const { return rowCount(); } + QString name(int index) const { return list.at(index).first; } + QString number(int index) const { return list.at(index).second; } + + void addItem(const QString &name, const QString &number) { + emit beginInsertRows(QModelIndex(), list.count(), list.count()); + list.append(QPair(name, number)); + emit endInsertRows(); + } + + void insertItem(int index, const QString &name, const QString &number) { + emit beginInsertRows(QModelIndex(), index, index); + list.insert(index, QPair(name, number)); + emit endInsertRows(); + } + + void removeItem(int index) { + emit beginRemoveRows(QModelIndex(), index, index); + list.removeAt(index); + emit endRemoveRows(); + } + + void moveItem(int from, int to) { + emit beginMoveRows(QModelIndex(), from, from, QModelIndex(), to); + list.move(from, to); + emit endMoveRows(); + } + + void modifyItem(int idx, const QString &name, const QString &number) { + list[idx] = QPair(name, number); + emit dataChanged(index(idx,0), index(idx,0)); + } + +private: + QList > list; +}; + +tst_QmlGraphicsListView::tst_QmlGraphicsListView() +{ +} + +template +void tst_QmlGraphicsListView::items() +{ + QmlView *canvas = createView(SRCDIR "/data/listview.qml"); + + T model; + model.addItem("Fred", "12345"); + model.addItem("John", "2345"); + model.addItem("Bob", "54321"); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsListView *listview = findItem(canvas->root(), "list"); + QVERIFY(listview != 0); + + QmlGraphicsItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + QCOMPARE(listview->count(), model.count()); + QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item + + for (int i = 0; i < model.count(); ++i) { + QmlGraphicsText *name = findItem(viewport, "textName", i); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(i)); + QmlGraphicsText *number = findItem(viewport, "textNumber", i); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(i)); + } + + listview->incrementCurrentIndex(); + QCOMPARE(listview->currentIndex(), 1); + listview->decrementCurrentIndex(); + QCOMPARE(listview->currentIndex(), 0); + + // set an empty model and confirm that items are destroyed + T model2; + ctxt->setContextProperty("testModel", &model2); + + int itemCount = findItems(viewport, "wrapper").count(); + QVERIFY(itemCount == 0); + + delete canvas; +} + +template +void tst_QmlGraphicsListView::changed() +{ + QmlView *canvas = createView(SRCDIR "/data/listview.qml"); + + T model; + model.addItem("Fred", "12345"); + model.addItem("John", "2345"); + model.addItem("Bob", "54321"); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsFlickable *listview = findItem(canvas->root(), "list"); + QVERIFY(listview != 0); + + QmlGraphicsItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + model.modifyItem(1, "Will", "9876"); + QmlGraphicsText *name = findItem(viewport, "textName", 1); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(1)); + QmlGraphicsText *number = findItem(viewport, "textNumber", 1); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(1)); + + delete canvas; +} + +template +void tst_QmlGraphicsListView::inserted() +{ + QmlView *canvas = createView(SRCDIR "/data/listview.qml"); + + T model; + model.addItem("Fred", "12345"); + model.addItem("John", "2345"); + model.addItem("Bob", "54321"); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsListView *listview = findItem(canvas->root(), "list"); + QVERIFY(listview != 0); + + QmlGraphicsItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + model.insertItem(1, "Will", "9876"); + + // let transitions settle. + QTest::qWait(1000); + + QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item + + QmlGraphicsText *name = findItem(viewport, "textName", 1); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(1)); + QmlGraphicsText *number = findItem(viewport, "textNumber", 1); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(1)); + + // Confirm items positioned correctly + for (int i = 0; i < model.count(); ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + QVERIFY(item->y() == i*20); + } + + model.insertItem(0, "Foo", "1111"); // zero index, and current item + + // let transitions settle. + QTest::qWait(1000); + + QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item + + name = findItem(viewport, "textName", 0); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(0)); + number = findItem(viewport, "textNumber", 0); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(0)); + + QCOMPARE(listview->currentIndex(), 1); + + // Confirm items positioned correctly + for (int i = 0; i < model.count(); ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + QVERIFY(item->y() == i*20); + } + + for (int i = model.count(); i < 30; ++i) + model.insertItem(i, "Hello", QString::number(i)); + QTest::qWait(1000); + + listview->setViewportY(80); + QTest::qWait(1000); + + // Insert item outside visible area + model.insertItem(1, "Hello", "1324"); + QTest::qWait(1000); + + QVERIFY(listview->viewportY() == 80); + + // Confirm items positioned correctly + int itemCount = findItems(viewport, "wrapper").count() - 1; + for (int i = 5; i < 5+itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + QVERIFY(item->y() == i*20 - 20); + } + + delete canvas; +} + +template +void tst_QmlGraphicsListView::removed() +{ + QmlView *canvas = createView(SRCDIR "/data/listview.qml"); + + T model; + for (int i = 0; i < 30; i++) + model.addItem("Item" + QString::number(i), ""); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsListView *listview = findItem(canvas->root(), "list"); + QVERIFY(listview != 0); + + QmlGraphicsItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + model.removeItem(1); + + // let transitions settle. + QTest::qWait(1000); + + QmlGraphicsText *name = findItem(viewport, "textName", 1); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(1)); + QmlGraphicsText *number = findItem(viewport, "textNumber", 1); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(1)); + + // Confirm items positioned correctly + int itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->y() == i*20); + } + + // Remove first item (which is the current item); + model.removeItem(0); // post: top item starts at 20 + + // let transitions settle. + QTest::qWait(1000); + + name = findItem(viewport, "textName", 0); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(0)); + number = findItem(viewport, "textNumber", 0); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(0)); + + // Confirm items positioned correctly + itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QCOMPARE(item->y(),i*20.0 + 20.0); + } + + // Remove items not visible + model.removeItem(18); + // let transitions settle. + QTest::qWait(1000); + + // Confirm items positioned correctly + itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QCOMPARE(item->y(),i*20.0+20.0); + } + + // Remove items before visible + listview->setViewportY(80); + listview->setCurrentIndex(10); + + model.removeItem(1); // post: top item will be at 40 + // let transitions settle. + QTest::qWait(1000); + + // Confirm items positioned correctly + for (int i = 2; i < 18; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QCOMPARE(item->y(),40+i*20.0); + } + + listview->setViewportY(40); // That's the top now + // let transitions settle. + QTest::qWait(1000); + + // Confirm items positioned correctly + itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QCOMPARE(item->y(),40+i*20.0); + } + + delete canvas; +} + +template +void tst_QmlGraphicsListView::moved() +{ + QmlView *canvas = createView(SRCDIR "/data/listview.qml"); + + T model; + for (int i = 0; i < 30; i++) + model.addItem("Item" + QString::number(i), ""); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsListView *listview = findItem(canvas->root(), "list"); + QVERIFY(listview != 0); + + QmlGraphicsItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + model.moveItem(1, 4); + + // let transitions settle. + QTest::qWait(1000); + + QmlGraphicsText *name = findItem(viewport, "textName", 1); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(1)); + QmlGraphicsText *number = findItem(viewport, "textNumber", 1); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(1)); + + name = findItem(viewport, "textName", 4); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(4)); + number = findItem(viewport, "textNumber", 4); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(4)); + + // Confirm items positioned correctly + int itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->y() == i*20); + } + + listview->setViewportY(80); + + // move outside visible area + model.moveItem(1, 18); + + // let transitions settle. + QTest::qWait(1000); + + // Confirm items positioned correctly and indexes correct + for (int i = 3; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->y() == i*20 + 20); + name = findItem(viewport, "textName", i); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(i)); + number = findItem(viewport, "textNumber", i); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(i)); + } + + // move from outside visible into visible + model.moveItem(20, 4); + + // let transitions settle. + QTest::qWait(1000); + + // Confirm items positioned correctly and indexes correct + for (int i = 3; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->y() == i*20 + 20); + name = findItem(viewport, "textName", i); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(i)); + number = findItem(viewport, "textNumber", i); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(i)); + } + + delete canvas; +} + +void tst_QmlGraphicsListView::enforceRange() +{ + QmlView *canvas = createView(SRCDIR "/data/listview-enforcerange.qml"); + + TestModel model; + for (int i = 0; i < 30; i++) + model.addItem("Item" + QString::number(i), ""); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsListView *listview = findItem(canvas->root(), "list"); + QVERIFY(listview != 0); + + QmlGraphicsItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + // view should be positioned at the top of the range. + QmlGraphicsItem *item = findItem(viewport, "wrapper", 0); + QVERIFY(item); + QCOMPARE(listview->viewportY(), -100.0); + + QmlGraphicsText *name = findItem(viewport, "textName", 0); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(0)); + QmlGraphicsText *number = findItem(viewport, "textNumber", 0); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(0)); + + // Check currentIndex is updated when viewport moves + listview->setViewportY(20); + QTest::qWait(1000); + + QCOMPARE(listview->currentIndex(), 6); + + delete canvas; +} + +void tst_QmlGraphicsListView::spacing() +{ + QmlView *canvas = createView(SRCDIR "/data/listview.qml"); + + TestModel model; + for (int i = 0; i < 30; i++) + model.addItem("Item" + QString::number(i), ""); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsListView *listview = findItem(canvas->root(), "list"); + QVERIFY(listview != 0); + + QmlGraphicsItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + // Confirm items positioned correctly + int itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->y() == i*20); + } + + listview->setSpacing(10); + QVERIFY(listview->spacing() == 10); + + // Confirm items positioned correctly + itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->y() == i*30); + } + + listview->setSpacing(0); + + // Confirm items positioned correctly + itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->y() == i*20); + } + + delete canvas; +} + +void tst_QmlGraphicsListView::sections() +{ + QmlView *canvas = createView(SRCDIR "/data/listview-sections.qml"); + + TestModel model; + for (int i = 0; i < 30; i++) + model.addItem("Item" + QString::number(i), ""); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsListView *listview = findItem(canvas->root(), "list"); + QVERIFY(listview != 0); + + QmlGraphicsItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + // Confirm items positioned correctly + int itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + QVERIFY(item); + QCOMPARE(item->y(), qreal(i*20 + ((i+4)/5) * 20)); + } + + QVERIFY(listview->currentSection() == "0"); + + listview->setViewportY(140); + QVERIFY(listview->currentSection() == "1"); + + delete canvas; +} + +void tst_QmlGraphicsListView::qListModelInterface_items() +{ + items(); +} + +void tst_QmlGraphicsListView::qAbstractItemModel_items() +{ + items(); +} + +void tst_QmlGraphicsListView::qListModelInterface_changed() +{ + changed(); +} + +void tst_QmlGraphicsListView::qAbstractItemModel_changed() +{ + changed(); +} + +void tst_QmlGraphicsListView::qListModelInterface_inserted() +{ + inserted(); +} + +void tst_QmlGraphicsListView::qAbstractItemModel_inserted() +{ + inserted(); +} + +void tst_QmlGraphicsListView::qListModelInterface_removed() +{ + removed(); +} + +void tst_QmlGraphicsListView::qAbstractItemModel_removed() +{ + removed(); +} + +void tst_QmlGraphicsListView::qListModelInterface_moved() +{ + moved(); +} + +void tst_QmlGraphicsListView::qAbstractItemModel_moved() +{ + moved(); +} + + +QmlView *tst_QmlGraphicsListView::createView(const QString &filename) +{ + QmlView *canvas = new QmlView(0); + canvas->setFixedSize(240,320); + + QFile file(filename); + file.open(QFile::ReadOnly); + QString qml = file.readAll(); + canvas->setQml(qml, filename); + + return canvas; +} + +/* + Find an item with the specified objectName. If index is supplied then the + item must also evaluate the {index} expression equal to index +*/ +template +T *tst_QmlGraphicsListView::findItem(QmlGraphicsItem *parent, const QString &objectName, int index) +{ + const QMetaObject &mo = T::staticMetaObject; + //qDebug() << parent->QGraphicsObject::children().count() << "children"; + for (int i = 0; i < parent->QGraphicsObject::children().count(); ++i) { + QmlGraphicsItem *item = qobject_cast(parent->QGraphicsObject::children().at(i)); + if(!item) + continue; + //qDebug() << "try" << item; + if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { + if (index != -1) { + QmlExpression e(qmlContext(item), "index", item); + e.setTrackChange(false); + if (e.value().toInt() == index) + return static_cast(item); + } else { + return static_cast(item); + } + } + item = findItem(item, objectName, index); + if (item) + return static_cast(item); + } + + return 0; +} + +template +QList tst_QmlGraphicsListView::findItems(QmlGraphicsItem *parent, const QString &objectName) +{ + QList items; + const QMetaObject &mo = T::staticMetaObject; + //qDebug() << parent->QGraphicsObject::children().count() << "children"; + for (int i = 0; i < parent->QGraphicsObject::children().count(); ++i) { + QmlGraphicsItem *item = qobject_cast(parent->QGraphicsObject::children().at(i)); + if(!item) + continue; + //qDebug() << "try" << item; + if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) + items.append(static_cast(item)); + items += findItems(item, objectName); + } + + return items; +} + + +QTEST_MAIN(tst_QmlGraphicsListView) + +#include "tst_listview.moc" -- cgit v0.12 From 47f50491cafe76216f209d25d4a96643a05c1253 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 6 Nov 2009 14:09:22 +1000 Subject: More language tests --- src/declarative/qml/qmlcompiler.cpp | 13 +++++--- .../qmllanguage/data/assignBasicTypes.qml | 1 + .../qmllanguage/data/attachedProperties.qml | 3 ++ .../qmllanguage/data/fakeDotProperty.errors.txt | 2 +- .../data/invalidAttachedProperty.1.errors.txt | 1 + .../qmllanguage/data/invalidAttachedProperty.1.qml | 7 +++++ .../data/invalidAttachedProperty.10.errors.txt | 1 + .../data/invalidAttachedProperty.10.qml | 6 ++++ .../data/invalidAttachedProperty.11.errors.txt | 1 + .../data/invalidAttachedProperty.11.qml | 7 +++++ .../data/invalidAttachedProperty.2.errors.txt | 1 + .../qmllanguage/data/invalidAttachedProperty.2.qml | 6 ++++ .../data/invalidAttachedProperty.3.errors.txt | 1 + .../qmllanguage/data/invalidAttachedProperty.3.qml | 8 +++++ .../data/invalidAttachedProperty.4.errors.txt | 1 + .../qmllanguage/data/invalidAttachedProperty.4.qml | 7 +++++ .../data/invalidAttachedProperty.5.errors.txt | 1 + .../qmllanguage/data/invalidAttachedProperty.5.qml | 7 +++++ .../data/invalidAttachedProperty.6.errors.txt | 1 + .../qmllanguage/data/invalidAttachedProperty.6.qml | 7 +++++ .../data/invalidAttachedProperty.7.errors.txt | 1 + .../qmllanguage/data/invalidAttachedProperty.7.qml | 6 ++++ .../data/invalidAttachedProperty.8.errors.txt | 1 + .../qmllanguage/data/invalidAttachedProperty.8.qml | 6 ++++ .../data/invalidAttachedProperty.9.errors.txt | 1 + .../qmllanguage/data/invalidAttachedProperty.9.qml | 7 +++++ .../data/invalidGroupedProperty.1.errors.txt | 2 +- .../data/invalidGroupedProperty.2.errors.txt | 2 +- .../data/invalidGroupedProperty.3.errors.txt | 1 + .../qmllanguage/data/invalidGroupedProperty.3.qml | 5 +++ .../data/invalidGroupedProperty.4.errors.txt | 1 + .../qmllanguage/data/invalidGroupedProperty.4.qml | 5 +++ .../data/invalidGroupedProperty.5.errors.txt | 1 + .../qmllanguage/data/invalidGroupedProperty.5.qml | 5 +++ .../data/invalidGroupedProperty.6.errors.txt | 1 + .../qmllanguage/data/invalidGroupedProperty.6.qml | 6 ++++ .../data/invalidGroupedProperty.7.errors.txt | 1 + .../qmllanguage/data/invalidGroupedProperty.7.qml | 5 +++ .../data/missingValueTypeProperty.errors.txt | 1 + .../qmllanguage/data/missingValueTypeProperty.qml | 5 +++ .../data/objectValueTypeProperty.errors.txt | 1 + .../qmllanguage/data/objectValueTypeProperty.qml | 6 ++++ .../qmllanguage/data/wrongType.15.errors.txt | 1 + .../declarative/qmllanguage/data/wrongType.15.qml | 4 +++ tests/auto/declarative/qmllanguage/testtypes.h | 19 +++++++++++- .../declarative/qmllanguage/tst_qmllanguage.cpp | 36 +++++++++++++++++++++- 46 files changed, 202 insertions(+), 10 deletions(-) create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.qml create mode 100644 tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.qml create mode 100644 tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.qml create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.15.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.15.qml diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index 240f16c..8e92eb4 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -1714,7 +1714,7 @@ bool QmlCompiler::buildGroupedProperty(QmlParser::Property *prop, prop->value, obj, ctxt.incr())); obj->addValueTypeProperty(prop); } else { - COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Invalid property access")); + COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Invalid grouped property access")); } } else { @@ -1722,7 +1722,7 @@ bool QmlCompiler::buildGroupedProperty(QmlParser::Property *prop, prop->value->metatype = QmlEnginePrivate::get(engine)->metaObjectForType(prop->type); if (!prop->value->metatype) - COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Cannot nest non-QObject property \"%1\"").arg(QString::fromUtf8(prop->name))); + COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Invalid grouped property access")); obj->addGroupedProperty(prop); @@ -1749,8 +1749,11 @@ bool QmlCompiler::buildValueTypeProperty(QObject *type, prop->index = idx; prop->type = p.userType(); - if (prop->value || prop->values.count() != 1) - COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Invalid property use")); + if (prop->value) + COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Property assignment expected")); + + if (prop->values.count() != 1) + COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Single property assignment expected")); Value *value = prop->values.at(0); @@ -1758,7 +1761,7 @@ bool QmlCompiler::buildValueTypeProperty(QObject *type, bool isPropertyValue = output->types.at(value->object->type).type->propertyValueSourceCast() != -1; bool isPropertyInterceptor = output->types.at(value->object->type).type->propertyValueInterceptorCast() != -1; if (!isPropertyValue && !isPropertyInterceptor) { - COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Invalid property use")); + COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Unexpected object assignment")); } else { COMPILE_CHECK(buildObject(value->object, ctxt)); diff --git a/tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml b/tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml index 50723a3..c86c96b 100644 --- a/tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml +++ b/tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml @@ -23,6 +23,7 @@ MyTypeObject { boolProperty: true variantProperty: "Hello World!" vectorProperty: "10,1,2.2" + urlProperty: "main.qml" objectProperty: MyTypeObject { intProperty: 8 } } diff --git a/tests/auto/declarative/qmllanguage/data/attachedProperties.qml b/tests/auto/declarative/qmllanguage/data/attachedProperties.qml index 8343754..fec96cc 100644 --- a/tests/auto/declarative/qmllanguage/data/attachedProperties.qml +++ b/tests/auto/declarative/qmllanguage/data/attachedProperties.qml @@ -1,5 +1,8 @@ import Test 1.0 +import Test 1.0 as Namespace import Qt 4.6 + Object { MyQmlObject.value: 10 + Namespace.MyQmlObject.value2: 13 } diff --git a/tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt b/tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt index e56ad3a..3074823 100644 --- a/tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt @@ -1 +1 @@ -3:5:Invalid property access +3:5:Invalid grouped property access diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.errors.txt new file mode 100644 index 0000000..68fe671 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.errors.txt @@ -0,0 +1 @@ +5:17:Cannot assign to non-existant property "foo" diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.qml new file mode 100644 index 0000000..e99c635 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.qml @@ -0,0 +1,7 @@ +import Test 1.0 +import Qt 4.6 + +Object { + MyQmlObject.foo: 10 +} + diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.errors.txt new file mode 100644 index 0000000..7f630f4 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.errors.txt @@ -0,0 +1 @@ +5:15:Non-existant attached object diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.qml new file mode 100644 index 0000000..8f987ce --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.qml @@ -0,0 +1,6 @@ +import Test 1.0 as Namespace +import Qt 4.6 + +Object { + Namespace.MadeUpClass.foo: 10 +} diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.errors.txt new file mode 100644 index 0000000..fee5050 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.errors.txt @@ -0,0 +1 @@ +5:15:Not an attached property name diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.qml new file mode 100644 index 0000000..18770fc --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.qml @@ -0,0 +1,7 @@ +import Test 1.0 as Namespace +import Qt 4.6 + +Object { + Namespace.madeUpClass.foo: 10 +} + diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.errors.txt new file mode 100644 index 0000000..9f06e07 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.errors.txt @@ -0,0 +1 @@ +5:27:Cannot assign to non-existant property "foo" diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.qml new file mode 100644 index 0000000..3c9ae5b --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.qml @@ -0,0 +1,6 @@ +import Test 1.0 as Namespace +import Qt 4.6 + +Object { + Namespace.MyQmlObject.foo: 10 +} diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.errors.txt new file mode 100644 index 0000000..05161c4 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.errors.txt @@ -0,0 +1 @@ +5:5:Invalid attached object assignment diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.qml new file mode 100644 index 0000000..e9405a4 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.qml @@ -0,0 +1,8 @@ +import Test 1.0 +import Qt 4.6 + +Object { + MyQmlObject: 10 +} + + diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.errors.txt new file mode 100644 index 0000000..a208bcf --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.errors.txt @@ -0,0 +1 @@ +5:15:Invalid attached object assignment diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.qml new file mode 100644 index 0000000..6fbf718 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.qml @@ -0,0 +1,7 @@ +import Test 1.0 as Namespace +import Qt 4.6 + +Object { + Namespace.MyQmlObject: 10 +} + diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.errors.txt new file mode 100644 index 0000000..05161c4 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.errors.txt @@ -0,0 +1 @@ +5:5:Invalid attached object assignment diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.qml new file mode 100644 index 0000000..1827a16 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.qml @@ -0,0 +1,7 @@ +import Test 1.0 +import Qt 4.6 + +Object { + MyQmlObject: Object {} +} + diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.errors.txt new file mode 100644 index 0000000..e232b23 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.errors.txt @@ -0,0 +1 @@ +5:5:Non-existant attached object diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.qml new file mode 100644 index 0000000..5c7f0ec --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.qml @@ -0,0 +1,7 @@ +import Test 1.0 +import Qt 4.6 + +Object { + Test.MyQmlObject: Object {} +} + diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.errors.txt new file mode 100644 index 0000000..e232b23 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.errors.txt @@ -0,0 +1 @@ +5:5:Non-existant attached object diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.qml new file mode 100644 index 0000000..841cc08 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.qml @@ -0,0 +1,6 @@ +import Test 1.0 +import Qt 4.6 + +Object { + MyTypeObject.foo: 10 +} diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.errors.txt new file mode 100644 index 0000000..7f630f4 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.errors.txt @@ -0,0 +1 @@ +5:15:Non-existant attached object diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.qml new file mode 100644 index 0000000..f1b4b96 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.qml @@ -0,0 +1,6 @@ +import Test 1.0 as Namespace +import Qt 4.6 + +Object { + Namespace.MyTypeObject.foo: 10 +} diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.errors.txt new file mode 100644 index 0000000..e232b23 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.errors.txt @@ -0,0 +1 @@ +5:5:Non-existant attached object diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.qml new file mode 100644 index 0000000..99c4a5c --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.qml @@ -0,0 +1,7 @@ +import Test 1.0 +import Qt 4.6 + +Object { + MadeUpClass.foo: 10 +} + diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.1.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.1.errors.txt index 7c00ce4..810fd31 100644 --- a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.1.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.1.errors.txt @@ -1 +1 @@ -5:5:Invalid property access +5:5:Invalid grouped property access diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.2.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.2.errors.txt index 7c00ce4..810fd31 100644 --- a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.2.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.2.errors.txt @@ -1 +1 @@ -5:5:Invalid property access +5:5:Invalid grouped property access diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.errors.txt new file mode 100644 index 0000000..f6d6f29 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.errors.txt @@ -0,0 +1 @@ +4:5:Invalid grouped property access diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.qml b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.qml new file mode 100644 index 0000000..0bbfc4f --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.qml @@ -0,0 +1,5 @@ +import Test 1.0 + +MyQmlObject { + customType.x: 10 +} diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.errors.txt new file mode 100644 index 0000000..19934fa --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.errors.txt @@ -0,0 +1 @@ +4:5:Cannot assign to non-existant property "foo" diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.qml b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.qml new file mode 100644 index 0000000..134fef9 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.qml @@ -0,0 +1,5 @@ +import Test 1.0 + +MyQmlObject { + foo.x: 10 +} diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.errors.txt new file mode 100644 index 0000000..2c8a970 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.errors.txt @@ -0,0 +1 @@ +4:18:Property assignment expected diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.qml b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.qml new file mode 100644 index 0000000..55cefe6 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.qml @@ -0,0 +1,5 @@ +import Test 1.0 + +MyTypeObject { + rectProperty.x.foo: 100 +} diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.errors.txt new file mode 100644 index 0000000..8331725 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.errors.txt @@ -0,0 +1 @@ +5:18:Single property assignment expected diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.qml b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.qml new file mode 100644 index 0000000..9ec33ab --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.qml @@ -0,0 +1,6 @@ +import Test 1.0 + +MyTypeObject { + rectProperty.x: 100 + rectProperty.x: 101 +} diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.errors.txt new file mode 100644 index 0000000..4a7e383 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.errors.txt @@ -0,0 +1 @@ +4:-1:Cannot set properties on nullGrouped as it is null diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.qml b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.qml new file mode 100644 index 0000000..b77fb90 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.qml @@ -0,0 +1,5 @@ +import Test 1.0 + +MyTypeObject { + nullGrouped.script: print(1921) +} diff --git a/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.errors.txt b/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.errors.txt new file mode 100644 index 0000000..dfaa218 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.errors.txt @@ -0,0 +1 @@ +4:18:Cannot assign to non-existant property "foo" diff --git a/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.qml b/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.qml new file mode 100644 index 0000000..9a0fa6a --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.qml @@ -0,0 +1,5 @@ +import Test 1.0 + +MyTypeObject { + rectProperty.foo: 9 +} diff --git a/tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.errors.txt b/tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.errors.txt new file mode 100644 index 0000000..db7d9c0 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.errors.txt @@ -0,0 +1 @@ +4:18:Unexpected object assignment diff --git a/tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.qml b/tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.qml new file mode 100644 index 0000000..9924773 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.qml @@ -0,0 +1,6 @@ +import Test 1.0 + +MyTypeObject { + rectProperty.x: MyTypeObject {} +} + diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.15.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.15.errors.txt new file mode 100644 index 0000000..44768e3 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.15.errors.txt @@ -0,0 +1 @@ +3:18:Invalid property assignment: url expected diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.15.qml b/tests/auto/declarative/qmllanguage/data/wrongType.15.qml new file mode 100644 index 0000000..633a5ba --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.15.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyTypeObject { + urlProperty: 12 +} diff --git a/tests/auto/declarative/qmllanguage/testtypes.h b/tests/auto/declarative/qmllanguage/testtypes.h index e654faa..b251f87 100644 --- a/tests/auto/declarative/qmllanguage/testtypes.h +++ b/tests/auto/declarative/qmllanguage/testtypes.h @@ -80,14 +80,19 @@ class MyAttachedObject : public QObject { Q_OBJECT Q_PROPERTY(int value READ value WRITE setValue) + Q_PROPERTY(int value2 READ value2 WRITE setValue2) public: - MyAttachedObject(QObject *parent) : QObject(parent), m_value(0) {} + MyAttachedObject(QObject *parent) : QObject(parent), m_value(0), m_value2(0) {} int value() const { return m_value; } void setValue(int v) { m_value = v; } + int value2() const { return m_value2; } + void setValue2(int v) { m_value2 = v; } + private: int m_value; + int m_value2; }; class MyQmlObject : public QObject, public MyInterface, public QmlParserStatus @@ -201,9 +206,11 @@ class MyTypeObject : public QObject Q_PROPERTY(bool boolProperty READ boolProperty WRITE setBoolProperty); Q_PROPERTY(QVariant variantProperty READ variantProperty WRITE setVariantProperty); Q_PROPERTY(QVector3D vectorProperty READ vectorProperty WRITE setVectorProperty); + Q_PROPERTY(QUrl urlProperty READ urlProperty WRITE setUrlProperty); Q_PROPERTY(QmlScriptString scriptProperty READ scriptProperty WRITE setScriptProperty); Q_PROPERTY(MyGroupedObject *grouped READ grouped CONSTANT); + Q_PROPERTY(MyGroupedObject *nullGrouped READ nullGrouped CONSTANT); public: MyTypeObject() @@ -413,6 +420,14 @@ public: vectorPropertyValue = v; } + QUrl urlPropertyValue; + QUrl urlProperty() const { + return urlPropertyValue; + } + void setUrlProperty(const QUrl &v) { + urlPropertyValue = v; + } + QmlScriptString scriptPropertyValue; QmlScriptString scriptProperty() const { return scriptPropertyValue; @@ -424,6 +439,8 @@ public: MyGroupedObject groupedValue; MyGroupedObject *grouped() { return &groupedValue; } + MyGroupedObject *nullGrouped() { return 0; } + void doAction() { emit action(); } signals: void action(); diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp index c646583..c23bb2d 100644 --- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp +++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp @@ -141,6 +141,7 @@ private: QFile file(QLatin1String("data/") + QLatin1String(errorfile)); \ QVERIFY(file.open(QIODevice::ReadOnly)); \ QByteArray data = file.readAll(); \ + file.close(); \ QList expected = data.split('\n'); \ expected.removeAll(QByteArray("")); \ QList errors = component.errors(); \ @@ -154,7 +155,16 @@ private: } \ if (qgetenv("DEBUG") != "" && expected != actual) \ qWarning() << "Expected:" << expected << "Actual:" << actual; \ - QCOMPARE(expected, actual); \ + if (qgetenv("QMLLANGUAGE_UPDATEERRORS") != "" && expected != actual) {\ + QFile file(QLatin1String("data/") + QLatin1String(errorfile)); \ + QVERIFY(file.open(QIODevice::WriteOnly)); \ + for (int ii = 0; ii < actual.count(); ++ii) { \ + file.write(actual.at(ii)); file.write("\n"); \ + } \ + file.close(); \ + } else { \ + QCOMPARE(expected, actual); \ + } \ } inline QUrl TEST_FILE(const QString &filename) @@ -214,6 +224,7 @@ void tst_qmllanguage::errors_data() QTest::newRow("wrongType (color for size)") << "wrongType.12.qml" << "wrongType.12.errors.txt" << false; QTest::newRow("wrongType (number string for int)") << "wrongType.13.qml" << "wrongType.13.errors.txt" << false; QTest::newRow("wrongType (int for string)") << "wrongType.14.qml" << "wrongType.14.errors.txt" << false; + QTest::newRow("wrongType (int for url)") << "wrongType.15.qml" << "wrongType.15.errors.txt" << false; QTest::newRow("readOnly.1") << "readOnly.1.qml" << "readOnly.1.errors.txt" << false; QTest::newRow("readOnly.2") << "readOnly.2.qml" << "readOnly.2.errors.txt" << false; @@ -240,8 +251,14 @@ void tst_qmllanguage::errors_data() QTest::newRow("missingSignal") << "missingSignal.qml" << "missingSignal.errors.txt" << false; QTest::newRow("finalOverride") << "finalOverride.qml" << "finalOverride.errors.txt" << false; QTest::newRow("customParserIdNotAllowed") << "customParserIdNotAllowed.qml" << "customParserIdNotAllowed.errors.txt" << false; + QTest::newRow("invalidGroupedProperty.1") << "invalidGroupedProperty.1.qml" << "invalidGroupedProperty.1.errors.txt" << false; QTest::newRow("invalidGroupedProperty.2") << "invalidGroupedProperty.2.qml" << "invalidGroupedProperty.2.errors.txt" << false; + QTest::newRow("invalidGroupedProperty.3") << "invalidGroupedProperty.3.qml" << "invalidGroupedProperty.3.errors.txt" << false; + QTest::newRow("invalidGroupedProperty.4") << "invalidGroupedProperty.4.qml" << "invalidGroupedProperty.4.errors.txt" << false; + QTest::newRow("invalidGroupedProperty.5") << "invalidGroupedProperty.5.qml" << "invalidGroupedProperty.5.errors.txt" << false; + QTest::newRow("invalidGroupedProperty.6") << "invalidGroupedProperty.6.qml" << "invalidGroupedProperty.6.errors.txt" << false; + QTest::newRow("invalidGroupedProperty.7") << "invalidGroupedProperty.7.qml" << "invalidGroupedProperty.7.errors.txt" << true; QTest::newRow("importNamespaceConflict") << "importNamespaceConflict.qml" << "importNamespaceConflict.errors.txt" << false; QTest::newRow("importVersionMissing (builtin)") << "importVersionMissingBuiltIn.qml" << "importVersionMissingBuiltIn.errors.txt" << false; @@ -278,13 +295,28 @@ void tst_qmllanguage::errors_data() QTest::newRow("Component.5") << "component.5.qml" << "component.5.errors.txt" << false; QTest::newRow("Component.6") << "component.6.qml" << "component.6.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.1") << "invalidAttachedProperty.1.qml" << "invalidAttachedProperty.1.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.2") << "invalidAttachedProperty.2.qml" << "invalidAttachedProperty.2.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.3") << "invalidAttachedProperty.3.qml" << "invalidAttachedProperty.3.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.4") << "invalidAttachedProperty.4.qml" << "invalidAttachedProperty.4.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.5") << "invalidAttachedProperty.5.qml" << "invalidAttachedProperty.5.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.6") << "invalidAttachedProperty.6.qml" << "invalidAttachedProperty.6.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.7") << "invalidAttachedProperty.7.qml" << "invalidAttachedProperty.7.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.8") << "invalidAttachedProperty.8.qml" << "invalidAttachedProperty.8.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.9") << "invalidAttachedProperty.9.qml" << "invalidAttachedProperty.9.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.10") << "invalidAttachedProperty.10.qml" << "invalidAttachedProperty.10.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.11") << "invalidAttachedProperty.11.qml" << "invalidAttachedProperty.11.errors.txt" << false; + QTest::newRow("nestedErrors") << "nestedErrors.qml" << "nestedErrors.errors.txt" << false; QTest::newRow("defaultGrouped") << "defaultGrouped.qml" << "defaultGrouped.errors.txt" << false; QTest::newRow("emptySignal") << "emptySignal.qml" << "emptySignal.errors.txt" << false; QTest::newRow("doubleSignal") << "doubleSignal.qml" << "doubleSignal.errors.txt" << false; QTest::newRow("invalidRoot") << "invalidRoot.qml" << "invalidRoot.errors.txt" << false; + QTest::newRow("missingValueTypeProperty") << "missingValueTypeProperty.qml" << "missingValueTypeProperty.errors.txt" << false; + QTest::newRow("objectValueTypeProperty") << "objectValueTypeProperty.qml" << "objectValueTypeProperty.errors.txt" << false; } + void tst_qmllanguage::errors() { QFETCH(QString, file); @@ -420,6 +452,7 @@ void tst_qmllanguage::assignBasicTypes() QCOMPARE(object->boolProperty(), true); QCOMPARE(object->variantProperty(), QVariant("Hello World!")); QCOMPARE(object->vectorProperty(), QVector3D(10, 1, 2.2)); + QCOMPARE(object->urlProperty(), component.url().resolved(QUrl("main.qml"))); QVERIFY(object->objectProperty() != 0); MyTypeObject *child = qobject_cast(object->objectProperty()); QVERIFY(child != 0); @@ -611,6 +644,7 @@ void tst_qmllanguage::attachedProperties() QObject *attached = qmlAttachedPropertiesObject(object); QVERIFY(attached != 0); QCOMPARE(attached->property("value"), QVariant(10)); + QCOMPARE(attached->property("value2"), QVariant(13)); } // Tests non-static object properties -- cgit v0.12 From d13d9d070e63cb9321bbdbc0eacf965f1ed070bb Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 6 Nov 2009 14:13:11 +1000 Subject: A missing fixup after rename --- tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp index 5575ace..9f904b8 100644 --- a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp +++ b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp @@ -850,4 +850,4 @@ QList tst_QmlGraphicsListView::findItems(QmlGraphicsItem *parent, const QStr QTEST_MAIN(tst_QmlGraphicsListView) -#include "tst_listview.moc" +#include "tst_qmlgraphicslistview.moc" -- cgit v0.12 From 28b9a4c1bfb6632a10f19bd51528f30205207da0 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 6 Nov 2009 14:25:26 +1000 Subject: test paletteChanged() --- .../qmlsystempalette/tst_qmlsystempalette.cpp | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/auto/declarative/qmlsystempalette/tst_qmlsystempalette.cpp b/tests/auto/declarative/qmlsystempalette/tst_qmlsystempalette.cpp index 039eaa8..2648463 100644 --- a/tests/auto/declarative/qmlsystempalette/tst_qmlsystempalette.cpp +++ b/tests/auto/declarative/qmlsystempalette/tst_qmlsystempalette.cpp @@ -38,7 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + #include +#include #include #include #include @@ -56,6 +58,7 @@ private slots: void activePalette(); void inactivePalette(); void disabledPalette(); + void paletteChanged(); private: QmlEngine engine; @@ -149,6 +152,30 @@ void tst_qmlsystempalette::disabledPalette() delete object; } +void tst_qmlsystempalette::paletteChanged() +{ + QString componentStr = "import Qt 4.6\nSystemPalette { }"; + QmlComponent component(&engine, componentStr.toLatin1(), QUrl("file://")); + QmlSystemPalette *object = qobject_cast(component.create()); + + QVERIFY(object != 0); + + QPalette p; + p.setCurrentColorGroup(QPalette::Active); + p.setColor(QPalette::Active, QPalette::Text, QColor("red")); + p.setColor(QPalette::Active, QPalette::ButtonText, QColor("green")); + p.setColor(QPalette::Active, QPalette::WindowText, QColor("blue")); + + qApp->setPalette(p); + + object->setColorGroup(QmlSystemPalette::Active); + QTRY_COMPARE(QColor("red"), object->text()); + QTRY_COMPARE(QColor("green"), object->buttonText()); + QTRY_COMPARE(QColor("blue"), object->windowText()); + + delete object; +} + QTEST_MAIN(tst_qmlsystempalette) #include "tst_qmlsystempalette.moc" -- cgit v0.12 From 6deb03553ca08857146b4cb4ecde396352fe36d7 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 6 Nov 2009 14:49:56 +1000 Subject: update tests and visuals for qmlgraphicstext --- .../visual/qfxtext/elide/data-X11/elide.0.png | Bin 1002 -> 0 bytes .../visual/qfxtext/elide/data-X11/elide.qml | 279 ---------------- .../qfxtext/elide/data-X11/multilength.0.png | Bin 596 -> 0 bytes .../visual/qfxtext/elide/data-X11/multilength.qml | 303 ----------------- .../visual/qfxtext/elide/data/elide.0.png | Bin 1604 -> 0 bytes .../visual/qfxtext/elide/data/elide.qml | 279 ---------------- .../declarative/visual/qfxtext/elide/elide.qml | 31 -- .../visual/qfxtext/elide/multilength.qml | 19 -- .../visual/qfxtext/font/data-MAC/plaintext.0.png | Bin 103016 -> 0 bytes .../visual/qfxtext/font/data-MAC/plaintext.qml | 351 -------------------- .../visual/qfxtext/font/data-MAC/richtext.0.png | Bin 136499 -> 0 bytes .../visual/qfxtext/font/data-MAC/richtext.qml | 359 --------------------- .../visual/qfxtext/font/data/plaintext.0.png | Bin 94120 -> 0 bytes .../visual/qfxtext/font/data/plaintext.qml | 351 -------------------- .../visual/qfxtext/font/data/richtext.0.png | Bin 121122 -> 0 bytes .../visual/qfxtext/font/data/richtext.qml | 359 --------------------- .../declarative/visual/qfxtext/font/plaintext.qml | 85 ----- .../declarative/visual/qfxtext/font/richtext.qml | 85 ----- .../qmlgraphicstext/elide/data-X11/elide.0.png | Bin 0 -> 1002 bytes .../qmlgraphicstext/elide/data-X11/elide.qml | 279 ++++++++++++++++ .../elide/data-X11/multilength.0.png | Bin 0 -> 596 bytes .../qmlgraphicstext/elide/data-X11/multilength.qml | 303 +++++++++++++++++ .../visual/qmlgraphicstext/elide/data/elide.0.png | Bin 0 -> 1604 bytes .../visual/qmlgraphicstext/elide/data/elide.qml | 279 ++++++++++++++++ .../visual/qmlgraphicstext/elide/elide.qml | 31 ++ .../visual/qmlgraphicstext/elide/multilength.qml | 19 ++ .../qmlgraphicstext/font/data-MAC/plaintext.0.png | Bin 0 -> 103018 bytes .../qmlgraphicstext/font/data-MAC/plaintext.qml | 351 ++++++++++++++++++++ .../qmlgraphicstext/font/data-MAC/richtext.0.png | Bin 0 -> 136492 bytes .../qmlgraphicstext/font/data-MAC/richtext.qml | 359 +++++++++++++++++++++ .../qmlgraphicstext/font/data/plaintext.0.png | Bin 0 -> 94120 bytes .../visual/qmlgraphicstext/font/data/plaintext.qml | 351 ++++++++++++++++++++ .../qmlgraphicstext/font/data/richtext.0.png | Bin 0 -> 121122 bytes .../visual/qmlgraphicstext/font/data/richtext.qml | 359 +++++++++++++++++++++ .../visual/qmlgraphicstext/font/plaintext.qml | 85 +++++ .../visual/qmlgraphicstext/font/richtext.qml | 85 +++++ 36 files changed, 2501 insertions(+), 2501 deletions(-) delete mode 100644 tests/auto/declarative/visual/qfxtext/elide/data-X11/elide.0.png delete mode 100644 tests/auto/declarative/visual/qfxtext/elide/data-X11/elide.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/elide/data-X11/multilength.0.png delete mode 100644 tests/auto/declarative/visual/qfxtext/elide/data-X11/multilength.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/elide/data/elide.0.png delete mode 100644 tests/auto/declarative/visual/qfxtext/elide/data/elide.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/elide/elide.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/elide/multilength.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.0.png delete mode 100644 tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.0.png delete mode 100644 tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/font/data/plaintext.0.png delete mode 100644 tests/auto/declarative/visual/qfxtext/font/data/plaintext.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/font/data/richtext.0.png delete mode 100644 tests/auto/declarative/visual/qfxtext/font/data/richtext.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/font/plaintext.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/font/richtext.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/elide.0.png create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/elide.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/multilength.0.png create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/multilength.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/elide/data/elide.0.png create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/elide/data/elide.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/elide/elide.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/elide/multilength.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/plaintext.0.png create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/plaintext.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/richtext.0.png create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/richtext.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/data/plaintext.0.png create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/data/plaintext.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/data/richtext.0.png create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/data/richtext.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/plaintext.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/richtext.qml diff --git a/tests/auto/declarative/visual/qfxtext/elide/data-X11/elide.0.png b/tests/auto/declarative/visual/qfxtext/elide/data-X11/elide.0.png deleted file mode 100644 index 5631a46..0000000 Binary files a/tests/auto/declarative/visual/qfxtext/elide/data-X11/elide.0.png and /dev/null differ diff --git a/tests/auto/declarative/visual/qfxtext/elide/data-X11/elide.qml b/tests/auto/declarative/visual/qfxtext/elide/data-X11/elide.qml deleted file mode 100644 index cfd832e..0000000 --- a/tests/auto/declarative/visual/qfxtext/elide/data-X11/elide.qml +++ /dev/null @@ -1,279 +0,0 @@ -import Qt.VisualTest 4.6 - -VisualTest { - Frame { - msec: 0 - } - Frame { - msec: 16 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 32 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 48 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 64 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 80 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 96 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 112 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 128 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 144 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 160 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 176 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 192 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 208 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 224 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 240 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 256 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 272 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 288 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 304 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 320 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 336 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 352 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 368 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 384 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 400 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 416 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 432 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 448 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 464 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 480 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 496 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 512 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 528 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 544 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 560 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 576 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 592 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 608 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 624 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 640 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 656 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 672 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 688 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 704 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 720 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 736 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 752 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 768 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 784 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 800 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 816 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 832 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 848 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 864 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 880 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 896 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 912 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 928 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 944 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 960 - image: "elide.0.png" - } - Frame { - msec: 976 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Key { - type: 6 - key: 16777249 - modifiers: 67108864 - text: "" - autorep: false - count: 1 - } - Frame { - msec: 992 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 1008 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 1024 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 1040 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 1056 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } -} diff --git a/tests/auto/declarative/visual/qfxtext/elide/data-X11/multilength.0.png b/tests/auto/declarative/visual/qfxtext/elide/data-X11/multilength.0.png deleted file mode 100644 index 6e2b625..0000000 Binary files a/tests/auto/declarative/visual/qfxtext/elide/data-X11/multilength.0.png and /dev/null differ diff --git a/tests/auto/declarative/visual/qfxtext/elide/data-X11/multilength.qml b/tests/auto/declarative/visual/qfxtext/elide/data-X11/multilength.qml deleted file mode 100644 index 0c06196..0000000 --- a/tests/auto/declarative/visual/qfxtext/elide/data-X11/multilength.qml +++ /dev/null @@ -1,303 +0,0 @@ -import Qt.VisualTest 4.6 - -VisualTest { - Frame { - msec: 0 - } - Frame { - msec: 16 - hash: "873e914454b7a040b05649ebd1a2f8c5" - } - Frame { - msec: 32 - hash: "7682a4f1e361ca252da9713734a598e8" - } - Frame { - msec: 48 - hash: "fa8884b550c8df872f96b61557163bcf" - } - Frame { - msec: 64 - hash: "b84ecf9e38f126c3e32defee831d9462" - } - Frame { - msec: 80 - hash: "21cc08f22d1f1fcb38b27a3a4259debe" - } - Frame { - msec: 96 - hash: "93bdfeab813e25e85917f49c0d5f1314" - } - Frame { - msec: 112 - hash: "5f03c252602e60fe19879945fa77c203" - } - Frame { - msec: 128 - hash: "f0b2079f6c512bf80989ebfdbec4cfd8" - } - Frame { - msec: 144 - hash: "9e7bb12d5b7605fc1d78ed9b2a549527" - } - Frame { - msec: 160 - hash: "242bbbe6da87708c92fd47607ecb789d" - } - Frame { - msec: 176 - hash: "f1db5c3a230b4d3e2e1dfefe6bf032a1" - } - Frame { - msec: 192 - hash: "a416e820efd8e173cc52372218513e33" - } - Frame { - msec: 208 - hash: "df711ab70c6087f8138fded16167f069" - } - Frame { - msec: 224 - hash: "fb28eb2eeccfab28299640ef996c1115" - } - Frame { - msec: 240 - hash: "c72c6d79a50dd7147f6b33784880eb36" - } - Frame { - msec: 256 - hash: "4421027e65e95f98499ca53c57220ede" - } - Frame { - msec: 272 - hash: "b7fbfb90d8cc167809e8e846d9021b4b" - } - Frame { - msec: 288 - hash: "004614b1bf18e9aa78e78509c4f289aa" - } - Frame { - msec: 304 - hash: "1792bbd8b69bae1d92fed2a6bcfe0187" - } - Frame { - msec: 320 - hash: "957a8b95d6e85885d854b8eb1db10b04" - } - Frame { - msec: 336 - hash: "d00c3e4d6d8e8d04b949840c28d73a33" - } - Frame { - msec: 352 - hash: "2b79feaa62d773d92d8a684685b2004c" - } - Frame { - msec: 368 - hash: "ef2f11b187028de0c56b23db3168fbc8" - } - Frame { - msec: 384 - hash: "3a489a96aaeca80355313198b935691d" - } - Frame { - msec: 400 - hash: "389f1798f900795a8686c38ace755974" - } - Frame { - msec: 416 - hash: "34fc20be52fe3843420819b9adb90b22" - } - Frame { - msec: 432 - hash: "fa715c5b6640eafe204bf3b8095c74b9" - } - Frame { - msec: 448 - hash: "8e8315edcf23167ac58228b8c28b43e6" - } - Frame { - msec: 464 - hash: "c18e82038f57dd869112cb1be14e4cfe" - } - Frame { - msec: 480 - hash: "3f07e95b09e39f2e5d93216850f4a4d9" - } - Frame { - msec: 496 - hash: "20f0e6eaeac04d6f93565adfab485218" - } - Frame { - msec: 512 - hash: "e3f66d1dfe88dd868a54a8493828ef5f" - } - Frame { - msec: 528 - hash: "d39d34f63e1b29c187249cb388552b38" - } - Frame { - msec: 544 - hash: "5d2e8df5003732f3b53fff4aaddea06c" - } - Frame { - msec: 560 - hash: "35c3aa2dae481a8f817d849b3f3151f2" - } - Frame { - msec: 576 - hash: "966b78018879224948b4d85fe73d7985" - } - Frame { - msec: 592 - hash: "0db067bf9debc3f36dd539cf83652fb8" - } - Frame { - msec: 608 - hash: "ea1c3249ffd2439533907ceaeaafbc56" - } - Frame { - msec: 624 - hash: "da85c0e14b95ca9a729984b67ebd52ad" - } - Frame { - msec: 640 - hash: "5c26ae844ac52dbe131fed0638787aac" - } - Frame { - msec: 656 - hash: "4b09c23ad624db80afcb2a6c1d5ddb96" - } - Frame { - msec: 672 - hash: "9995deb3d22b418a19093b4b988b3fcc" - } - Frame { - msec: 688 - hash: "77e53358f2d4392d0ba988187e7e272c" - } - Frame { - msec: 704 - hash: "3fbbb73e790cf4a0583531fe1580f761" - } - Frame { - msec: 720 - hash: "9d562e141095a258ee61463e644d9889" - } - Frame { - msec: 736 - hash: "d05633ca49f96bf327bed5c9c0f6ac98" - } - Frame { - msec: 752 - hash: "34c38e40e831dbede8fa83de31ed76aa" - } - Frame { - msec: 768 - hash: "288e52c8be54f4914f687cef4ce1f24a" - } - Frame { - msec: 784 - hash: "0b8b744aaf67e8b17fa459bb0ffb6db5" - } - Frame { - msec: 800 - hash: "273dbe3e8c21bfeafa516d07778928c8" - } - Frame { - msec: 816 - hash: "ef94ee1885287c72fa78038547d98b96" - } - Frame { - msec: 832 - hash: "965e6387672319ac04fdc42768e581f1" - } - Frame { - msec: 848 - hash: "95553d8aaece94c7017e57b03cd46c9a" - } - Frame { - msec: 864 - hash: "bdaf35b920e5b08b8639d452afd2d51e" - } - Frame { - msec: 880 - hash: "0ed16f00e89327dc8679bec42179c4ce" - } - Frame { - msec: 896 - hash: "8c93e0ac399e09e98e34b90654e0e42a" - } - Frame { - msec: 912 - hash: "93798fbb33adb6c813018757cfa34017" - } - Frame { - msec: 928 - hash: "db4d7581e9a1f082a2c29ef7482a7893" - } - Frame { - msec: 944 - hash: "67e074c1e083334de84a3549f4ee9ca4" - } - Frame { - msec: 960 - image: "multilength.0.png" - } - Frame { - msec: 976 - hash: "b1122c815a755c9988bcf03a3f7d7d6d" - } - Frame { - msec: 992 - hash: "31148bae6653bdc3f1827d06de845663" - } - Frame { - msec: 1008 - hash: "812428a944086ca46e102891964dac69" - } - Frame { - msec: 1024 - hash: "ee7bb66bd7e8623325200ac994f8b41a" - } - Frame { - msec: 1040 - hash: "6bd21a98e5c373a2c78334a0255e7750" - } - Frame { - msec: 1056 - hash: "2e8e1eea14068b0e82464ed52ec1ab7a" - } - Frame { - msec: 1072 - hash: "6dca5756e20eeb778e31d7b602ce77d7" - } - Frame { - msec: 1088 - hash: "3cbb6700b9e30864a2b1e3d4d71d2a78" - } - Frame { - msec: 1104 - hash: "c4d0230d2c4f73191a514e5df4c0b083" - } - Frame { - msec: 1120 - hash: "a33df967fe43151dfc503d2ac78f8ca8" - } - Frame { - msec: 1136 - hash: "0c7ff101efe60b600cacaf8d04d79053" - } - Frame { - msec: 1152 - hash: "d246cfb75d89b9666877860aaf45ba60" - } - Frame { - msec: 1168 - hash: "1130998aa2618a29ec6bc4b9219eedfa" - } - Frame { - msec: 1184 - hash: "741dd83003633bbf8d28c2d4ddd8a2d0" - } -} diff --git a/tests/auto/declarative/visual/qfxtext/elide/data/elide.0.png b/tests/auto/declarative/visual/qfxtext/elide/data/elide.0.png deleted file mode 100644 index 1a8c89b..0000000 Binary files a/tests/auto/declarative/visual/qfxtext/elide/data/elide.0.png and /dev/null differ diff --git a/tests/auto/declarative/visual/qfxtext/elide/data/elide.qml b/tests/auto/declarative/visual/qfxtext/elide/data/elide.qml deleted file mode 100644 index 59f17f7..0000000 --- a/tests/auto/declarative/visual/qfxtext/elide/data/elide.qml +++ /dev/null @@ -1,279 +0,0 @@ -import Qt.VisualTest 4.6 - -VisualTest { - Frame { - msec: 0 - } - Frame { - msec: 16 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 32 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 48 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 64 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 80 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 96 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 112 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 128 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 144 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 160 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 176 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 192 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 208 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 224 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 240 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 256 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 272 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 288 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 304 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 320 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 336 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 352 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 368 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 384 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 400 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 416 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 432 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 448 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 464 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 480 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 496 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 512 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 528 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 544 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 560 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 576 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 592 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 608 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 624 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 640 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 656 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 672 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 688 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 704 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 720 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 736 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 752 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 768 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 784 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 800 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 816 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 832 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 848 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 864 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 880 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 896 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 912 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 928 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 944 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 960 - image: "elide.0.png" - } - Frame { - msec: 976 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Key { - type: 6 - key: 16777249 - modifiers: 67108864 - text: "" - autorep: false - count: 1 - } - Frame { - msec: 992 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 1008 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 1024 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 1040 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 1056 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } -} diff --git a/tests/auto/declarative/visual/qfxtext/elide/elide.qml b/tests/auto/declarative/visual/qfxtext/elide/elide.qml deleted file mode 100644 index 3c9ea5b..0000000 --- a/tests/auto/declarative/visual/qfxtext/elide/elide.qml +++ /dev/null @@ -1,31 +0,0 @@ -import Qt 4.6 - -Rectangle { - width: childrenRect.width - height: childrenRect.height - Column { - width: 80 - height: MyText.height*4 - Text { - elide: "ElideLeft" - text: "aaa bbb ccc ddd eee fff" - width: 80 - id: MyText - } - Text { - elide: "ElideMiddle" - text: "aaa bbb ccc ddd eee fff" - width: 80 - } - Text { - elide: "ElideRight" - text: "aaa bbb ccc ddd eee fff" - width: 80 - } - Text { - elide: "ElideNone" - text: "aaa bbb ccc ddd eee fff" - width: 80 - } - } -} diff --git a/tests/auto/declarative/visual/qfxtext/elide/multilength.qml b/tests/auto/declarative/visual/qfxtext/elide/multilength.qml deleted file mode 100644 index fa74cc4..0000000 --- a/tests/auto/declarative/visual/qfxtext/elide/multilength.qml +++ /dev/null @@ -1,19 +0,0 @@ -import Qt 4.6 - -Rectangle { - width: 500 - height: 50 - color: "lightBlue" - Rectangle { - width: MyText.width - height: MyText.height - color: "white" - anchors.centerIn: parent - Text { - id: MyText - width: NumberAnimation { from: 500; to: 0; running: true; repeat: true; duration: 1000 } - elide: "ElideRight" - text: "Brevity is the soul of wit, and tediousness the limbs and outward flourishes.\x9CBrevity is a great charm of eloquence.\x9CBe concise!\x9CSHHHHHHHHHHHHHHHHHHHHHHHHHHHH" - } - } -} diff --git a/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.0.png b/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.0.png deleted file mode 100644 index a54a327..0000000 Binary files a/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.0.png and /dev/null differ diff --git a/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.qml b/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.qml deleted file mode 100644 index 266c9a3..0000000 --- a/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.qml +++ /dev/null @@ -1,351 +0,0 @@ -import Qt.VisualTest 4.6 - -VisualTest { - Frame { - msec: 0 - } - Frame { - msec: 16 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 32 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 48 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 64 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 80 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 96 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 112 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 128 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 144 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 160 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 176 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 192 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 208 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 224 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 240 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 256 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 272 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 288 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 304 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 320 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 336 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 352 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 368 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 384 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 400 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 416 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 432 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 448 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 464 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 480 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 496 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 512 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 528 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 544 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 560 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 576 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 592 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 608 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 624 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 640 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 656 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 672 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 688 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 704 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 720 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 736 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 752 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 768 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 784 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 800 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 816 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 832 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 848 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 864 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 880 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 896 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 912 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 928 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 944 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 960 - image: "plaintext.0.png" - } - Frame { - msec: 976 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 992 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1008 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1024 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1040 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1056 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1072 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1088 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1104 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1120 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1136 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1152 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1168 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1184 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Key { - type: 6 - key: 16777249 - modifiers: 0 - text: "" - autorep: false - count: 1 - } - Frame { - msec: 1200 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1216 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1232 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1248 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1264 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1280 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1296 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1312 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1328 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1344 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } -} diff --git a/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.0.png b/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.0.png deleted file mode 100644 index c2ddee1..0000000 Binary files a/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.0.png and /dev/null differ diff --git a/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.qml b/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.qml deleted file mode 100644 index e971809..0000000 --- a/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.qml +++ /dev/null @@ -1,359 +0,0 @@ -import Qt.VisualTest 4.6 - -VisualTest { - Frame { - msec: 0 - } - Frame { - msec: 16 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 32 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 48 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 64 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 80 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 96 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 112 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 128 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 144 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 160 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 176 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 192 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 208 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 224 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 240 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 256 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 272 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 288 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 304 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 320 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 336 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 352 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 368 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 384 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 400 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 416 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 432 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 448 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 464 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 480 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 496 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 512 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 528 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 544 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 560 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 576 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 592 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 608 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 624 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 640 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 656 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 672 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 688 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 704 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 720 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 736 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 752 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 768 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 784 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 800 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 816 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 832 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 848 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 864 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 880 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 896 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 912 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 928 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 944 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 960 - image: "richtext.0.png" - } - Frame { - msec: 976 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 992 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1008 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1024 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1040 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1056 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1072 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1088 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1104 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1120 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1136 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1152 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Key { - type: 6 - key: 16777249 - modifiers: 0 - text: "" - autorep: false - count: 1 - } - Frame { - msec: 1168 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1184 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1200 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1216 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1232 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1248 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1264 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1280 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1296 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1312 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1328 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1344 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1360 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1376 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } -} diff --git a/tests/auto/declarative/visual/qfxtext/font/data/plaintext.0.png b/tests/auto/declarative/visual/qfxtext/font/data/plaintext.0.png deleted file mode 100644 index 50d56dc..0000000 Binary files a/tests/auto/declarative/visual/qfxtext/font/data/plaintext.0.png and /dev/null differ diff --git a/tests/auto/declarative/visual/qfxtext/font/data/plaintext.qml b/tests/auto/declarative/visual/qfxtext/font/data/plaintext.qml deleted file mode 100644 index f4cbcbd..0000000 --- a/tests/auto/declarative/visual/qfxtext/font/data/plaintext.qml +++ /dev/null @@ -1,351 +0,0 @@ -import Qt.VisualTest 4.6 - -VisualTest { - Frame { - msec: 0 - } - Frame { - msec: 16 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 32 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 48 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 64 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 80 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 96 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 112 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 128 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 144 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 160 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 176 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 192 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 208 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 224 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 240 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 256 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 272 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 288 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 304 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 320 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 336 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 352 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 368 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 384 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 400 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 416 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 432 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 448 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 464 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 480 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 496 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 512 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 528 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 544 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 560 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 576 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 592 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 608 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 624 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 640 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 656 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 672 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 688 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 704 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 720 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 736 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 752 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 768 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 784 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 800 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 816 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 832 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 848 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 864 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 880 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 896 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 912 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 928 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 944 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 960 - image: "plaintext.0.png" - } - Frame { - msec: 976 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 992 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1008 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1024 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1040 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1056 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1072 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1088 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1104 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1120 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1136 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1152 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1168 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1184 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Key { - type: 6 - key: 16777249 - modifiers: 67108864 - text: "" - autorep: false - count: 1 - } - Frame { - msec: 1200 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1216 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1232 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1248 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1264 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1280 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1296 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1312 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1328 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1344 - hash: "d553014bc56a46787e30459b0f44f57a" - } -} diff --git a/tests/auto/declarative/visual/qfxtext/font/data/richtext.0.png b/tests/auto/declarative/visual/qfxtext/font/data/richtext.0.png deleted file mode 100644 index 2910670..0000000 Binary files a/tests/auto/declarative/visual/qfxtext/font/data/richtext.0.png and /dev/null differ diff --git a/tests/auto/declarative/visual/qfxtext/font/data/richtext.qml b/tests/auto/declarative/visual/qfxtext/font/data/richtext.qml deleted file mode 100644 index 9f396c2..0000000 --- a/tests/auto/declarative/visual/qfxtext/font/data/richtext.qml +++ /dev/null @@ -1,359 +0,0 @@ -import Qt.VisualTest 4.6 - -VisualTest { - Frame { - msec: 0 - } - Frame { - msec: 16 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 32 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 48 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 64 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 80 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 96 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 112 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 128 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 144 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 160 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 176 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 192 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 208 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 224 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 240 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 256 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 272 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 288 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 304 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 320 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 336 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 352 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 368 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 384 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 400 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 416 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 432 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 448 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 464 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 480 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 496 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 512 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 528 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 544 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 560 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 576 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 592 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 608 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 624 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 640 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 656 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 672 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 688 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 704 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 720 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 736 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 752 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 768 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 784 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 800 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 816 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 832 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 848 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 864 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 880 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 896 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 912 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 928 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 944 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 960 - image: "richtext.0.png" - } - Frame { - msec: 976 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 992 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1008 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1024 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1040 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1056 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1072 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1088 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1104 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1120 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1136 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1152 - hash: "dfea78484b840b8cab690e277b960723" - } - Key { - type: 6 - key: 16777249 - modifiers: 67108864 - text: "" - autorep: false - count: 1 - } - Frame { - msec: 1168 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1184 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1200 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1216 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1232 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1248 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1264 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1280 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1296 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1312 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1328 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1344 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1360 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1376 - hash: "dfea78484b840b8cab690e277b960723" - } -} diff --git a/tests/auto/declarative/visual/qfxtext/font/plaintext.qml b/tests/auto/declarative/visual/qfxtext/font/plaintext.qml deleted file mode 100644 index f219e09..0000000 --- a/tests/auto/declarative/visual/qfxtext/font/plaintext.qml +++ /dev/null @@ -1,85 +0,0 @@ -import Qt 4.6 - -Rectangle { - id: s; width: 800; height: 1000; color: "lightsteelblue" - property string text: "The quick brown fox jumps over the lazy dog." - - Column { - spacing: 10 - Text { - text: s.text - } - Text { - text: s.text; font.pixelSize: 18 - } - Text { - text: s.text; font.pointSize: 25 - } - Text { - text: s.text; color: "red"; smooth: true - } - Text { - text: s.text; font.capitalization: "AllUppercase" - } - Text { - text: s.text; font.underline: true - } - Text { - text: s.text; font.overline: true; smooth: true - } - Text { - text: s.text; font.strikeout: true - } - Text { - text: s.text; font.underline: true; font.overline: true; font.strikeout: true - } - Text { - text: s.text; font.letterSpacing: 200 - } - Text { - text: s.text; font.underline: true; font.letterSpacing: 200; font.capitalization: "AllUppercase"; color: "blue" - } - Text { - text: s.text; font.overline: true; font.wordSpacing: 25; font.capitalization: "Capitalize"; color: "green" - } - Text { - text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white" - } - Text { - text: s.text; font.pixelSize: 18; style: Text.Sunken; styleColor: "gray" - } - Text { - text: s.text; font.pixelSize: 18; style: Text.Raised; styleColor: "yellow" - } - Text { - text: s.text; horizontalAlignment: Text.AlignLeft; width: 800 - } - Text { - text: s.text; horizontalAlignment: Text.AlignHCenter; width: 800 - } - Text { - text: s.text; horizontalAlignment: Text.AlignRight; width: 800 - } - Text { - text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white"; wrap: true; width: 200 - } - Text { - text: s.text; elide: Text.ElideLeft; width: 200 - } - Text { - text: s.text; elide: Text.ElideMiddle; width: 200 - } - Text { - text: s.text; elide: Text.ElideRight; width: 200 - } - Text { - text: s.text; elide: Text.ElideLeft; width: 200; wrap: true - } - Text { - text: s.text; elide: Text.ElideMiddle; width: 200; wrap: true - } - Text { - text: s.text; elide: Text.ElideRight; width: 200; wrap: true - } - } -} diff --git a/tests/auto/declarative/visual/qfxtext/font/richtext.qml b/tests/auto/declarative/visual/qfxtext/font/richtext.qml deleted file mode 100644 index 00a9749..0000000 --- a/tests/auto/declarative/visual/qfxtext/font/richtext.qml +++ /dev/null @@ -1,85 +0,0 @@ -import Qt 4.6 - -Rectangle { - id: s; width: 800; height: 1000; color: "lightsteelblue" - property string text: "The quick brown fox jumps over the lazy dog." - - Column { - spacing: 10 - Text { - text: s.text - } - Text { - text: s.text; font.pixelSize: 18 - } - Text { - text: s.text; font.pointSize: 25 - } - Text { - text: s.text; color: "red"; smooth: true - } - Text { - text: s.text; font.capitalization: "AllUppercase" - } - Text { - text: s.text; font.underline: true - } - Text { - text: s.text; font.overline: true; smooth: true - } - Text { - text: s.text; font.strikeout: true - } - Text { - text: s.text; font.underline: true; font.overline: true; font.strikeout: true - } - Text { - text: s.text; font.letterSpacing: 200 - } - Text { - text: s.text; font.underline: true; font.letterSpacing: 200; font.capitalization: "AllUppercase"; color: "blue" - } - Text { - text: s.text; font.overline: true; font.wordSpacing: 25; font.capitalization: "Capitalize"; color: "green" - } - Text { - text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white" - } - Text { - text: s.text; font.pixelSize: 18; style: Text.Sunken; styleColor: "gray" - } - Text { - text: s.text; font.pixelSize: 18; style: Text.Raised; styleColor: "yellow" - } - Text { - text: s.text; horizontalAlignment: Text.AlignLeft; width: 800 - } - Text { - text: s.text; horizontalAlignment: Text.AlignHCenter; width: 800 - } - Text { - text: s.text; horizontalAlignment: Text.AlignRight; width: 800 - } - Text { - text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white"; wrap: true; width: 200 - } - Text { - text: s.text; elide: Text.ElideLeft; width: 200 - } - Text { - text: s.text; elide: Text.ElideMiddle; width: 200 - } - Text { - text: s.text; elide: Text.ElideRight; width: 200 - } - Text { - text: s.text; elide: Text.ElideLeft; width: 200; wrap: true - } - Text { - text: s.text; elide: Text.ElideMiddle; width: 200; wrap: true - } - Text { - text: s.text; elide: Text.ElideRight; width: 200; wrap: true - } - } -} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/elide.0.png b/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/elide.0.png new file mode 100644 index 0000000..5631a46 Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/elide.0.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/elide.qml b/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/elide.qml new file mode 100644 index 0000000..cfd832e --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/elide.qml @@ -0,0 +1,279 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 32 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 48 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 64 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 80 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 96 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 112 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 128 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 144 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 160 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 176 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 192 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 208 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 224 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 240 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 256 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 272 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 288 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 304 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 320 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 336 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 352 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 368 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 384 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 400 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 416 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 432 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 448 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 464 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 480 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 496 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 512 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 528 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 544 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 560 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 576 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 592 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 608 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 624 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 640 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 656 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 672 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 688 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 704 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 720 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 736 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 752 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 768 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 784 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 800 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 816 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 832 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 848 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 864 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 880 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 896 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 912 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 928 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 944 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 960 + image: "elide.0.png" + } + Frame { + msec: 976 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 992 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 1008 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 1024 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 1040 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 1056 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/multilength.0.png b/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/multilength.0.png new file mode 100644 index 0000000..6e2b625 Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/multilength.0.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/multilength.qml b/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/multilength.qml new file mode 100644 index 0000000..0c06196 --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/multilength.qml @@ -0,0 +1,303 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "873e914454b7a040b05649ebd1a2f8c5" + } + Frame { + msec: 32 + hash: "7682a4f1e361ca252da9713734a598e8" + } + Frame { + msec: 48 + hash: "fa8884b550c8df872f96b61557163bcf" + } + Frame { + msec: 64 + hash: "b84ecf9e38f126c3e32defee831d9462" + } + Frame { + msec: 80 + hash: "21cc08f22d1f1fcb38b27a3a4259debe" + } + Frame { + msec: 96 + hash: "93bdfeab813e25e85917f49c0d5f1314" + } + Frame { + msec: 112 + hash: "5f03c252602e60fe19879945fa77c203" + } + Frame { + msec: 128 + hash: "f0b2079f6c512bf80989ebfdbec4cfd8" + } + Frame { + msec: 144 + hash: "9e7bb12d5b7605fc1d78ed9b2a549527" + } + Frame { + msec: 160 + hash: "242bbbe6da87708c92fd47607ecb789d" + } + Frame { + msec: 176 + hash: "f1db5c3a230b4d3e2e1dfefe6bf032a1" + } + Frame { + msec: 192 + hash: "a416e820efd8e173cc52372218513e33" + } + Frame { + msec: 208 + hash: "df711ab70c6087f8138fded16167f069" + } + Frame { + msec: 224 + hash: "fb28eb2eeccfab28299640ef996c1115" + } + Frame { + msec: 240 + hash: "c72c6d79a50dd7147f6b33784880eb36" + } + Frame { + msec: 256 + hash: "4421027e65e95f98499ca53c57220ede" + } + Frame { + msec: 272 + hash: "b7fbfb90d8cc167809e8e846d9021b4b" + } + Frame { + msec: 288 + hash: "004614b1bf18e9aa78e78509c4f289aa" + } + Frame { + msec: 304 + hash: "1792bbd8b69bae1d92fed2a6bcfe0187" + } + Frame { + msec: 320 + hash: "957a8b95d6e85885d854b8eb1db10b04" + } + Frame { + msec: 336 + hash: "d00c3e4d6d8e8d04b949840c28d73a33" + } + Frame { + msec: 352 + hash: "2b79feaa62d773d92d8a684685b2004c" + } + Frame { + msec: 368 + hash: "ef2f11b187028de0c56b23db3168fbc8" + } + Frame { + msec: 384 + hash: "3a489a96aaeca80355313198b935691d" + } + Frame { + msec: 400 + hash: "389f1798f900795a8686c38ace755974" + } + Frame { + msec: 416 + hash: "34fc20be52fe3843420819b9adb90b22" + } + Frame { + msec: 432 + hash: "fa715c5b6640eafe204bf3b8095c74b9" + } + Frame { + msec: 448 + hash: "8e8315edcf23167ac58228b8c28b43e6" + } + Frame { + msec: 464 + hash: "c18e82038f57dd869112cb1be14e4cfe" + } + Frame { + msec: 480 + hash: "3f07e95b09e39f2e5d93216850f4a4d9" + } + Frame { + msec: 496 + hash: "20f0e6eaeac04d6f93565adfab485218" + } + Frame { + msec: 512 + hash: "e3f66d1dfe88dd868a54a8493828ef5f" + } + Frame { + msec: 528 + hash: "d39d34f63e1b29c187249cb388552b38" + } + Frame { + msec: 544 + hash: "5d2e8df5003732f3b53fff4aaddea06c" + } + Frame { + msec: 560 + hash: "35c3aa2dae481a8f817d849b3f3151f2" + } + Frame { + msec: 576 + hash: "966b78018879224948b4d85fe73d7985" + } + Frame { + msec: 592 + hash: "0db067bf9debc3f36dd539cf83652fb8" + } + Frame { + msec: 608 + hash: "ea1c3249ffd2439533907ceaeaafbc56" + } + Frame { + msec: 624 + hash: "da85c0e14b95ca9a729984b67ebd52ad" + } + Frame { + msec: 640 + hash: "5c26ae844ac52dbe131fed0638787aac" + } + Frame { + msec: 656 + hash: "4b09c23ad624db80afcb2a6c1d5ddb96" + } + Frame { + msec: 672 + hash: "9995deb3d22b418a19093b4b988b3fcc" + } + Frame { + msec: 688 + hash: "77e53358f2d4392d0ba988187e7e272c" + } + Frame { + msec: 704 + hash: "3fbbb73e790cf4a0583531fe1580f761" + } + Frame { + msec: 720 + hash: "9d562e141095a258ee61463e644d9889" + } + Frame { + msec: 736 + hash: "d05633ca49f96bf327bed5c9c0f6ac98" + } + Frame { + msec: 752 + hash: "34c38e40e831dbede8fa83de31ed76aa" + } + Frame { + msec: 768 + hash: "288e52c8be54f4914f687cef4ce1f24a" + } + Frame { + msec: 784 + hash: "0b8b744aaf67e8b17fa459bb0ffb6db5" + } + Frame { + msec: 800 + hash: "273dbe3e8c21bfeafa516d07778928c8" + } + Frame { + msec: 816 + hash: "ef94ee1885287c72fa78038547d98b96" + } + Frame { + msec: 832 + hash: "965e6387672319ac04fdc42768e581f1" + } + Frame { + msec: 848 + hash: "95553d8aaece94c7017e57b03cd46c9a" + } + Frame { + msec: 864 + hash: "bdaf35b920e5b08b8639d452afd2d51e" + } + Frame { + msec: 880 + hash: "0ed16f00e89327dc8679bec42179c4ce" + } + Frame { + msec: 896 + hash: "8c93e0ac399e09e98e34b90654e0e42a" + } + Frame { + msec: 912 + hash: "93798fbb33adb6c813018757cfa34017" + } + Frame { + msec: 928 + hash: "db4d7581e9a1f082a2c29ef7482a7893" + } + Frame { + msec: 944 + hash: "67e074c1e083334de84a3549f4ee9ca4" + } + Frame { + msec: 960 + image: "multilength.0.png" + } + Frame { + msec: 976 + hash: "b1122c815a755c9988bcf03a3f7d7d6d" + } + Frame { + msec: 992 + hash: "31148bae6653bdc3f1827d06de845663" + } + Frame { + msec: 1008 + hash: "812428a944086ca46e102891964dac69" + } + Frame { + msec: 1024 + hash: "ee7bb66bd7e8623325200ac994f8b41a" + } + Frame { + msec: 1040 + hash: "6bd21a98e5c373a2c78334a0255e7750" + } + Frame { + msec: 1056 + hash: "2e8e1eea14068b0e82464ed52ec1ab7a" + } + Frame { + msec: 1072 + hash: "6dca5756e20eeb778e31d7b602ce77d7" + } + Frame { + msec: 1088 + hash: "3cbb6700b9e30864a2b1e3d4d71d2a78" + } + Frame { + msec: 1104 + hash: "c4d0230d2c4f73191a514e5df4c0b083" + } + Frame { + msec: 1120 + hash: "a33df967fe43151dfc503d2ac78f8ca8" + } + Frame { + msec: 1136 + hash: "0c7ff101efe60b600cacaf8d04d79053" + } + Frame { + msec: 1152 + hash: "d246cfb75d89b9666877860aaf45ba60" + } + Frame { + msec: 1168 + hash: "1130998aa2618a29ec6bc4b9219eedfa" + } + Frame { + msec: 1184 + hash: "741dd83003633bbf8d28c2d4ddd8a2d0" + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/elide/data/elide.0.png b/tests/auto/declarative/visual/qmlgraphicstext/elide/data/elide.0.png new file mode 100644 index 0000000..1a8c89b Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicstext/elide/data/elide.0.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicstext/elide/data/elide.qml b/tests/auto/declarative/visual/qmlgraphicstext/elide/data/elide.qml new file mode 100644 index 0000000..59f17f7 --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/elide/data/elide.qml @@ -0,0 +1,279 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 32 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 48 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 64 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 80 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 96 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 112 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 128 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 144 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 160 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 176 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 192 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 208 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 224 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 240 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 256 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 272 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 288 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 304 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 320 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 336 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 352 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 368 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 384 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 400 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 416 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 432 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 448 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 464 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 480 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 496 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 512 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 528 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 544 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 560 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 576 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 592 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 608 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 624 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 640 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 656 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 672 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 688 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 704 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 720 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 736 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 752 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 768 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 784 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 800 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 816 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 832 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 848 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 864 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 880 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 896 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 912 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 928 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 944 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 960 + image: "elide.0.png" + } + Frame { + msec: 976 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 992 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 1008 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 1024 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 1040 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 1056 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/elide/elide.qml b/tests/auto/declarative/visual/qmlgraphicstext/elide/elide.qml new file mode 100644 index 0000000..3c9ea5b --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/elide/elide.qml @@ -0,0 +1,31 @@ +import Qt 4.6 + +Rectangle { + width: childrenRect.width + height: childrenRect.height + Column { + width: 80 + height: MyText.height*4 + Text { + elide: "ElideLeft" + text: "aaa bbb ccc ddd eee fff" + width: 80 + id: MyText + } + Text { + elide: "ElideMiddle" + text: "aaa bbb ccc ddd eee fff" + width: 80 + } + Text { + elide: "ElideRight" + text: "aaa bbb ccc ddd eee fff" + width: 80 + } + Text { + elide: "ElideNone" + text: "aaa bbb ccc ddd eee fff" + width: 80 + } + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/elide/multilength.qml b/tests/auto/declarative/visual/qmlgraphicstext/elide/multilength.qml new file mode 100644 index 0000000..fa74cc4 --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/elide/multilength.qml @@ -0,0 +1,19 @@ +import Qt 4.6 + +Rectangle { + width: 500 + height: 50 + color: "lightBlue" + Rectangle { + width: MyText.width + height: MyText.height + color: "white" + anchors.centerIn: parent + Text { + id: MyText + width: NumberAnimation { from: 500; to: 0; running: true; repeat: true; duration: 1000 } + elide: "ElideRight" + text: "Brevity is the soul of wit, and tediousness the limbs and outward flourishes.\x9CBrevity is a great charm of eloquence.\x9CBe concise!\x9CSHHHHHHHHHHHHHHHHHHHHHHHHHHHH" + } + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/plaintext.0.png b/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/plaintext.0.png new file mode 100644 index 0000000..05a6e51 Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/plaintext.0.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/plaintext.qml b/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/plaintext.qml new file mode 100644 index 0000000..7e591c8 --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/plaintext.qml @@ -0,0 +1,351 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 32 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 48 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 64 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 80 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 96 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 112 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 128 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 144 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 160 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 176 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 192 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 208 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 224 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 240 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 256 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 272 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 288 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 304 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 320 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 336 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 352 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 368 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 384 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 400 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 416 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 432 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 448 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 464 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 480 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 496 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 512 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 528 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 544 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 560 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 576 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 592 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 608 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 624 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 640 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 656 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 672 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 688 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 704 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 720 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 736 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 752 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 768 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 784 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 800 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 816 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 832 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 848 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 864 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 880 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 896 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 912 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 928 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 944 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 960 + image: "plaintext.0.png" + } + Frame { + msec: 976 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 992 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1008 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1024 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1040 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1056 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1072 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1088 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1104 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1120 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1136 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1152 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1168 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1184 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 1200 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1216 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1232 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1248 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1264 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1280 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1296 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1312 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1328 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1344 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/richtext.0.png b/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/richtext.0.png new file mode 100644 index 0000000..6379942 Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/richtext.0.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/richtext.qml b/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/richtext.qml new file mode 100644 index 0000000..4414c1c --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/richtext.qml @@ -0,0 +1,359 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 32 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 48 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 64 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 80 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 96 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 112 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 128 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 144 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 160 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 176 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 192 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 208 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 224 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 240 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 256 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 272 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 288 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 304 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 320 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 336 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 352 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 368 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 384 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 400 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 416 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 432 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 448 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 464 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 480 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 496 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 512 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 528 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 544 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 560 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 576 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 592 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 608 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 624 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 640 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 656 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 672 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 688 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 704 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 720 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 736 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 752 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 768 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 784 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 800 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 816 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 832 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 848 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 864 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 880 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 896 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 912 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 928 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 944 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 960 + image: "richtext.0.png" + } + Frame { + msec: 976 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 992 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1008 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1024 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1040 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1056 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1072 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1088 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1104 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1120 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1136 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1152 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 1168 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1184 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1200 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1216 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1232 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1248 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1264 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1280 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1296 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1312 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1328 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1344 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1360 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1376 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/data/plaintext.0.png b/tests/auto/declarative/visual/qmlgraphicstext/font/data/plaintext.0.png new file mode 100644 index 0000000..50d56dc Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicstext/font/data/plaintext.0.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/data/plaintext.qml b/tests/auto/declarative/visual/qmlgraphicstext/font/data/plaintext.qml new file mode 100644 index 0000000..f4cbcbd --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/font/data/plaintext.qml @@ -0,0 +1,351 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 32 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 48 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 64 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 80 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 96 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 112 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 128 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 144 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 160 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 176 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 192 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 208 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 224 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 240 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 256 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 272 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 288 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 304 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 320 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 336 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 352 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 368 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 384 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 400 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 416 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 432 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 448 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 464 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 480 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 496 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 512 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 528 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 544 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 560 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 576 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 592 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 608 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 624 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 640 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 656 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 672 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 688 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 704 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 720 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 736 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 752 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 768 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 784 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 800 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 816 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 832 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 848 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 864 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 880 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 896 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 912 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 928 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 944 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 960 + image: "plaintext.0.png" + } + Frame { + msec: 976 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 992 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1008 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1024 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1040 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1056 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1072 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1088 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1104 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1120 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1136 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1152 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1168 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1184 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 1200 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1216 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1232 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1248 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1264 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1280 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1296 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1312 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1328 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1344 + hash: "d553014bc56a46787e30459b0f44f57a" + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/data/richtext.0.png b/tests/auto/declarative/visual/qmlgraphicstext/font/data/richtext.0.png new file mode 100644 index 0000000..2910670 Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicstext/font/data/richtext.0.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/data/richtext.qml b/tests/auto/declarative/visual/qmlgraphicstext/font/data/richtext.qml new file mode 100644 index 0000000..9f396c2 --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/font/data/richtext.qml @@ -0,0 +1,359 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 32 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 48 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 64 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 80 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 96 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 112 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 128 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 144 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 160 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 176 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 192 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 208 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 224 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 240 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 256 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 272 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 288 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 304 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 320 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 336 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 352 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 368 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 384 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 400 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 416 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 432 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 448 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 464 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 480 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 496 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 512 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 528 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 544 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 560 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 576 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 592 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 608 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 624 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 640 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 656 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 672 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 688 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 704 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 720 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 736 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 752 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 768 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 784 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 800 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 816 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 832 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 848 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 864 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 880 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 896 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 912 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 928 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 944 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 960 + image: "richtext.0.png" + } + Frame { + msec: 976 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 992 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1008 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1024 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1040 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1056 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1072 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1088 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1104 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1120 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1136 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1152 + hash: "dfea78484b840b8cab690e277b960723" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 1168 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1184 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1200 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1216 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1232 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1248 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1264 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1280 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1296 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1312 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1328 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1344 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1360 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1376 + hash: "dfea78484b840b8cab690e277b960723" + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/plaintext.qml b/tests/auto/declarative/visual/qmlgraphicstext/font/plaintext.qml new file mode 100644 index 0000000..a3aa929 --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/font/plaintext.qml @@ -0,0 +1,85 @@ +import Qt 4.6 + +Rectangle { + id: s; width: 800; height: 1000; color: "lightsteelblue" + property string text: "The quick brown fox jumps over the lazy dog." + + Column { + spacing: 10 + Text { + text: s.text + } + Text { + text: s.text; font.pixelSize: 18 + } + Text { + text: s.text; font.pointSize: 25 + } + Text { + text: s.text; color: "red"; smooth: true + } + Text { + text: s.text; font.capitalization: "AllUppercase" + } + Text { + text: s.text; font.underline: true + } + Text { + text: s.text; font.overline: true; smooth: true + } + Text { + text: s.text; font.strikeout: true + } + Text { + text: s.text; font.underline: true; font.overline: true; font.strikeout: true + } + Text { + text: s.text; font.letterSpacing: 200 + } + Text { + text: s.text; font.underline: true; font.letterSpacing: 200; font.capitalization: "AllUppercase"; color: "blue" + } + Text { + text: s.text; font.overline: true; font.wordSpacing: 25; font.capitalization: "Capitalize"; color: "green" + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white" + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Sunken; styleColor: "gray" + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Raised; styleColor: "yellow" + } + Text { + text: s.text; horizontalAlignment: Text.AlignLeft; width: 800 + } + Text { + text: s.text; horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter; width: 800; height: 20 + } + Text { + text: s.text; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignBottom; width: 800; height: 20 + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white"; wrap: true; width: 200 + } + Text { + text: s.text; elide: Text.ElideLeft; width: 200 + } + Text { + text: s.text; elide: Text.ElideMiddle; width: 200 + } + Text { + text: s.text; elide: Text.ElideRight; width: 200 + } + Text { + text: s.text; elide: Text.ElideLeft; width: 200; wrap: true + } + Text { + text: s.text; elide: Text.ElideMiddle; width: 200; wrap: true + } + Text { + text: s.text; elide: Text.ElideRight; width: 200; wrap: true + } + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/richtext.qml b/tests/auto/declarative/visual/qmlgraphicstext/font/richtext.qml new file mode 100644 index 0000000..35aa232 --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/font/richtext.qml @@ -0,0 +1,85 @@ +import Qt 4.6 + +Rectangle { + id: s; width: 800; height: 1000; color: "lightsteelblue" + property string text: "The quick brown fox jumps over the lazy dog." + + Column { + spacing: 10 + Text { + text: s.text + } + Text { + text: s.text; font.pixelSize: 18 + } + Text { + text: s.text; font.pointSize: 25 + } + Text { + text: s.text; color: "red"; smooth: true + } + Text { + text: s.text; font.capitalization: "AllUppercase" + } + Text { + text: s.text; font.underline: true + } + Text { + text: s.text; font.overline: true; smooth: true + } + Text { + text: s.text; font.strikeout: true + } + Text { + text: s.text; font.underline: true; font.overline: true; font.strikeout: true + } + Text { + text: s.text; font.letterSpacing: 200 + } + Text { + text: s.text; font.underline: true; font.letterSpacing: 200; font.capitalization: "AllUppercase"; color: "blue" + } + Text { + text: s.text; font.overline: true; font.wordSpacing: 25; font.capitalization: "Capitalize"; color: "green" + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white" + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Sunken; styleColor: "gray" + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Raised; styleColor: "yellow" + } + Text { + text: s.text; horizontalAlignment: Text.AlignLeft; width: 800 + } + Text { + text: s.text; horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter; width: 800; height: 20 + } + Text { + text: s.text; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignBottom; width: 800; height: 20 + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white"; wrap: true; width: 200 + } + Text { + text: s.text; elide: Text.ElideLeft; width: 200 + } + Text { + text: s.text; elide: Text.ElideMiddle; width: 200 + } + Text { + text: s.text; elide: Text.ElideRight; width: 200 + } + Text { + text: s.text; elide: Text.ElideLeft; width: 200; wrap: true + } + Text { + text: s.text; elide: Text.ElideMiddle; width: 200; wrap: true + } + Text { + text: s.text; elide: Text.ElideRight; width: 200; wrap: true + } + } +} -- cgit v0.12 From 336cfc8ec78977458b485c3da364af7c0890911e Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 6 Nov 2009 15:03:55 +1000 Subject: More test coverage for Text --- .../qmlgraphicstext/tst_qmlgraphicstext.cpp | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp b/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp index 2a3cdde..1e10873 100644 --- a/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp +++ b/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include class tst_qmlgraphicstext : public QObject @@ -78,6 +79,8 @@ private slots: void letterSpacing(); void wordSpacing(); + void clickLink(); + private: QStringList standard; QStringList richText; @@ -258,6 +261,10 @@ void tst_qmlgraphicstext::wrap() QVERIFY(textObject != 0); QCOMPARE(textObject->width(), 30.); QVERIFY(textObject->height() > textHeight); + + int oldHeight = textObject->height(); + textObject->setWidth(100); + QVERIFY(textObject->height() < oldHeight); } for (int i = 0; i < richText.size(); i++) @@ -730,6 +737,54 @@ void tst_qmlgraphicstext::wordSpacing() } } +class EventSender : public QGraphicsItem +{ +public: + void sendEvent(QEvent *event) { sceneEvent(event); } +}; + +class LinkTest : public QObject +{ + Q_OBJECT +public: + LinkTest() {} + + QString link; + +public slots: + void linkClicked(QString l) { link = l; } +}; + +void tst_qmlgraphicstext::clickLink() +{ + { + QString componentStr = "import Qt 4.6\nText { text: \"Hello world!\" }"; + QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); + QmlGraphicsText *textObject = qobject_cast(textComponent.create()); + + QVERIFY(textObject != 0); + + LinkTest test; + QObject::connect(textObject, SIGNAL(linkActivated(QString)), &test, SLOT(linkClicked(QString))); + + { + QGraphicsSceneMouseEvent me(QEvent::GraphicsSceneMousePress); + me.setPos(QPointF(textObject->x()/2, textObject->y()/2)); + me.setButton(Qt::LeftButton); + static_cast(static_cast(textObject))->sendEvent(&me); + } + + { + QGraphicsSceneMouseEvent me(QEvent::GraphicsSceneMouseRelease); + me.setPos(QPointF(textObject->x()/2, textObject->y()/2)); + me.setButton(Qt::LeftButton); + static_cast(static_cast(textObject))->sendEvent(&me); + } + + QCOMPARE(test.link, QLatin1String("http://qt.nokia.com")); + } +} + QTEST_MAIN(tst_qmlgraphicstext) #include "tst_qmlgraphicstext.moc" -- cgit v0.12 From 2ae8e6f13f5bffd639a279c7e4aeb6b4d49810a1 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 6 Nov 2009 15:08:33 +1000 Subject: Update animation docs. --- doc/src/declarative/animation.qdoc | 76 ++++++++++++++++++++++++++++------- src/declarative/util/qmlanimation.cpp | 18 ++++++--- 2 files changed, 75 insertions(+), 19 deletions(-) diff --git a/doc/src/declarative/animation.qdoc b/doc/src/declarative/animation.qdoc index ba45d81..1314493 100644 --- a/doc/src/declarative/animation.qdoc +++ b/doc/src/declarative/animation.qdoc @@ -81,6 +81,22 @@ Rectangle { \image propanim.gif +When you assign an animation as a value source, you do not need to specify \c property +or \c target; they are automatically selected for you. You do, however, need to specify \c to, and explicitly +start the animation (usually via the \c running property). + +\qml +Rectangle { + id: rect + width: 200; height: 200; + Rectangle { + color: "red" + width: 50; height: 50 + x: NumberAnimation { to: 50; running: true } + } +} +\endqml + A property animation can also be specified as a resource that is manipulated from script. \qml @@ -100,12 +116,16 @@ Image { } \endqml +As can be seen, when an animation is used like this (as opposed to as a value source) you will need +to explicitly set the \c target and \c property to animate. + Animations can be joined into a group using SequentialAnimation and ParallelAnimation. \target state-transitions \section1 Transitions -QML transitions describe animations to perform when \l{qmlstates}{state} changes occur. +QML transitions describe animations to perform when \l{qmlstates}{state} changes occur. A transition +can only be triggered by a state change. For example, a transition could describe how an item moves from its initial position to its new position: @@ -123,11 +143,11 @@ transitions: [ As you can see from the above example, transitions make use of the same basic animation classes introduced above. However, you generally use a different set of properties when working with transitions. In the example, -no target or property has been specified. Instead, we have specified matchProperties, which acts as a selector to -determine which property changes to animate; in this case, we will animate any x,y properties that have -changed on any objects. +no \c target or \c property has been specified. Instead, we have specified \c matchProperties, +which (along with \c matchTargets) acts as a selector to determine which property changes to animate; +in this case, we will animate any x,y properties that have changed on any objects. -QML transitions also selectors to determine which state changes a transition should apply to: +QML transitions also have selectors to determine which state changes a transition should apply to: \code Transition { @@ -137,7 +157,9 @@ Transition { } \endcode -Transitions can happen in parallel, in sequence, or in any combination of the two: +Transitions can happen in parallel, in sequence, or in any combination of the two. By default, the top-level +animations in a transition will happen in parallel. The following example shows a rather complex transition +making use of both sequential and parallel animations: \code Transition { @@ -145,13 +167,8 @@ Transition { to: "MyState" reversible: true SequentialAnimation { - ColorAnimation { - property: "color" - duration: 1000 - } - PauseAnimation { - duration: 1000 - } + ColorAnimation { duration: 1000 } + PauseAnimation { duration: 1000 } ParallelAnimation { NumberAnimation { duration: 1000 @@ -169,9 +186,37 @@ Transition { } \endcode +To insert an explicit animation into your transition, you can use \target and \property as normal. + +\code +Transition { + from: "*" + to: "MyState" + reversible: true + SequentialAnimation { + NumberAnimation { + duration: 1000 + easing: "easeOutBounce" + // animate myItem's x and y if they have changed in the state + matchTargets: myItem + matchProperties: "x,y" + } + NumberAnimation { + duration: 1000 + // animate myItem2's y to 200, regardless of what happens in the state + target: myItem2 + property: "y" + to: 200 + } + } +} +\endcode + \section1 Property Behaviors -A property behavior specifies a default animation to run whenever the property's value changes. +A property behavior specifies a default animation to run whenever the property's value changes, regardless +of what caused the change. Unlike Transition, Behavior doesn't provide a way to indicate that a Behavior +should only apply under certain circumstances. In the following snippet, we specify that we want the x position of redRect to be animated whenever it changes. The animation will last 300 milliseconds and use an InOutQuad easing curve. @@ -185,6 +230,9 @@ Rectangle { } \endqml +Like using an animation as a value source, when used in a Behavior and animation does not need to specify +a \c target or \c property. + To trigger this behavior, we could: \list \o Enter a state that changes x diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp index 7c5bc50..94cdadf 100644 --- a/src/declarative/util/qmlanimation.cpp +++ b/src/declarative/util/qmlanimation.cpp @@ -1507,6 +1507,8 @@ void QmlPropertyAnimationPrivate::convertVariant(QVariant &variant, int type) \code VariantAnimation { property: "size"; to: "20x20"; duration: 200 } \endcode + + \a qmlanimation.html */ QmlPropertyAnimation::QmlPropertyAnimation(QObject *parent) @@ -1795,16 +1797,20 @@ void QmlPropertyAnimation::setEasing(const QString &e) \qmlproperty Object PropertyAnimation::target This property holds an explicit target object to animate. - The exact effect of the \c target property depends on how the animation - is being used. Refer to the \l animation documentation for details. + target is used in conjunction with property to determine + what property should be animated. + + \sa property matchTargets */ /*! \qmlproperty string PropertyAnimation::property - This property holds an explicit property to animated. + This property holds an explicit property name to animate. - The exact effect of the \c property property depends on how the animation - is being used. Refer to the \l animation documentation for details. + property is used in conjunction with target to determine + what property should be animated. + + \sa target matchProperties */ /*! @@ -1833,6 +1839,8 @@ void QmlPropertyAnimation::setEasing(const QString &e) This property is typically used for an animation appearing as part of a Transition. By default, no property names will be matched. + + \sa matchTargets PropertyAction::matchTargets */ QString QmlPropertyAnimation::properties() const { -- cgit v0.12 From 3607c41b30bb93f62e1e85bc4f9ade145e1e8571 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 6 Nov 2009 15:08:45 +1000 Subject: Doc. --- doc/src/declarative/elements.qdoc | 3 --- src/declarative/graphicsitems/qmlgraphicsgridview.cpp | 8 ++++---- src/declarative/graphicsitems/qmlgraphicsitem.cpp | 11 +++++++++++ src/declarative/graphicsitems/qmlgraphicsmouseregion.cpp | 6 +++--- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/doc/src/declarative/elements.qdoc b/doc/src/declarative/elements.qdoc index 69535ce..81a6c96 100644 --- a/doc/src/declarative/elements.qdoc +++ b/doc/src/declarative/elements.qdoc @@ -187,11 +187,8 @@ The following table lists the QML elements provided by the Qt Declarative module \list \o \l Blur \o \l Colorize -\o \l Grayscale -\o \l Pixelize \o \l DropShadow \o \l Opacity -\o \l Bloom \o \l Particles \list \o \l ParticleMotionLinear diff --git a/src/declarative/graphicsitems/qmlgraphicsgridview.cpp b/src/declarative/graphicsitems/qmlgraphicsgridview.cpp index 7427266..f39f5c7 100644 --- a/src/declarative/graphicsitems/qmlgraphicsgridview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsgridview.cpp @@ -1154,7 +1154,7 @@ void QmlGraphicsGridView::keyPressEvent(QKeyEvent *event) } /*! - \qmlmethod GridView::moveCurrentIndexUp + \qmlmethod GridView::moveCurrentIndexUp() Move the currentIndex up one item in the view. The current index will wrap if keyNavigationWraps is true and it @@ -1177,7 +1177,7 @@ void QmlGraphicsGridView::moveCurrentIndexUp() } /*! - \qmlmethod GridView::moveCurrentIndexDown + \qmlmethod GridView::moveCurrentIndexDown() Move the currentIndex down one item in the view. The current index will wrap if keyNavigationWraps is true and it @@ -1200,7 +1200,7 @@ void QmlGraphicsGridView::moveCurrentIndexDown() } /*! - \qmlmethod GridView::moveCurrentIndexLeft + \qmlmethod GridView::moveCurrentIndexLeft() Move the currentIndex left one item in the view. The current index will wrap if keyNavigationWraps is true and it @@ -1223,7 +1223,7 @@ void QmlGraphicsGridView::moveCurrentIndexLeft() } /*! - \qmlmethod GridView::moveCurrentIndexRight + \qmlmethod GridView::moveCurrentIndexRight() Move the currentIndex right one item in the view. The current index will wrap if keyNavigationWraps is true and it diff --git a/src/declarative/graphicsitems/qmlgraphicsitem.cpp b/src/declarative/graphicsitems/qmlgraphicsitem.cpp index a46c2be..572aa98 100644 --- a/src/declarative/graphicsitems/qmlgraphicsitem.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsitem.cpp @@ -1908,6 +1908,17 @@ void QmlGraphicsItem::setClip(bool c) */ /*! + \qmlproperty bool Item::visible + + Whether the item is visible. By default this is true. + + \note visible is not linked to actual visibility; if you item + goes off screen, or the opacity changes to 0, etc this will + not affect the visible property. +*/ + + +/*! This function is called to handle this item's changes in geometry from \a oldGeometry to \a newGeometry. If the two geometries are the same, it doesn't do anything. diff --git a/src/declarative/graphicsitems/qmlgraphicsmouseregion.cpp b/src/declarative/graphicsitems/qmlgraphicsmouseregion.cpp index 196cdf2..22c2c0a 100644 --- a/src/declarative/graphicsitems/qmlgraphicsmouseregion.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsmouseregion.cpp @@ -146,19 +146,19 @@ void QmlGraphicsDrag::setYmax(qreal m) */ /*! - \qmlsignal MouseRegion::onEntered + \qmlsignal MouseRegion::onEntered() This handler is called when the mouse enters the mouse region. */ /*! - \qmlsignal MouseRegion::onExited + \qmlsignal MouseRegion::onExited() This handler is called when the mouse exists the mouse region. */ /*! - \qmlsignal MouseRegion::onPositionChanged(mouse) + \qmlsignal MouseRegion::onPositionChanged(MouseEvent mouse) This handler is called when the mouse position changes. -- cgit v0.12 From 3edd93eab2d3490c5991e1601fd7b53741b4ba1f Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 6 Nov 2009 15:14:28 +1000 Subject: Add missing file. --- .../qmlgraphicsitem/data/keynavigation.qml | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/auto/declarative/qmlgraphicsitem/data/keynavigation.qml diff --git a/tests/auto/declarative/qmlgraphicsitem/data/keynavigation.qml b/tests/auto/declarative/qmlgraphicsitem/data/keynavigation.qml new file mode 100644 index 0000000..9281a17 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicsitem/data/keynavigation.qml @@ -0,0 +1,39 @@ +import Qt 4.6 + +Grid { + columns: 2 + width: 100; height: 100 + Rectangle { + id: item1 + objectName: "item1" + focus: true + width: 50; height: 50 + color: focus ? "red" : "lightgray" + KeyNavigation.right: item2 + KeyNavigation.down: item3 + } + Rectangle { + id: item2 + objectName: "item2" + width: 50; height: 50 + color: focus ? "red" : "lightgray" + KeyNavigation.left: item1 + KeyNavigation.down: item4 + } + Rectangle { + id: item3 + objectName: "item3" + width: 50; height: 50 + color: focus ? "red" : "lightgray" + KeyNavigation.right: item4 + KeyNavigation.up: item1 + } + Rectangle { + id: item4 + objectName: "item4" + width: 50; height: 50 + color: focus ? "red" : "lightgray" + KeyNavigation.left: item3 + KeyNavigation.up: item2 + } +} -- cgit v0.12 From 3611858fe9c14abd52ff0df927d7bf6ec992fb95 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 6 Nov 2009 15:17:00 +1000 Subject: Robustify test --- tests/auto/declarative/qmlgraphicsitem/tst_qmlgraphicsitem.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/declarative/qmlgraphicsitem/tst_qmlgraphicsitem.cpp b/tests/auto/declarative/qmlgraphicsitem/tst_qmlgraphicsitem.cpp index b3b5374..b4b3eaf 100644 --- a/tests/auto/declarative/qmlgraphicsitem/tst_qmlgraphicsitem.cpp +++ b/tests/auto/declarative/qmlgraphicsitem/tst_qmlgraphicsitem.cpp @@ -213,6 +213,9 @@ void tst_QmlGraphicsItem::keyNavigation() template T *tst_QmlGraphicsItem::findItem(QmlGraphicsItem *parent, const QString &objectName) { + if (!parent) + return 0; + const QMetaObject &mo = T::staticMetaObject; //qDebug() << parent->QGraphicsObject::children().count() << "children"; for (int i = 0; i < parent->QGraphicsObject::children().count(); ++i) { -- cgit v0.12 From 8d8315df292482d75148a435b9e2bcc4636c57a3 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 6 Nov 2009 15:33:07 +1000 Subject: move examples/follow.qml to visuals/qmlspringfollow.qml --- examples/declarative/follow/click.wav | Bin 3056 -> 0 bytes examples/declarative/follow/follow.qml | 73 - examples/declarative/follow/paddle.wav | Bin 5320 -> 0 bytes examples/declarative/follow/tvtennis.qml | 74 - examples/declarative/tvtennis/click.wav | Bin 0 -> 3056 bytes examples/declarative/tvtennis/paddle.wav | Bin 0 -> 5320 bytes examples/declarative/tvtennis/tvtennis.qml | 74 + .../visual/qmlspringfollow/data-MAC/follow.0.png | Bin 0 -> 2778 bytes .../visual/qmlspringfollow/data-MAC/follow.1.png | Bin 0 -> 2778 bytes .../visual/qmlspringfollow/data-MAC/follow.2.png | Bin 0 -> 2767 bytes .../visual/qmlspringfollow/data-MAC/follow.3.png | Bin 0 -> 2784 bytes .../visual/qmlspringfollow/data-MAC/follow.4.png | Bin 0 -> 2786 bytes .../visual/qmlspringfollow/data-MAC/follow.5.png | Bin 0 -> 2785 bytes .../visual/qmlspringfollow/data-MAC/follow.qml | 1691 ++++++++++++++++++++ .../visual/qmlspringfollow/data/follow.0.png | Bin 0 -> 2776 bytes .../visual/qmlspringfollow/data/follow.1.png | Bin 0 -> 2788 bytes .../visual/qmlspringfollow/data/follow.2.png | Bin 0 -> 2767 bytes .../visual/qmlspringfollow/data/follow.3.png | Bin 0 -> 2784 bytes .../visual/qmlspringfollow/data/follow.4.png | Bin 0 -> 2786 bytes .../visual/qmlspringfollow/data/follow.5.png | Bin 0 -> 2785 bytes .../visual/qmlspringfollow/data/follow.qml | 1691 ++++++++++++++++++++ .../declarative/visual/qmlspringfollow/follow.qml | 73 + 22 files changed, 3529 insertions(+), 147 deletions(-) delete mode 100644 examples/declarative/follow/click.wav delete mode 100644 examples/declarative/follow/follow.qml delete mode 100644 examples/declarative/follow/paddle.wav delete mode 100644 examples/declarative/follow/tvtennis.qml create mode 100644 examples/declarative/tvtennis/click.wav create mode 100644 examples/declarative/tvtennis/paddle.wav create mode 100644 examples/declarative/tvtennis/tvtennis.qml create mode 100644 tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.0.png create mode 100644 tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.1.png create mode 100644 tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.2.png create mode 100644 tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.3.png create mode 100644 tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.4.png create mode 100644 tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.5.png create mode 100644 tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.qml create mode 100644 tests/auto/declarative/visual/qmlspringfollow/data/follow.0.png create mode 100644 tests/auto/declarative/visual/qmlspringfollow/data/follow.1.png create mode 100644 tests/auto/declarative/visual/qmlspringfollow/data/follow.2.png create mode 100644 tests/auto/declarative/visual/qmlspringfollow/data/follow.3.png create mode 100644 tests/auto/declarative/visual/qmlspringfollow/data/follow.4.png create mode 100644 tests/auto/declarative/visual/qmlspringfollow/data/follow.5.png create mode 100644 tests/auto/declarative/visual/qmlspringfollow/data/follow.qml create mode 100644 tests/auto/declarative/visual/qmlspringfollow/follow.qml diff --git a/examples/declarative/follow/click.wav b/examples/declarative/follow/click.wav deleted file mode 100644 index 26c46f8..0000000 Binary files a/examples/declarative/follow/click.wav and /dev/null differ diff --git a/examples/declarative/follow/follow.qml b/examples/declarative/follow/follow.qml deleted file mode 100644 index 3e164f9..0000000 --- a/examples/declarative/follow/follow.qml +++ /dev/null @@ -1,73 +0,0 @@ -import Qt 4.6 - -Rectangle { - color: "#ffffff" - width: 320; height: 240 - Rectangle { - id: rect - color: "#00ff00" - y: 200; width: 60; height: 20 - y: SequentialAnimation { - running: true; repeat: true - NumberAnimation { - to: 20; duration: 500 - easing: "easeInOutQuad" - } - NumberAnimation { - to: 200; duration: 2000 - easing: "easeOutBounce" - } - PauseAnimation { duration: 1000 } - } - } - - // Velocity - Rectangle { - color: "#ff0000" - x: rect.width; width: rect.width; height: 20 - y: 200 - y: SpringFollow { source: rect.y; velocity: 200 } - } - Text { x: rect.width; y: 220; text: "Velocity" } - - // Spring - Rectangle { - color: "#ff0000" - x: rect.width * 2; width: rect.width/2; height: 20 - y: 200 - y: SpringFollow { source: rect.y; spring: 1.0; damping: 0.2 } - } - Rectangle { - color: "#880000" - x: rect.width * 2.5; width: rect.width/2; height: 20 - y: 200 - y: SpringFollow { source: rect.y; spring: 1.0; damping: 0.2; mass: 3.0 } // "heavier" object - } - Text { x: rect.width * 2; y: 220; text: "Spring" } - - // Follow mouse - MouseRegion { - id: mouseRegion - anchors.fill: parent - Rectangle { - id: ball - width: 20; height: 20 - radius: 10 - color: "#0000ff" - x: SpringFollow { id: f1; source: mouseRegion.mouseX-10; spring: 1.0; damping: 0.05; epsilon: 0.25 } - y: SpringFollow { id: f2; source: mouseRegion.mouseY-10; spring: 1.0; damping: 0.05; epsilon: 0.25 } - states: [ - State { - name: "following" - when: !f1.inSync || !f2.inSync - PropertyChanges { target: ball; color: "#ff0000" } - } - ] - transitions: [ - Transition { - ColorAnimation { duration: 200 } - } - ] - } - } -} diff --git a/examples/declarative/follow/paddle.wav b/examples/declarative/follow/paddle.wav deleted file mode 100644 index 604e0e5..0000000 Binary files a/examples/declarative/follow/paddle.wav and /dev/null differ diff --git a/examples/declarative/follow/tvtennis.qml b/examples/declarative/follow/tvtennis.qml deleted file mode 100644 index d39e913..0000000 --- a/examples/declarative/follow/tvtennis.qml +++ /dev/null @@ -1,74 +0,0 @@ -import Qt 4.6 - -Rectangle { - id: page - width: 640; height: 480 - color: "Black" - - // Make a ball to bounce - Rectangle { - // Add a property for the target y coordinate - property var targetY : page.height - 10 - property var direction : "right" - - id: ball - color: "Lime" - x: 20; width: 20; height: 20; z: 1 - - // Move the ball to the right and back to the left repeatedly - x: SequentialAnimation { - running: true; repeat: true - NumberAnimation { to: page.width - 40; duration: 2000 } - ScriptAction { script: Qt.playSound('paddle.wav') } - PropertyAction { target: ball; property: "direction"; value: "left" } - NumberAnimation { to: 20; duration: 2000 } - ScriptAction { script: Qt.playSound('paddle.wav') } - PropertyAction { target: ball; property: "direction"; value: "right" } - } - - // Make y follow the target y coordinate, with a velocity of 200 - y: SpringFollow { source: ball.targetY; velocity: 200 } - - // Detect the ball hitting the top or bottom of the view and bounce it - onYChanged: { - if (y <= 0) { - Qt.playSound('click.wav'); - targetY = page.height - 20; - } else if (y >= page.height - 20) { - Qt.playSound('click.wav'); - targetY = 0; - } - } - } - - // Place bats to the left and right of the view, following the y - // coordinates of the ball. - Rectangle { - id: leftBat - color: "Lime" - x: 2; width: 20; height: 90 - y: SpringFollow { - source: ball.y - 45; velocity: 300 - enabled: ball.direction == 'left' - } - } - Rectangle { - id: rightBat - color: "Lime" - x: page.width - 22; width: 20; height: 90 - y: SpringFollow { - source: ball.y-45; velocity: 300 - enabled: ball.direction == 'right' - } - } - - // The rest, to make it look realistic, if neither ever scores... - Rectangle { color: "Lime"; x: page.width/2-80; y: 0; width: 40; height: 60 } - Rectangle { color: "Black"; x: page.width/2-70; y: 10; width: 20; height: 40 } - Rectangle { color: "Lime"; x: page.width/2+40; y: 0; width: 40; height: 60 } - Rectangle { color: "Black"; x: page.width/2+50; y: 10; width: 20; height: 40 } - Repeater { - model: page.height / 20 - Rectangle { color: "Lime"; x: page.width/2-5; y: index * 20; width: 10; height: 10 } - } -} diff --git a/examples/declarative/tvtennis/click.wav b/examples/declarative/tvtennis/click.wav new file mode 100644 index 0000000..26c46f8 Binary files /dev/null and b/examples/declarative/tvtennis/click.wav differ diff --git a/examples/declarative/tvtennis/paddle.wav b/examples/declarative/tvtennis/paddle.wav new file mode 100644 index 0000000..604e0e5 Binary files /dev/null and b/examples/declarative/tvtennis/paddle.wav differ diff --git a/examples/declarative/tvtennis/tvtennis.qml b/examples/declarative/tvtennis/tvtennis.qml new file mode 100644 index 0000000..d39e913 --- /dev/null +++ b/examples/declarative/tvtennis/tvtennis.qml @@ -0,0 +1,74 @@ +import Qt 4.6 + +Rectangle { + id: page + width: 640; height: 480 + color: "Black" + + // Make a ball to bounce + Rectangle { + // Add a property for the target y coordinate + property var targetY : page.height - 10 + property var direction : "right" + + id: ball + color: "Lime" + x: 20; width: 20; height: 20; z: 1 + + // Move the ball to the right and back to the left repeatedly + x: SequentialAnimation { + running: true; repeat: true + NumberAnimation { to: page.width - 40; duration: 2000 } + ScriptAction { script: Qt.playSound('paddle.wav') } + PropertyAction { target: ball; property: "direction"; value: "left" } + NumberAnimation { to: 20; duration: 2000 } + ScriptAction { script: Qt.playSound('paddle.wav') } + PropertyAction { target: ball; property: "direction"; value: "right" } + } + + // Make y follow the target y coordinate, with a velocity of 200 + y: SpringFollow { source: ball.targetY; velocity: 200 } + + // Detect the ball hitting the top or bottom of the view and bounce it + onYChanged: { + if (y <= 0) { + Qt.playSound('click.wav'); + targetY = page.height - 20; + } else if (y >= page.height - 20) { + Qt.playSound('click.wav'); + targetY = 0; + } + } + } + + // Place bats to the left and right of the view, following the y + // coordinates of the ball. + Rectangle { + id: leftBat + color: "Lime" + x: 2; width: 20; height: 90 + y: SpringFollow { + source: ball.y - 45; velocity: 300 + enabled: ball.direction == 'left' + } + } + Rectangle { + id: rightBat + color: "Lime" + x: page.width - 22; width: 20; height: 90 + y: SpringFollow { + source: ball.y-45; velocity: 300 + enabled: ball.direction == 'right' + } + } + + // The rest, to make it look realistic, if neither ever scores... + Rectangle { color: "Lime"; x: page.width/2-80; y: 0; width: 40; height: 60 } + Rectangle { color: "Black"; x: page.width/2-70; y: 10; width: 20; height: 40 } + Rectangle { color: "Lime"; x: page.width/2+40; y: 0; width: 40; height: 60 } + Rectangle { color: "Black"; x: page.width/2+50; y: 10; width: 20; height: 40 } + Repeater { + model: page.height / 20 + Rectangle { color: "Lime"; x: page.width/2-5; y: index * 20; width: 10; height: 10 } + } +} diff --git a/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.0.png b/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.0.png new file mode 100644 index 0000000..d753c97 Binary files /dev/null and b/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.0.png differ diff --git a/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.1.png b/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.1.png new file mode 100644 index 0000000..98fc111 Binary files /dev/null and b/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.1.png differ diff --git a/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.2.png b/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.2.png new file mode 100644 index 0000000..b1d109e Binary files /dev/null and b/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.2.png differ diff --git a/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.3.png b/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.3.png new file mode 100644 index 0000000..595d92e Binary files /dev/null and b/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.3.png differ diff --git a/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.4.png b/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.4.png new file mode 100644 index 0000000..93e1536 Binary files /dev/null and b/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.4.png differ diff --git a/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.5.png b/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.5.png new file mode 100644 index 0000000..b27cc9f Binary files /dev/null and b/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.5.png differ diff --git a/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.qml b/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.qml new file mode 100644 index 0000000..3c0dad8 --- /dev/null +++ b/tests/auto/declarative/visual/qmlspringfollow/data-MAC/follow.qml @@ -0,0 +1,1691 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "ea677d128f47343d81a081c438aa2f6c" + } + Frame { + msec: 32 + hash: "ea677d128f47343d81a081c438aa2f6c" + } + Frame { + msec: 48 + hash: "403e130b7cf0a41d8348a227293d98d1" + } + Frame { + msec: 64 + hash: "d2250ca93235b6a087b5e582f7e941d6" + } + Frame { + msec: 80 + hash: "3e95bdb5546de8ed7bb33de704d2890e" + } + Frame { + msec: 96 + hash: "438612a44780d6587f99a44c943eb60f" + } + Frame { + msec: 112 + hash: "057d47c73edcd149c0b1e6274f98deae" + } + Frame { + msec: 128 + hash: "c15ca80f3efb55d067e38bd92f360b14" + } + Frame { + msec: 144 + hash: "9f1b15db2eb172d97eef4f7c78d11e4f" + } + Frame { + msec: 160 + hash: "a81514d058846ae1c60575534ad47b21" + } + Frame { + msec: 176 + hash: "48d0f3971ed369d6a82b06ca9febc435" + } + Frame { + msec: 192 + hash: "8277eb954d0ca9293f3d05b979db3fe3" + } + Frame { + msec: 208 + hash: "edb64bdcb13f67813fcd3cbedb608cf3" + } + Frame { + msec: 224 + hash: "3a51a89e15b0709fcf6591ce4096c52d" + } + Frame { + msec: 240 + hash: "ffe486e038988cea3ff2ec6b2fcc516f" + } + Frame { + msec: 256 + hash: "1267aa3970ac861827e84c5da93523c7" + } + Frame { + msec: 272 + hash: "c5c0d501f102876a0b06f6d100f19a77" + } + Frame { + msec: 288 + hash: "b78207cb082771fc608a084c69c38399" + } + Frame { + msec: 304 + hash: "86cc014a4601ddf84478c8a0f44de7ed" + } + Frame { + msec: 320 + hash: "fbe34a8c894aa1c1ddb26171069c92f6" + } + Frame { + msec: 336 + hash: "c916a45687baa73e1023cdb03be42669" + } + Frame { + msec: 352 + hash: "1157f5c96e49fdc0afeb126453e19260" + } + Frame { + msec: 368 + hash: "c7528a6f57f4241dc2f5867436c44fd9" + } + Frame { + msec: 384 + hash: "054ac7e1cd4448fdd12f0175b3bdff90" + } + Frame { + msec: 400 + hash: "4ccf29d6ce92332683f6b49b89357579" + } + Frame { + msec: 416 + hash: "c46e42accdeba8b32bd4d6d43894c61c" + } + Frame { + msec: 432 + hash: "2ab2e8d8a3d58ac1c17932b9485cbc67" + } + Frame { + msec: 448 + hash: "347092c3876535e41e8368be2cd19aed" + } + Frame { + msec: 464 + hash: "311b1c44074b0e55a990e971f877c898" + } + Frame { + msec: 480 + hash: "198908af8468b4500fac85262eb82596" + } + Frame { + msec: 496 + hash: "202c33e301ad850a888223d3abdd06e6" + } + Frame { + msec: 512 + hash: "f3e0ce1386571c9e6be2656d402b4960" + } + Frame { + msec: 528 + hash: "b9c900bfedc7159ee2c0b0af6e66fc92" + } + Frame { + msec: 544 + hash: "f978850a8977c3c32e4ae9a43b7a3a8b" + } + Frame { + msec: 560 + hash: "637e5d9580d783864134b403e49cb47b" + } + Frame { + msec: 576 + hash: "8082c1e1eccb8588ebdbb739e31bda49" + } + Frame { + msec: 592 + hash: "c513f544df3d94223bb4fbf06befa2d7" + } + Frame { + msec: 608 + hash: "e7f589e64d3cd054349161971d4ef42e" + } + Frame { + msec: 624 + hash: "bb375339d4155f13c353bc90eb9b9cbf" + } + Frame { + msec: 640 + hash: "924368c60be4be048a19af942a8e402c" + } + Frame { + msec: 656 + hash: "c0142a6872bf5a445302952aaa6daa0d" + } + Frame { + msec: 672 + hash: "fab2a7e79b235f6432cd4c48740e3020" + } + Frame { + msec: 688 + hash: "fda751a9b20100007c33669bdb6f7f23" + } + Frame { + msec: 704 + hash: "d97d2d108dba9aefd36b0f6b2f160f23" + } + Frame { + msec: 720 + hash: "bf3683eb4308904de61fb3fb59802e37" + } + Frame { + msec: 736 + hash: "908f34ec52d59027f65c673c17077ca6" + } + Frame { + msec: 752 + hash: "19ae0ec52c077eff92451c9924be2c23" + } + Frame { + msec: 768 + hash: "898277481841e4c4f8992fd755784e5a" + } + Frame { + msec: 784 + hash: "9613da2dcdf470561d20a982777f50f6" + } + Frame { + msec: 800 + hash: "fdfc54fa3657be02c2ee65d787e8c7a5" + } + Frame { + msec: 816 + hash: "1d3b6cff6e62890db90213ebab88dca3" + } + Frame { + msec: 832 + hash: "713e9c0f768f6cc8cc6c78c72b41b47c" + } + Frame { + msec: 848 + hash: "9068d912a8d3e6e0b5b458c12ddad126" + } + Frame { + msec: 864 + hash: "e85192393e4911dbaf9c734d2e386bbf" + } + Frame { + msec: 880 + hash: "4f2374e6c8763e1e5b3b7cebdf5b8ebc" + } + Frame { + msec: 896 + hash: "986a32decb18065294356fb85953891e" + } + Frame { + msec: 912 + hash: "faa36d337589c59761814e3065874aa3" + } + Frame { + msec: 928 + hash: "9c823d92cd71932f0ad1d247fdd8c66e" + } + Frame { + msec: 944 + hash: "3ebcf592e427bcbc8a92dc1bee903845" + } + Frame { + msec: 960 + image: "follow.0.png" + } + Frame { + msec: 976 + hash: "b1a205f75f5ab7b69f4d9bd0582d7896" + } + Frame { + msec: 992 + hash: "0cf4ce09fd895a174271e3cb37c72de6" + } + Frame { + msec: 1008 + hash: "e6487b45fc20afc4c1a24c8669919611" + } + Frame { + msec: 1024 + hash: "fe2a4eb899611495fa5ad88b7c5f4c7e" + } + Frame { + msec: 1040 + hash: "07b880170d1ba41e4d1a1277e8184089" + } + Frame { + msec: 1056 + hash: "27afbfb4b961570f8844e05595b11d4f" + } + Frame { + msec: 1072 + hash: "1b6cfd4c2c2c007837cfb9746f44ec20" + } + Frame { + msec: 1088 + hash: "8f82c7f1cb2ded469a7cb3a0827e919e" + } + Frame { + msec: 1104 + hash: "d8581781550c21bc0fa6b75fc6de3f57" + } + Frame { + msec: 1120 + hash: "104a6c18b4a16732de9dba9bfb92eb5a" + } + Frame { + msec: 1136 + hash: "ebbdeb2de19644aeb41c03f852d1fc15" + } + Frame { + msec: 1152 + hash: "a8cc1328eb65fed5ca75d79c6e628ec1" + } + Frame { + msec: 1168 + hash: "a1192d371ffd3e9f8a23abca6a8b4d98" + } + Frame { + msec: 1184 + hash: "06b7749eace5d149bd35f668c4df9811" + } + Frame { + msec: 1200 + hash: "de1f7eb2c3224754a75d0a953ee24a76" + } + Frame { + msec: 1216 + hash: "1bc3c2cf2058ab5f8d491ad35605c6d7" + } + Frame { + msec: 1232 + hash: "4c2b7e3f7cad28a424f3fdb574d732b6" + } + Frame { + msec: 1248 + hash: "ebb9c07b34f4acd9ee2652324c81e5d1" + } + Frame { + msec: 1264 + hash: "fef63629bdae6f1d744633916c6b0852" + } + Frame { + msec: 1280 + hash: "aacb966d803ed6986db40e51d2a63dff" + } + Frame { + msec: 1296 + hash: "796bb7137a909d524b1cec022c1be6ea" + } + Frame { + msec: 1312 + hash: "d88526b472d9ba58b93f868a150154f3" + } + Frame { + msec: 1328 + hash: "d6a24e9f446565c0d0d0bf25db80e88e" + } + Frame { + msec: 1344 + hash: "08902af1f5ba7566f2fef79200ac0362" + } + Frame { + msec: 1360 + hash: "b655edf8bd25f5e05fcb1cce64aaad89" + } + Frame { + msec: 1376 + hash: "5f526a0e92c1846ca7099c5640208dd0" + } + Frame { + msec: 1392 + hash: "c354f31e4e75d6ccf4c284113c54377b" + } + Frame { + msec: 1408 + hash: "2f8143ead16b7c65c8f43469754c09dd" + } + Frame { + msec: 1424 + hash: "b486f4056d300e22860fa995b6f09f92" + } + Frame { + msec: 1440 + hash: "4a24f651b8ad911b04426a07b4663a3d" + } + Frame { + msec: 1456 + hash: "aad02861a66647d27ea3746d9b455e91" + } + Frame { + msec: 1472 + hash: "ce4225df7a187919c91cc2dd950e11f0" + } + Frame { + msec: 1488 + hash: "5479a97041b64406883100567df4b9b7" + } + Frame { + msec: 1504 + hash: "76e67f9c5b552f1ff47c3c7b23eb1b76" + } + Frame { + msec: 1520 + hash: "8c3e1d2fd58eaf2a8da16bb0349b1e5e" + } + Frame { + msec: 1536 + hash: "4642a396f4a4bb3b97845782e1d1ce93" + } + Frame { + msec: 1552 + hash: "4d3e8c9ea7c8c1407db564a3a6e430ff" + } + Frame { + msec: 1568 + hash: "e041300f1d2956f35baebed6c7c9c750" + } + Frame { + msec: 1584 + hash: "b20e241906a2b9e38b03c0991d21160e" + } + Frame { + msec: 1600 + hash: "cb5c32ad57d1931a69c20328f8f2d060" + } + Frame { + msec: 1616 + hash: "021ba4fc38e1652afeab73047e126a17" + } + Frame { + msec: 1632 + hash: "d27728f36491ba432e3655850402ee6b" + } + Frame { + msec: 1648 + hash: "20a87f4d9afd2039e44c2b5b539d0298" + } + Frame { + msec: 1664 + hash: "46c4016acfe390495307d3d64b93902d" + } + Frame { + msec: 1680 + hash: "a356b011266d901d7148e662393e5f72" + } + Frame { + msec: 1696 + hash: "43b4a8e0d73ab2c6be5db2b48c3e7013" + } + Frame { + msec: 1712 + hash: "b7a5bfbecabbf0f20b0e2c0959051b66" + } + Frame { + msec: 1728 + hash: "8eff269aeb6f3bc540dd8cf6491d53b8" + } + Frame { + msec: 1744 + hash: "9c524c30ef7cd6dbfb911ec1c75d0e32" + } + Frame { + msec: 1760 + hash: "a064e420983d68f2f2baca9ea9119236" + } + Frame { + msec: 1776 + hash: "99739628a95e72704e503ed6d1dea712" + } + Frame { + msec: 1792 + hash: "1f0f916ed7382f10c23eb63052377fe1" + } + Frame { + msec: 1808 + hash: "d99f731943018a50e8738bf638ca3b31" + } + Frame { + msec: 1824 + hash: "10182c1206e73d5a59b377f5d6061bef" + } + Frame { + msec: 1840 + hash: "a272abb9905b17e4bdd717db87514c11" + } + Frame { + msec: 1856 + hash: "81ffae766d85d829d7e16071ac44fcc1" + } + Frame { + msec: 1872 + hash: "4e2402d3eafa149d0b8ad9238c3b985d" + } + Frame { + msec: 1888 + hash: "70ad42fd0824ce00181514bac4b6b0f4" + } + Frame { + msec: 1904 + hash: "6d1ff46bd1606662fec47f14152bfd4a" + } + Frame { + msec: 1920 + image: "follow.1.png" + } + Frame { + msec: 1936 + hash: "9a37d437b9476375b3a34ac293a0789a" + } + Frame { + msec: 1952 + hash: "0a5fa0cd8bc22d274b00d32383ffc486" + } + Frame { + msec: 1968 + hash: "1a284b36906f0adcef2ed66c0cfb5a9d" + } + Frame { + msec: 1984 + hash: "049ca635405f3f88f85629f559919569" + } + Frame { + msec: 2000 + hash: "d8d3d7b55f2a04dbf187d2296e8da84a" + } + Frame { + msec: 2016 + hash: "57a04352e211d888d8182449b8f970e0" + } + Frame { + msec: 2032 + hash: "48229fc62e5ea19c54f961d3b0bb5b26" + } + Frame { + msec: 2048 + hash: "8c5d645cdbbb343789fc6ac27482b76e" + } + Frame { + msec: 2064 + hash: "3c4d50a07778ae5105f2e7514bff37ca" + } + Frame { + msec: 2080 + hash: "ce97d094ede43b3e74e81fa63e04dad7" + } + Frame { + msec: 2096 + hash: "2b2e4e9681bbc672b51148c10b183ec8" + } + Frame { + msec: 2112 + hash: "0421ac4f53c050bfffb2c8de16aafd46" + } + Frame { + msec: 2128 + hash: "953bdaacefe42a841bf1cdd7da3b442a" + } + Frame { + msec: 2144 + hash: "7209f7d812af5bdbca4b15f303cb5ff7" + } + Frame { + msec: 2160 + hash: "3f64635e9c43b8b6a402c5d6fe26e648" + } + Frame { + msec: 2176 + hash: "92926b4cf66b15cd0ddb468f2bd8bd62" + } + Frame { + msec: 2192 + hash: "ee0810fe7509d2d61d9306908816bba4" + } + Frame { + msec: 2208 + hash: "55249aae2bb6db6c363ecb4b89f56270" + } + Frame { + msec: 2224 + hash: "73ea66c3c61e8105ac61d26c8cfdbba3" + } + Frame { + msec: 2240 + hash: "f75b56ced71167a1bc1800b0d2f0f249" + } + Frame { + msec: 2256 + hash: "e0d09e7a8007bfbc1efd4bd89f49847a" + } + Frame { + msec: 2272 + hash: "159e98e8340375c6700015288660cbf8" + } + Frame { + msec: 2288 + hash: "b7aa76fced5c78eb8e55ce9f36d081e2" + } + Frame { + msec: 2304 + hash: "ac87e65a58914c1984b2dc95cf6de76d" + } + Frame { + msec: 2320 + hash: "7a0131b0a9ec395a2286438625881bee" + } + Frame { + msec: 2336 + hash: "84da8fd2b435b3ac9bad3350cd3a9ec0" + } + Frame { + msec: 2352 + hash: "1ed376000e60129b4bcf06ea73cb5819" + } + Frame { + msec: 2368 + hash: "8c713e210143ab5f19bdddd918f86ef3" + } + Frame { + msec: 2384 + hash: "269b595c5691747b56be58d5b92ae497" + } + Frame { + msec: 2400 + hash: "486d80316c88da4adc736df72fc86f45" + } + Frame { + msec: 2416 + hash: "b67cc78a3bfcd026264cfb9b7146c4d5" + } + Frame { + msec: 2432 + hash: "9d2cdecf3e9f067e68b81b202c8f62b2" + } + Frame { + msec: 2448 + hash: "02748271316f8382f4788322fda807c1" + } + Frame { + msec: 2464 + hash: "669986c581c162b8d3160336b92b2479" + } + Frame { + msec: 2480 + hash: "5dc604aaa95f45eba0dfc7aa3a73bca4" + } + Frame { + msec: 2496 + hash: "2199d6e809fc1e1879861fbbd63974e8" + } + Frame { + msec: 2512 + hash: "335a5561620f779a4fd0c1f33da2fc05" + } + Frame { + msec: 2528 + hash: "3e312b8de56c902ca20aba259c8559b2" + } + Frame { + msec: 2544 + hash: "37634addfe0cb2efdd9d6a1a134fae1e" + } + Frame { + msec: 2560 + hash: "a3cdb1d331845e268e393dd493a71613" + } + Frame { + msec: 2576 + hash: "ccfb90a921e74f4e172ea1fba8c38eb5" + } + Frame { + msec: 2592 + hash: "370f60a35849b7a8221f9474cbdaa201" + } + Frame { + msec: 2608 + hash: "e1b8d1d7298a3d3ade82493fb6f99909" + } + Frame { + msec: 2624 + hash: "e1b8d1d7298a3d3ade82493fb6f99909" + } + Frame { + msec: 2640 + hash: "74ecfaced66f630d1863c04000fa7f01" + } + Frame { + msec: 2656 + hash: "74ecfaced66f630d1863c04000fa7f01" + } + Frame { + msec: 2672 + hash: "c803b3258d0e1d8e6c1292ea2a00f76b" + } + Frame { + msec: 2688 + hash: "c803b3258d0e1d8e6c1292ea2a00f76b" + } + Frame { + msec: 2704 + hash: "c803b3258d0e1d8e6c1292ea2a00f76b" + } + Frame { + msec: 2720 + hash: "9f3f4fe1be7bd4511a0408fd5ab1b11f" + } + Frame { + msec: 2736 + hash: "9f3f4fe1be7bd4511a0408fd5ab1b11f" + } + Frame { + msec: 2752 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 2768 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 2784 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 2800 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 2816 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 2832 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 2848 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 2864 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 2880 + image: "follow.2.png" + } + Frame { + msec: 2896 + hash: "e009f65ae035fb8a9c27a1d57f10c35f" + } + Frame { + msec: 2912 + hash: "e009f65ae035fb8a9c27a1d57f10c35f" + } + Frame { + msec: 2928 + hash: "e009f65ae035fb8a9c27a1d57f10c35f" + } + Frame { + msec: 2944 + hash: "e009f65ae035fb8a9c27a1d57f10c35f" + } + Frame { + msec: 2960 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 2976 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 2992 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3008 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3024 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3040 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3056 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3072 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3088 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3104 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3120 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3136 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3152 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3168 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3184 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3200 + hash: "20dd4407adca55737dd4231405c38cff" + } + Frame { + msec: 3216 + hash: "20dd4407adca55737dd4231405c38cff" + } + Frame { + msec: 3232 + hash: "20dd4407adca55737dd4231405c38cff" + } + Frame { + msec: 3248 + hash: "20dd4407adca55737dd4231405c38cff" + } + Frame { + msec: 3264 + hash: "20dd4407adca55737dd4231405c38cff" + } + Frame { + msec: 3280 + hash: "20dd4407adca55737dd4231405c38cff" + } + Frame { + msec: 3296 + hash: "20dd4407adca55737dd4231405c38cff" + } + Frame { + msec: 3312 + hash: "20dd4407adca55737dd4231405c38cff" + } + Frame { + msec: 3328 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 3344 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3360 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3376 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3392 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3408 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3424 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3440 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3456 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3472 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3488 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3504 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3520 + hash: "9f3f4fe1be7bd4511a0408fd5ab1b11f" + } + Frame { + msec: 3536 + hash: "9f3f4fe1be7bd4511a0408fd5ab1b11f" + } + Frame { + msec: 3552 + hash: "60b86cce6d76291148c7c49a5eabcf55" + } + Frame { + msec: 3568 + hash: "b0dadf051b5b328f56fab390a2c33052" + } + Frame { + msec: 3584 + hash: "b6b75a9723b46aa072bf7c779dc84e64" + } + Frame { + msec: 3600 + hash: "ef4e8b36b5afc762e1f8f714eee61240" + } + Frame { + msec: 3616 + hash: "a322a2446fd3506c243766233ec9303e" + } + Frame { + msec: 3632 + hash: "5723527da987b29f74502e5abd25a5f7" + } + Frame { + msec: 3648 + hash: "d9f98fa248099936c6307457c935326f" + } + Frame { + msec: 3664 + hash: "54224ce16b717d0accb9cca7dc5e94d3" + } + Frame { + msec: 3680 + hash: "cb036f8c7e3c464d0210fca8b21b2d5f" + } + Frame { + msec: 3696 + hash: "729ff15f4b129e1bd7a522007c96d49b" + } + Frame { + msec: 3712 + hash: "6c3791f76fbed468ce6e23938d321874" + } + Frame { + msec: 3728 + hash: "970eebc8fa4fd8d92db49450ed3474a7" + } + Frame { + msec: 3744 + hash: "4c97641854bb6997fc5106d7981e4ac9" + } + Frame { + msec: 3760 + hash: "adb4c29247d0bf785be36ccdf74f4293" + } + Frame { + msec: 3776 + hash: "5133846ed6886846426495aba011ab6f" + } + Frame { + msec: 3792 + hash: "010771e4dea5c93de852bead35fc6a1e" + } + Frame { + msec: 3808 + hash: "6115a50835cbc196ae322ad2727d1b68" + } + Frame { + msec: 3824 + hash: "4e37fde35f4f577c3b62881fa526e369" + } + Frame { + msec: 3840 + image: "follow.3.png" + } + Frame { + msec: 3856 + hash: "1ea7000fd392a0799775b6783ffe332c" + } + Frame { + msec: 3872 + hash: "40e69b98954b40ce8dc78d60eac882d7" + } + Frame { + msec: 3888 + hash: "690b93596e7fb7c1f7de4ca81b96ce48" + } + Frame { + msec: 3904 + hash: "6e8910061829e1111227a9854e18e742" + } + Frame { + msec: 3920 + hash: "f6f60ef03e3f2829510c325effde9f39" + } + Frame { + msec: 3936 + hash: "6c3d2d3903cd20969f8f2994f6a22592" + } + Frame { + msec: 3952 + hash: "10febc71c9120a591510e123955424c1" + } + Frame { + msec: 3968 + hash: "c06b52a3814791a56fc2cefa1544a693" + } + Frame { + msec: 3984 + hash: "ca3a6e577490b5e88cf0c3d63bd69b76" + } + Frame { + msec: 4000 + hash: "a4ebd4f687d38bd803aa61fc247e88e9" + } + Frame { + msec: 4016 + hash: "099b8d7fea937bba6092a5c8ad1cc395" + } + Frame { + msec: 4032 + hash: "c04384eb7d5c172a529d682ae7e916bf" + } + Frame { + msec: 4048 + hash: "d0131c92bd3a2a7fa8cd83e3818370ed" + } + Frame { + msec: 4064 + hash: "62e721f0344142fb7742675f644748f8" + } + Frame { + msec: 4080 + hash: "5bddfcb4cb01efa0dc8603f3c4f4f553" + } + Frame { + msec: 4096 + hash: "d31e44ad6cdfbd4076c66d41bb1d957e" + } + Frame { + msec: 4112 + hash: "35126d01091d50a41dd073d2a5ae974a" + } + Frame { + msec: 4128 + hash: "2c876aaf36e4d2a8d94bf3c3f4b934eb" + } + Frame { + msec: 4144 + hash: "f75683d97c9d1f33a918c68f4651f31b" + } + Frame { + msec: 4160 + hash: "f372de89a29d19b5c234f39a8ce85ed2" + } + Frame { + msec: 4176 + hash: "fe2cd973de16bf92c552829d89332048" + } + Frame { + msec: 4192 + hash: "bbcb60bd8b845e8fd2c885d3f42d9a91" + } + Frame { + msec: 4208 + hash: "28addd32d7c28198425d41f42f1f7f38" + } + Frame { + msec: 4224 + hash: "82cee6bac4d343adb86d02836728ccd7" + } + Frame { + msec: 4240 + hash: "b0eeb40c5f7e7e5bb17566772686c8df" + } + Frame { + msec: 4256 + hash: "e5372f9fe3dbe6b111da81de6e2088b8" + } + Frame { + msec: 4272 + hash: "d6e476458ad03a13c7f14bdb2b530394" + } + Frame { + msec: 4288 + hash: "4a5185a2cf033ca6f9250ab9e995dc7a" + } + Frame { + msec: 4304 + hash: "6fd086e35b33ca714f31c1a50f64ccba" + } + Frame { + msec: 4320 + hash: "ae8cae69a702811a897e7d5790c806cc" + } + Frame { + msec: 4336 + hash: "073e2e1af434447c3000b03e3a89925a" + } + Frame { + msec: 4352 + hash: "3c75c7586c1dca2fd21266395ccc8ac4" + } + Frame { + msec: 4368 + hash: "aa36ac379ac9953bd165b5164cd047da" + } + Frame { + msec: 4384 + hash: "09d6ab311429cfe29a68c428669b5d5a" + } + Frame { + msec: 4400 + hash: "11ebcb0a744bc3faa746560d9c1a824d" + } + Frame { + msec: 4416 + hash: "aa01ba99122f89bff8fc45ef88326f6a" + } + Frame { + msec: 4432 + hash: "6980292ba8a4bf8ead3581e5899f5d78" + } + Frame { + msec: 4448 + hash: "65fa1a0fe53b9a0580c14e96d42fe993" + } + Frame { + msec: 4464 + hash: "7837c0a533839f94629be4e64294b89f" + } + Frame { + msec: 4480 + hash: "5edbf632047ae4130f580e4a0ece8e57" + } + Frame { + msec: 4496 + hash: "0a5fdc57898cb56f00a76ecaa3a6b9e0" + } + Frame { + msec: 4512 + hash: "58d1b36e738042af44dab04a8c842259" + } + Frame { + msec: 4528 + hash: "2efb1f742d7f823d13b9724c1c10ce1a" + } + Frame { + msec: 4544 + hash: "e0286eb0b3fbb17e422554a8ef25489c" + } + Frame { + msec: 4560 + hash: "8252caa2841f07d29802a7b822388253" + } + Frame { + msec: 4576 + hash: "eaabd4b3610c0bcbbdc113f86bc52e6c" + } + Frame { + msec: 4592 + hash: "55b17d049e1c791d33094f64717bca06" + } + Frame { + msec: 4608 + hash: "1bd607f6d0658f46b1f0df51e8a9a9fe" + } + Frame { + msec: 4624 + hash: "4a52ea4de14098978931155f11168f68" + } + Frame { + msec: 4640 + hash: "343df8fb45e1e70183bb61a1111909a5" + } + Frame { + msec: 4656 + hash: "bcf1363d9912a3d626ef933387b4e01b" + } + Frame { + msec: 4672 + hash: "67709ea579481537e532120de35619b2" + } + Frame { + msec: 4688 + hash: "a7542255a10a120812880b1243bd573d" + } + Frame { + msec: 4704 + hash: "b4f3e597e489d32a473bb2ad6bb92fc4" + } + Frame { + msec: 4720 + hash: "f0df46d1b819edda5a616e858ed9171c" + } + Frame { + msec: 4736 + hash: "2416564198b4b853d9c4f5ad55ee5db5" + } + Frame { + msec: 4752 + hash: "342e5adcd2fca99c88c33cd8b56b8650" + } + Frame { + msec: 4768 + hash: "01806799adce1d0069cfdd739f383a7f" + } + Frame { + msec: 4784 + hash: "c045fdefdd4606d2c68c8cde2a7a40f4" + } + Frame { + msec: 4800 + image: "follow.4.png" + } + Frame { + msec: 4816 + hash: "c7371c0594fb9f4de0a7f8a3cdce061a" + } + Frame { + msec: 4832 + hash: "6df0c2a27c672e36a3d7eb5b4e0c46bf" + } + Frame { + msec: 4848 + hash: "97fa050a5790b1f722d25dbee9efba95" + } + Frame { + msec: 4864 + hash: "85c26ed45e79793fc5b7521a8157d3a2" + } + Frame { + msec: 4880 + hash: "9ff5d272ec8deed3e70164b78bc425c6" + } + Frame { + msec: 4896 + hash: "d1e3f6d51d6b8e96261b902e6f88576d" + } + Frame { + msec: 4912 + hash: "02c12e50ed6b7111f301e142a2fbc5db" + } + Frame { + msec: 4928 + hash: "5177873aa73342ada32d7ebfe3f26e0e" + } + Frame { + msec: 4944 + hash: "05d0364f67f317ee617f1a64d9543fe2" + } + Frame { + msec: 4960 + hash: "20e50922d7763c7572776fc98d0e007b" + } + Frame { + msec: 4976 + hash: "f449eb14e0c0e08a79a220cb13551c4f" + } + Frame { + msec: 4992 + hash: "defe5fa356688a25ed2b8174d9baf2ce" + } + Frame { + msec: 5008 + hash: "f1697f95d67a0a15088c3f934dfc466f" + } + Frame { + msec: 5024 + hash: "7a962dad8227d367b4af7dee6ea09c20" + } + Frame { + msec: 5040 + hash: "49a806b0bee9e3145395fb68cb85dbaf" + } + Frame { + msec: 5056 + hash: "d0e4ffd3e12dd4b8e5553e613119ef86" + } + Frame { + msec: 5072 + hash: "41270d843d00eaabf2f95f051541013e" + } + Frame { + msec: 5088 + hash: "e8fd158c923d389a2d87db0023522934" + } + Frame { + msec: 5104 + hash: "9cfa7783d37010c10271d680d205ebc4" + } + Frame { + msec: 5120 + hash: "5e81c936f9627cf537f96a1674c920be" + } + Frame { + msec: 5136 + hash: "28679a61a44bf0d81d6a93d8ea301b97" + } + Frame { + msec: 5152 + hash: "ef41d71b99f078abe8a2a8326ed236c9" + } + Frame { + msec: 5168 + hash: "b0c77c16e9d13360992d3781d389a773" + } + Frame { + msec: 5184 + hash: "fe053081bc92e2a16322e6839749c49c" + } + Frame { + msec: 5200 + hash: "fdde556b8d7b31510b9b07686e3bf81f" + } + Frame { + msec: 5216 + hash: "f3f9c7ad55f4cabdcc9ff4a515163523" + } + Frame { + msec: 5232 + hash: "8ae1b429bcb1d7698efaca4abbe91d3f" + } + Frame { + msec: 5248 + hash: "c741a05290271260b8b916faa480e3aa" + } + Frame { + msec: 5264 + hash: "eebc4a70e557084577fb93f4b71da41c" + } + Frame { + msec: 5280 + hash: "4926f2fa2728d80f0799e67f06ae8be3" + } + Frame { + msec: 5296 + hash: "cf8ea67beade2f31d6ddd257578ef191" + } + Frame { + msec: 5312 + hash: "d041cad9a659449da739470ce03d6152" + } + Frame { + msec: 5328 + hash: "eae75c3364a13697c79aec42c221181d" + } + Frame { + msec: 5344 + hash: "2db70310d6a3b4900e749975e52d5f78" + } + Frame { + msec: 5360 + hash: "609838796118ab89566fe2fe664dfcb4" + } + Frame { + msec: 5376 + hash: "ae66ff91af5924e99231a811d0d00549" + } + Frame { + msec: 5392 + hash: "2b5ba8d8c340a92d4d6ef76dbd88c4b8" + } + Frame { + msec: 5408 + hash: "6b4ce7512194d65b7c8679822cb58274" + } + Frame { + msec: 5424 + hash: "36a58e3b3a057969c8a6b1ba4e704ec7" + } + Frame { + msec: 5440 + hash: "a2164ae8f60b27534392077358e057e2" + } + Frame { + msec: 5456 + hash: "9ceb838f32b76cc267283ef829a64f95" + } + Frame { + msec: 5472 + hash: "a372e42839d42e9f7dac83ae3b845be4" + } + Frame { + msec: 5488 + hash: "9e1226a6cb6585694a0b44b356f0b6d2" + } + Frame { + msec: 5504 + hash: "7bdfe1d332fdd3b8b241a3fb9dafa584" + } + Frame { + msec: 5520 + hash: "e7f3ef39c35f7bca75ae049a25790509" + } + Frame { + msec: 5536 + hash: "5bfcd4c96095d66825df5d94f8936659" + } + Frame { + msec: 5552 + hash: "d47fc61cedde2748d1c35d65c4278ce9" + } + Frame { + msec: 5568 + hash: "ee86ff1ea3a447ebf749a5b31ff147c9" + } + Frame { + msec: 5584 + hash: "05a3b141e33596e88ff3a6a3e09b13b9" + } + Frame { + msec: 5600 + hash: "2294c4c9f84c4398918524c41fe08317" + } + Frame { + msec: 5616 + hash: "2e19dc61944aa7671ac18303949e1c9e" + } + Frame { + msec: 5632 + hash: "37b4864ed528a3be221d7abb4106ec3a" + } + Frame { + msec: 5648 + hash: "c2bf99e089bc984abea63b8b43270859" + } + Frame { + msec: 5664 + hash: "c2bf99e089bc984abea63b8b43270859" + } + Frame { + msec: 5680 + hash: "d8de63e15f1f6e9c0cf0dd43afa03c42" + } + Frame { + msec: 5696 + hash: "3643a50c30b6d6f9b724155e49db7276" + } + Frame { + msec: 5712 + hash: "582e871460fe3056f7f3df97d5939d69" + } + Frame { + msec: 5728 + hash: "e46da1072974efc1c4df89d9c6243609" + } + Frame { + msec: 5744 + hash: "705ac82bb7a03eb5843aae7292739851" + } + Frame { + msec: 5760 + image: "follow.5.png" + } + Frame { + msec: 5776 + hash: "b2949af515524933f740057cae6d8c40" + } + Frame { + msec: 5792 + hash: "72a3526dbfeb42935a737f7876c86499" + } + Frame { + msec: 5808 + hash: "43907b91dec1412d0e6c8b53cec8e06f" + } + Frame { + msec: 5824 + hash: "66db45ca42d42e8a6eb279b892493af9" + } + Frame { + msec: 5840 + hash: "1f2d69898b90d344f337ac37a000e797" + } + Frame { + msec: 5856 + hash: "9c09edc9541d69e7565ef05fbe58fadf" + } + Frame { + msec: 5872 + hash: "0d68b6d05150981eff443cd7437b3d95" + } + Frame { + msec: 5888 + hash: "85558e393a1e0483ba27844cf409af47" + } + Frame { + msec: 5904 + hash: "83a73b6b3eb1052a9b1a12fb78326b26" + } + Frame { + msec: 5920 + hash: "4839882ecc497916b4ac964a5cc71d1b" + } + Frame { + msec: 5936 + hash: "28d6f5066f186a0d9ab7f4781374d3eb" + } + Frame { + msec: 5952 + hash: "d89148926c6dd636de953a55082e50f1" + } + Frame { + msec: 5968 + hash: "dbab902e252561849dba5551fc8f07d3" + } + Frame { + msec: 5984 + hash: "84a3a891fbbb1a0fca24324a3ea10c6a" + } + Frame { + msec: 6000 + hash: "64563bb68129f527b1c33c0d9a543f09" + } + Frame { + msec: 6016 + hash: "64563bb68129f527b1c33c0d9a543f09" + } + Frame { + msec: 6032 + hash: "7f3ae8ac99bf202414b03e9b33473044" + } + Frame { + msec: 6048 + hash: "7f3ae8ac99bf202414b03e9b33473044" + } + Frame { + msec: 6064 + hash: "7fbdf6396050da5b8945f1111c2ca973" + } + Frame { + msec: 6080 + hash: "5bf4fa18f24fc221685234a92c4cafb6" + } + Frame { + msec: 6096 + hash: "5bf4fa18f24fc221685234a92c4cafb6" + } + Frame { + msec: 6112 + hash: "e1b8d1d7298a3d3ade82493fb6f99909" + } + Frame { + msec: 6128 + hash: "6320b7b0bd1926c625f914d30f1f1fd9" + } + Frame { + msec: 6144 + hash: "74ecfaced66f630d1863c04000fa7f01" + } + Frame { + msec: 6160 + hash: "74ecfaced66f630d1863c04000fa7f01" + } + Frame { + msec: 6176 + hash: "c803b3258d0e1d8e6c1292ea2a00f76b" + } + Frame { + msec: 6192 + hash: "c803b3258d0e1d8e6c1292ea2a00f76b" + } + Frame { + msec: 6208 + hash: "8d359f95ee869714bb3972986637642d" + } + Frame { + msec: 6224 + hash: "9f3f4fe1be7bd4511a0408fd5ab1b11f" + } + Frame { + msec: 6240 + hash: "9f3f4fe1be7bd4511a0408fd5ab1b11f" + } + Frame { + msec: 6256 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 6272 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 6288 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 6304 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 6320 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 6336 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 6352 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 6368 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 6384 + hash: "e009f65ae035fb8a9c27a1d57f10c35f" + } + Frame { + msec: 6400 + hash: "e009f65ae035fb8a9c27a1d57f10c35f" + } + Frame { + msec: 6416 + hash: "e009f65ae035fb8a9c27a1d57f10c35f" + } + Frame { + msec: 6432 + hash: "e009f65ae035fb8a9c27a1d57f10c35f" + } + Frame { + msec: 6448 + hash: "e009f65ae035fb8a9c27a1d57f10c35f" + } + Frame { + msec: 6464 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6480 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6496 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6512 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6528 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6544 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6560 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Key { + type: 6 + key: 16777249 + modifiers: 0 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 6576 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6592 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6608 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6624 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6640 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6656 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6672 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6688 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6704 + hash: "20dd4407adca55737dd4231405c38cff" + } +} diff --git a/tests/auto/declarative/visual/qmlspringfollow/data/follow.0.png b/tests/auto/declarative/visual/qmlspringfollow/data/follow.0.png new file mode 100644 index 0000000..d173ee9 Binary files /dev/null and b/tests/auto/declarative/visual/qmlspringfollow/data/follow.0.png differ diff --git a/tests/auto/declarative/visual/qmlspringfollow/data/follow.1.png b/tests/auto/declarative/visual/qmlspringfollow/data/follow.1.png new file mode 100644 index 0000000..09b7bda Binary files /dev/null and b/tests/auto/declarative/visual/qmlspringfollow/data/follow.1.png differ diff --git a/tests/auto/declarative/visual/qmlspringfollow/data/follow.2.png b/tests/auto/declarative/visual/qmlspringfollow/data/follow.2.png new file mode 100644 index 0000000..b1d109e Binary files /dev/null and b/tests/auto/declarative/visual/qmlspringfollow/data/follow.2.png differ diff --git a/tests/auto/declarative/visual/qmlspringfollow/data/follow.3.png b/tests/auto/declarative/visual/qmlspringfollow/data/follow.3.png new file mode 100644 index 0000000..5cdcafb Binary files /dev/null and b/tests/auto/declarative/visual/qmlspringfollow/data/follow.3.png differ diff --git a/tests/auto/declarative/visual/qmlspringfollow/data/follow.4.png b/tests/auto/declarative/visual/qmlspringfollow/data/follow.4.png new file mode 100644 index 0000000..93e1536 Binary files /dev/null and b/tests/auto/declarative/visual/qmlspringfollow/data/follow.4.png differ diff --git a/tests/auto/declarative/visual/qmlspringfollow/data/follow.5.png b/tests/auto/declarative/visual/qmlspringfollow/data/follow.5.png new file mode 100644 index 0000000..b27cc9f Binary files /dev/null and b/tests/auto/declarative/visual/qmlspringfollow/data/follow.5.png differ diff --git a/tests/auto/declarative/visual/qmlspringfollow/data/follow.qml b/tests/auto/declarative/visual/qmlspringfollow/data/follow.qml new file mode 100644 index 0000000..f87372a --- /dev/null +++ b/tests/auto/declarative/visual/qmlspringfollow/data/follow.qml @@ -0,0 +1,1691 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "ea677d128f47343d81a081c438aa2f6c" + } + Frame { + msec: 32 + hash: "ea677d128f47343d81a081c438aa2f6c" + } + Frame { + msec: 48 + hash: "403e130b7cf0a41d8348a227293d98d1" + } + Frame { + msec: 64 + hash: "d2250ca93235b6a087b5e582f7e941d6" + } + Frame { + msec: 80 + hash: "3e95bdb5546de8ed7bb33de704d2890e" + } + Frame { + msec: 96 + hash: "438612a44780d6587f99a44c943eb60f" + } + Frame { + msec: 112 + hash: "6e840f3afd93a11034e128d70f76e642" + } + Frame { + msec: 128 + hash: "abbb1839aa7989e89d72368c501c5a12" + } + Frame { + msec: 144 + hash: "eefe846a36bf21929d83241b117d98b5" + } + Frame { + msec: 160 + hash: "ab39c7386555dc0a0edbd1e021fa3d93" + } + Frame { + msec: 176 + hash: "8cd9ac8226579bfd1d653ad5b9ff3302" + } + Frame { + msec: 192 + hash: "976c950140ce9f793884daa8d032c8fb" + } + Frame { + msec: 208 + hash: "c49ea9cb59a4ced0572a251c1ed53011" + } + Frame { + msec: 224 + hash: "d84a156021c5f61cb49f60cba5c0b7b7" + } + Frame { + msec: 240 + hash: "d47f16922533e186844448ad4540cc9d" + } + Frame { + msec: 256 + hash: "be16f676e94426dedc747de959f41658" + } + Frame { + msec: 272 + hash: "abe13e483ca63c485f8c66f6edbbc368" + } + Frame { + msec: 288 + hash: "71294e92418a4a586328a510916942e2" + } + Frame { + msec: 304 + hash: "2f201846d62d8885c8d4659c9622e711" + } + Frame { + msec: 320 + hash: "bfeb1da5c3ab5bda2def25682ae7f113" + } + Frame { + msec: 336 + hash: "00767a8b29a0de270f2485e430332c0b" + } + Frame { + msec: 352 + hash: "df1bac2a1f24ab2669c156f86ff3949a" + } + Frame { + msec: 368 + hash: "755a39579c403923c93a4a962e135374" + } + Frame { + msec: 384 + hash: "e176ba5703d6bd80f0de1a88f02ac678" + } + Frame { + msec: 400 + hash: "51d44c2913947f44708615b5e38b2bd3" + } + Frame { + msec: 416 + hash: "72a6d96e70ffd20c12139306103b4f4e" + } + Frame { + msec: 432 + hash: "96f82039287cbf4b403298436421c778" + } + Frame { + msec: 448 + hash: "0e86e386afdf7649dfdcd489137ad4ea" + } + Frame { + msec: 464 + hash: "8e78f10e410638680810c65e5bddd665" + } + Frame { + msec: 480 + hash: "765d52574fa75873e97f2e9b2a44e7a0" + } + Frame { + msec: 496 + hash: "a72e4be872da024c8af9b914d8baabc2" + } + Frame { + msec: 512 + hash: "3689c9af15bb91d4ae5b570ecffecfdd" + } + Frame { + msec: 528 + hash: "8147683fb527fdb2f71356e85abae6e9" + } + Frame { + msec: 544 + hash: "853f9220075a3782cf7fcc0bb8715263" + } + Frame { + msec: 560 + hash: "61b08b1ac4a0f8edcaa9984db4c2ba26" + } + Frame { + msec: 576 + hash: "9656cb5164be56f449f1f82b1555e6de" + } + Frame { + msec: 592 + hash: "17290bf0cb6f35ee421286e01bd47e98" + } + Frame { + msec: 608 + hash: "6f0d0cec511f59ff1e96cdbd9444eaf6" + } + Frame { + msec: 624 + hash: "d4bcf568361214c0eb8fa3998bbf1480" + } + Frame { + msec: 640 + hash: "41adf355d26d44b157f59d9fcb2e1c69" + } + Frame { + msec: 656 + hash: "e5e19a9529a4e7fc1f680fec3505e78f" + } + Frame { + msec: 672 + hash: "c5340333b27b030404dfb7f84c885f5a" + } + Frame { + msec: 688 + hash: "0d78d4df108698cbf01f85b543240a23" + } + Frame { + msec: 704 + hash: "3100a83fa0217e229bfe5b1014c85bd0" + } + Frame { + msec: 720 + hash: "d48a5e885a7ffe2164561a5e8db49af2" + } + Frame { + msec: 736 + hash: "f53ff65dde7676e467569cb4046c6151" + } + Frame { + msec: 752 + hash: "dfe16b338d9afba04ba20fe27e2f3871" + } + Frame { + msec: 768 + hash: "da60124324209ccb2bd0e025d0484ca5" + } + Frame { + msec: 784 + hash: "bb7c9e645bead664dfbb3b0b2d6350a5" + } + Frame { + msec: 800 + hash: "b4229201bd33515da83605b3e8c61f3e" + } + Frame { + msec: 816 + hash: "65d73e930b2117714e6020f3580b9c5f" + } + Frame { + msec: 832 + hash: "7635a572c1cedd66c27da128de4596aa" + } + Frame { + msec: 848 + hash: "9068d912a8d3e6e0b5b458c12ddad126" + } + Frame { + msec: 864 + hash: "e935bc3503eefd745f0086417322ccd0" + } + Frame { + msec: 880 + hash: "fad1a3e6f64818638e6d866af9554f72" + } + Frame { + msec: 896 + hash: "c80cd40121ad2b365a58b919db910fdb" + } + Frame { + msec: 912 + hash: "e9c7e153a429fc2b7a7afcbe69f48291" + } + Frame { + msec: 928 + hash: "f848e529d7ed9170c107556ffff2c7da" + } + Frame { + msec: 944 + hash: "5176b37586cd38607f7324ea5fe4a84e" + } + Frame { + msec: 960 + image: "follow.0.png" + } + Frame { + msec: 976 + hash: "13db39c0f6b2d2633fc6e9e25363649c" + } + Frame { + msec: 992 + hash: "709b27d74b5d63173dcc47315b6a98ad" + } + Frame { + msec: 1008 + hash: "3f1a3ec8c35f18109b00f596dddb2dee" + } + Frame { + msec: 1024 + hash: "7b5a87922adf288a3479c5772b87dc05" + } + Frame { + msec: 1040 + hash: "389a4ceae2a2c2b65d8b8f4a14e302fe" + } + Frame { + msec: 1056 + hash: "5e734ba84842d9ebacedea131c2cea43" + } + Frame { + msec: 1072 + hash: "2ca1665bc6e8fcc79fa3ed27d063ef2d" + } + Frame { + msec: 1088 + hash: "a133bcf3571762dac5ed8093835d0f32" + } + Frame { + msec: 1104 + hash: "100e33528137240152983158c89831c2" + } + Frame { + msec: 1120 + hash: "1b327165fcce6d61577e2c1715a77efe" + } + Frame { + msec: 1136 + hash: "724352ffdfa1a7e8aa0ffaa138706b14" + } + Frame { + msec: 1152 + hash: "c13dbf3fdd202d6fdb007622e2f3c9ee" + } + Frame { + msec: 1168 + hash: "50517cf68a3f6f8c84fc6520500ccf00" + } + Frame { + msec: 1184 + hash: "8fd426597afbc940a3778870118e2541" + } + Frame { + msec: 1200 + hash: "67434d0c791fc4c2761c1869a6cee081" + } + Frame { + msec: 1216 + hash: "3397a81fa89f46f55b7716325a722c82" + } + Frame { + msec: 1232 + hash: "7207230d6be72411aadc3064af25dcc6" + } + Frame { + msec: 1248 + hash: "709bc2b0d2ca7fa5e8b33e4a17a130bd" + } + Frame { + msec: 1264 + hash: "0b721aaffded67b507e896c2c2d9c6f2" + } + Frame { + msec: 1280 + hash: "a473144a3d3af4dfd27dd17eed95e050" + } + Frame { + msec: 1296 + hash: "264760a5a9ce988ce880084161dbc983" + } + Frame { + msec: 1312 + hash: "ea1ebaa56e24e0ca23723539ad8a18cf" + } + Frame { + msec: 1328 + hash: "d85e695424a7883354b9e807d0dca75a" + } + Frame { + msec: 1344 + hash: "2a5beec661122970528b4589c6a30184" + } + Frame { + msec: 1360 + hash: "c6b398270707e794cb41ac6dfc413559" + } + Frame { + msec: 1376 + hash: "5f0496a3db352ac7d68d37d0b40821de" + } + Frame { + msec: 1392 + hash: "60b6cf54208fe05cad90a5475ba44b6f" + } + Frame { + msec: 1408 + hash: "b375733a02dba8d856e6a54962701728" + } + Frame { + msec: 1424 + hash: "dca9a423a2b43c9edf294f707ffeb3e9" + } + Frame { + msec: 1440 + hash: "43d04fee9d2fbe1807f4d6b599a227fd" + } + Frame { + msec: 1456 + hash: "169446930a064cabd9dfc8cce5669967" + } + Frame { + msec: 1472 + hash: "3dc4b0e80ae663022ae9acda781cdb10" + } + Frame { + msec: 1488 + hash: "fc7b862abfc6f1694cbbe00ede57d883" + } + Frame { + msec: 1504 + hash: "76e67f9c5b552f1ff47c3c7b23eb1b76" + } + Frame { + msec: 1520 + hash: "8c3e1d2fd58eaf2a8da16bb0349b1e5e" + } + Frame { + msec: 1536 + hash: "4642a396f4a4bb3b97845782e1d1ce93" + } + Frame { + msec: 1552 + hash: "4d3e8c9ea7c8c1407db564a3a6e430ff" + } + Frame { + msec: 1568 + hash: "e041300f1d2956f35baebed6c7c9c750" + } + Frame { + msec: 1584 + hash: "a900c3551c5d3bbaf1ce6e0372e69a70" + } + Frame { + msec: 1600 + hash: "cb5c32ad57d1931a69c20328f8f2d060" + } + Frame { + msec: 1616 + hash: "021ba4fc38e1652afeab73047e126a17" + } + Frame { + msec: 1632 + hash: "d27728f36491ba432e3655850402ee6b" + } + Frame { + msec: 1648 + hash: "20a87f4d9afd2039e44c2b5b539d0298" + } + Frame { + msec: 1664 + hash: "e03dfc3f89c5e4f6a31bc4b624b249f4" + } + Frame { + msec: 1680 + hash: "e52c42cbc1c362bd77f72b71dedc34da" + } + Frame { + msec: 1696 + hash: "b3e15bd0354fa84d13f1f9163be12b73" + } + Frame { + msec: 1712 + hash: "eb6517d72b7943654215ad46e8b165a9" + } + Frame { + msec: 1728 + hash: "1be17ea113f704b1a3a1fda63d10c23a" + } + Frame { + msec: 1744 + hash: "f288d004dd459b90acf9e70045de51bc" + } + Frame { + msec: 1760 + hash: "750d6c78b8e3e3311935faacfe37c44f" + } + Frame { + msec: 1776 + hash: "08a12d133eab365b639204e6b327143b" + } + Frame { + msec: 1792 + hash: "4641237f37091b2aebfb17255999f8e1" + } + Frame { + msec: 1808 + hash: "389c3a75932dc695f3aa323569cf0ebe" + } + Frame { + msec: 1824 + hash: "4f03b3b47db131f4604b1f2487303012" + } + Frame { + msec: 1840 + hash: "b29afbba738730b089f257a133874540" + } + Frame { + msec: 1856 + hash: "04b3014bf60cc25920724d0c18424830" + } + Frame { + msec: 1872 + hash: "1f09172690083f6051d4807c287d64a4" + } + Frame { + msec: 1888 + hash: "fb32eec375d5f1abd7f651f022df8d20" + } + Frame { + msec: 1904 + hash: "251e61f514db494cb47ae18234abd9a4" + } + Frame { + msec: 1920 + image: "follow.1.png" + } + Frame { + msec: 1936 + hash: "8acec26bf4ab5f93ccc5d77d4866826a" + } + Frame { + msec: 1952 + hash: "2490ddc2c74c525ecc51ffc83357611e" + } + Frame { + msec: 1968 + hash: "f7f67dc93d3ff7aad6df8917f7f6f285" + } + Frame { + msec: 1984 + hash: "d034044a9e2f2712aa1f0c10a5e4355f" + } + Frame { + msec: 2000 + hash: "7760794170cfbb7ca93aebf12874a603" + } + Frame { + msec: 2016 + hash: "a680699dda95e5a59dcf310cf5671d6e" + } + Frame { + msec: 2032 + hash: "df3a0ffa7089defb0f3db08f4f34cba6" + } + Frame { + msec: 2048 + hash: "4e0ce20d81cd4acad3270bfe5a650d18" + } + Frame { + msec: 2064 + hash: "1f46926406a5f0bb33159bba6ef740f3" + } + Frame { + msec: 2080 + hash: "321e4cbbb7f4fbe748a2fe45db13d184" + } + Frame { + msec: 2096 + hash: "185c0357a585aafabe5dbc3573ea135d" + } + Frame { + msec: 2112 + hash: "0421ac4f53c050bfffb2c8de16aafd46" + } + Frame { + msec: 2128 + hash: "953bdaacefe42a841bf1cdd7da3b442a" + } + Frame { + msec: 2144 + hash: "3f64635e9c43b8b6a402c5d6fe26e648" + } + Frame { + msec: 2160 + hash: "3f64635e9c43b8b6a402c5d6fe26e648" + } + Frame { + msec: 2176 + hash: "92926b4cf66b15cd0ddb468f2bd8bd62" + } + Frame { + msec: 2192 + hash: "fe78f7f7ecd3242aa75f3590884e0f44" + } + Frame { + msec: 2208 + hash: "55249aae2bb6db6c363ecb4b89f56270" + } + Frame { + msec: 2224 + hash: "73ea66c3c61e8105ac61d26c8cfdbba3" + } + Frame { + msec: 2240 + hash: "ac77e83366b34b7375ad7c150ccebd01" + } + Frame { + msec: 2256 + hash: "b0a94b3ab562b469c622c4c7438f2c04" + } + Frame { + msec: 2272 + hash: "73ab6f0a829f92533bbabef8b8097d5d" + } + Frame { + msec: 2288 + hash: "0c2301bd28a080f113bd786b6875bf53" + } + Frame { + msec: 2304 + hash: "026811ab3517257daf6a597d96bf2b20" + } + Frame { + msec: 2320 + hash: "5740c6aacc1d1a5a402974bb977d9b13" + } + Frame { + msec: 2336 + hash: "41f0a093fc87c4d519a9b72bac518514" + } + Frame { + msec: 2352 + hash: "1ed376000e60129b4bcf06ea73cb5819" + } + Frame { + msec: 2368 + hash: "8c713e210143ab5f19bdddd918f86ef3" + } + Frame { + msec: 2384 + hash: "269b595c5691747b56be58d5b92ae497" + } + Frame { + msec: 2400 + hash: "486d80316c88da4adc736df72fc86f45" + } + Frame { + msec: 2416 + hash: "f76e6c0a9e7957730ac646b73d1373d1" + } + Frame { + msec: 2432 + hash: "e0a6765306f92e32b7a778f882ba5c15" + } + Frame { + msec: 2448 + hash: "b01834ca90ee836643083593a558d2ef" + } + Frame { + msec: 2464 + hash: "02748271316f8382f4788322fda807c1" + } + Frame { + msec: 2480 + hash: "ce5adbd1a713777476d2468f67e531f3" + } + Frame { + msec: 2496 + hash: "840be99d6372f9ebf3c580765b71be74" + } + Frame { + msec: 2512 + hash: "dd1cfa3fcec2fba91b0120a8aab3c137" + } + Frame { + msec: 2528 + hash: "023843739f78eb77767aa1cacae824e9" + } + Frame { + msec: 2544 + hash: "3e312b8de56c902ca20aba259c8559b2" + } + Frame { + msec: 2560 + hash: "23fe7c60751c2e3a57a418ad57d290f1" + } + Frame { + msec: 2576 + hash: "0cec0db315715c41c4086bdeb72af721" + } + Frame { + msec: 2592 + hash: "1b633a8efad433e7dbf159d49ebd00e8" + } + Frame { + msec: 2608 + hash: "35e46ea3f3a46297c403aa177ee66ede" + } + Frame { + msec: 2624 + hash: "e1b8d1d7298a3d3ade82493fb6f99909" + } + Frame { + msec: 2640 + hash: "74ecfaced66f630d1863c04000fa7f01" + } + Frame { + msec: 2656 + hash: "74ecfaced66f630d1863c04000fa7f01" + } + Frame { + msec: 2672 + hash: "c803b3258d0e1d8e6c1292ea2a00f76b" + } + Frame { + msec: 2688 + hash: "c803b3258d0e1d8e6c1292ea2a00f76b" + } + Frame { + msec: 2704 + hash: "c803b3258d0e1d8e6c1292ea2a00f76b" + } + Frame { + msec: 2720 + hash: "9f3f4fe1be7bd4511a0408fd5ab1b11f" + } + Frame { + msec: 2736 + hash: "9f3f4fe1be7bd4511a0408fd5ab1b11f" + } + Frame { + msec: 2752 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 2768 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 2784 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 2800 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 2816 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 2832 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 2848 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 2864 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 2880 + image: "follow.2.png" + } + Frame { + msec: 2896 + hash: "e009f65ae035fb8a9c27a1d57f10c35f" + } + Frame { + msec: 2912 + hash: "e009f65ae035fb8a9c27a1d57f10c35f" + } + Frame { + msec: 2928 + hash: "e009f65ae035fb8a9c27a1d57f10c35f" + } + Frame { + msec: 2944 + hash: "e009f65ae035fb8a9c27a1d57f10c35f" + } + Frame { + msec: 2960 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 2976 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 2992 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3008 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3024 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3040 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3056 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3072 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3088 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3104 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3120 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3136 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3152 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3168 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3184 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 3200 + hash: "20dd4407adca55737dd4231405c38cff" + } + Frame { + msec: 3216 + hash: "20dd4407adca55737dd4231405c38cff" + } + Frame { + msec: 3232 + hash: "20dd4407adca55737dd4231405c38cff" + } + Frame { + msec: 3248 + hash: "20dd4407adca55737dd4231405c38cff" + } + Frame { + msec: 3264 + hash: "20dd4407adca55737dd4231405c38cff" + } + Frame { + msec: 3280 + hash: "20dd4407adca55737dd4231405c38cff" + } + Frame { + msec: 3296 + hash: "20dd4407adca55737dd4231405c38cff" + } + Frame { + msec: 3312 + hash: "20dd4407adca55737dd4231405c38cff" + } + Frame { + msec: 3328 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 3344 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3360 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3376 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3392 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3408 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3424 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3440 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3456 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3472 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3488 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3504 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 3520 + hash: "9f3f4fe1be7bd4511a0408fd5ab1b11f" + } + Frame { + msec: 3536 + hash: "9f3f4fe1be7bd4511a0408fd5ab1b11f" + } + Frame { + msec: 3552 + hash: "080910b835e134dfd06b83f1e92c92e8" + } + Frame { + msec: 3568 + hash: "317c01c691f0b46d5d809c3ccc1e78e6" + } + Frame { + msec: 3584 + hash: "475f4da1be823b57b58aecbb5a853892" + } + Frame { + msec: 3600 + hash: "b60a6387e955cd8e5e907a6b22a2aecc" + } + Frame { + msec: 3616 + hash: "4674eae7d8db1bf7eb35c7798948f7c4" + } + Frame { + msec: 3632 + hash: "7b4a143d0bf44ddf87d3bfd03c143025" + } + Frame { + msec: 3648 + hash: "e794d7ee32bcec9e0790ee95d89c9e06" + } + Frame { + msec: 3664 + hash: "0581724e928d25f276dd4ad19a9ffd4e" + } + Frame { + msec: 3680 + hash: "d8ef5e95454db4fd40fe51bcd9cf57b2" + } + Frame { + msec: 3696 + hash: "22ca96df911b74025fc771e945850adf" + } + Frame { + msec: 3712 + hash: "e0a88fb75e9193322fd5f925e89d7828" + } + Frame { + msec: 3728 + hash: "ee82a5192ea9af94d1a6ab169b438c34" + } + Frame { + msec: 3744 + hash: "c9d0d8514a783f3a9d0da651439990e2" + } + Frame { + msec: 3760 + hash: "9378795141098714f3ab5b2f28d219af" + } + Frame { + msec: 3776 + hash: "d61c4a67039e5a56ccd59df8afa24d38" + } + Frame { + msec: 3792 + hash: "62be79759a2a15ac73355457fa515b0a" + } + Frame { + msec: 3808 + hash: "d8f09c05c188fe3d09b8409a62bee29c" + } + Frame { + msec: 3824 + hash: "0285dead7580a8064116cf32bd31b40d" + } + Frame { + msec: 3840 + image: "follow.3.png" + } + Frame { + msec: 3856 + hash: "1921975bdfbe8a9817808919c97d2bac" + } + Frame { + msec: 3872 + hash: "9c58d55cc025dd022451971ba6735a79" + } + Frame { + msec: 3888 + hash: "c2163f3ab875bdb5728b16abcb65dfa4" + } + Frame { + msec: 3904 + hash: "48bd0e85564e411c4ae6d042487cb0d5" + } + Frame { + msec: 3920 + hash: "2e2c9f62acdc703fff7c28e7b7a59d47" + } + Frame { + msec: 3936 + hash: "d749acc91c1b271aac00c00a6088e9ac" + } + Frame { + msec: 3952 + hash: "cfa2c65f6f1a9bf242e073166a6e7b97" + } + Frame { + msec: 3968 + hash: "bb6f98350cbb89cf96c2f159659b944e" + } + Frame { + msec: 3984 + hash: "b7f087705eb7e2c7c4bd197aa08c1509" + } + Frame { + msec: 4000 + hash: "57f217985d1850bfa3d21c2cdd164d99" + } + Frame { + msec: 4016 + hash: "ded1e29fb83d6ec1d888fbd610c8a875" + } + Frame { + msec: 4032 + hash: "c2a9f250bca3e1f7906a577c0ae6b724" + } + Frame { + msec: 4048 + hash: "9cb2ca74308f519da85389ae959980ce" + } + Frame { + msec: 4064 + hash: "5b0d50ee5f7d077deec51159cebfd767" + } + Frame { + msec: 4080 + hash: "c41d847a89ece0dc9cfa1d0a0a8a16b1" + } + Frame { + msec: 4096 + hash: "d372cb387ad3f01614aaaf720f133d6e" + } + Frame { + msec: 4112 + hash: "9458ad068c95ff80e1dc4b1efd52683e" + } + Frame { + msec: 4128 + hash: "2e976c4a780503c6a71c4e9f8bd14178" + } + Frame { + msec: 4144 + hash: "b2f36762c85fcdbb0e1be545a3c49936" + } + Frame { + msec: 4160 + hash: "c29fdeb241221a29d0ad928f6401a2d4" + } + Frame { + msec: 4176 + hash: "bdbaaa347e20d21cc02b4c98953255ea" + } + Frame { + msec: 4192 + hash: "34e9b69f851e1d719467d08962d8a657" + } + Frame { + msec: 4208 + hash: "140a90804138dadb42e08b75fc1eed67" + } + Frame { + msec: 4224 + hash: "67418a2069d491022c28232b392b1631" + } + Frame { + msec: 4240 + hash: "df39748a385186ee0bdffa87485c2746" + } + Frame { + msec: 4256 + hash: "c3276e48ede008a43baf350a79b3443b" + } + Frame { + msec: 4272 + hash: "85473441e2560d8000640deecedef3bf" + } + Frame { + msec: 4288 + hash: "4d3d07ed1acec99052ebf530cb2c20da" + } + Frame { + msec: 4304 + hash: "3fb8ec07500be6d951f30121bcbcba13" + } + Frame { + msec: 4320 + hash: "ae8cae69a702811a897e7d5790c806cc" + } + Frame { + msec: 4336 + hash: "073e2e1af434447c3000b03e3a89925a" + } + Frame { + msec: 4352 + hash: "3c75c7586c1dca2fd21266395ccc8ac4" + } + Frame { + msec: 4368 + hash: "aa36ac379ac9953bd165b5164cd047da" + } + Frame { + msec: 4384 + hash: "09d6ab311429cfe29a68c428669b5d5a" + } + Frame { + msec: 4400 + hash: "11ebcb0a744bc3faa746560d9c1a824d" + } + Frame { + msec: 4416 + hash: "aa01ba99122f89bff8fc45ef88326f6a" + } + Frame { + msec: 4432 + hash: "6980292ba8a4bf8ead3581e5899f5d78" + } + Frame { + msec: 4448 + hash: "65fa1a0fe53b9a0580c14e96d42fe993" + } + Frame { + msec: 4464 + hash: "7837c0a533839f94629be4e64294b89f" + } + Frame { + msec: 4480 + hash: "5edbf632047ae4130f580e4a0ece8e57" + } + Frame { + msec: 4496 + hash: "0a5fdc57898cb56f00a76ecaa3a6b9e0" + } + Frame { + msec: 4512 + hash: "58d1b36e738042af44dab04a8c842259" + } + Frame { + msec: 4528 + hash: "2efb1f742d7f823d13b9724c1c10ce1a" + } + Frame { + msec: 4544 + hash: "e0286eb0b3fbb17e422554a8ef25489c" + } + Frame { + msec: 4560 + hash: "8252caa2841f07d29802a7b822388253" + } + Frame { + msec: 4576 + hash: "eaabd4b3610c0bcbbdc113f86bc52e6c" + } + Frame { + msec: 4592 + hash: "55b17d049e1c791d33094f64717bca06" + } + Frame { + msec: 4608 + hash: "1bd607f6d0658f46b1f0df51e8a9a9fe" + } + Frame { + msec: 4624 + hash: "4a52ea4de14098978931155f11168f68" + } + Frame { + msec: 4640 + hash: "343df8fb45e1e70183bb61a1111909a5" + } + Frame { + msec: 4656 + hash: "bcf1363d9912a3d626ef933387b4e01b" + } + Frame { + msec: 4672 + hash: "67709ea579481537e532120de35619b2" + } + Frame { + msec: 4688 + hash: "a7542255a10a120812880b1243bd573d" + } + Frame { + msec: 4704 + hash: "b4f3e597e489d32a473bb2ad6bb92fc4" + } + Frame { + msec: 4720 + hash: "f0df46d1b819edda5a616e858ed9171c" + } + Frame { + msec: 4736 + hash: "2416564198b4b853d9c4f5ad55ee5db5" + } + Frame { + msec: 4752 + hash: "342e5adcd2fca99c88c33cd8b56b8650" + } + Frame { + msec: 4768 + hash: "01806799adce1d0069cfdd739f383a7f" + } + Frame { + msec: 4784 + hash: "c045fdefdd4606d2c68c8cde2a7a40f4" + } + Frame { + msec: 4800 + image: "follow.4.png" + } + Frame { + msec: 4816 + hash: "c7371c0594fb9f4de0a7f8a3cdce061a" + } + Frame { + msec: 4832 + hash: "6df0c2a27c672e36a3d7eb5b4e0c46bf" + } + Frame { + msec: 4848 + hash: "97fa050a5790b1f722d25dbee9efba95" + } + Frame { + msec: 4864 + hash: "85c26ed45e79793fc5b7521a8157d3a2" + } + Frame { + msec: 4880 + hash: "9ff5d272ec8deed3e70164b78bc425c6" + } + Frame { + msec: 4896 + hash: "d1e3f6d51d6b8e96261b902e6f88576d" + } + Frame { + msec: 4912 + hash: "02c12e50ed6b7111f301e142a2fbc5db" + } + Frame { + msec: 4928 + hash: "5177873aa73342ada32d7ebfe3f26e0e" + } + Frame { + msec: 4944 + hash: "05d0364f67f317ee617f1a64d9543fe2" + } + Frame { + msec: 4960 + hash: "0b93625274bf1e3585664e56aff0197c" + } + Frame { + msec: 4976 + hash: "988083e19b15662ec09247c381bfaef5" + } + Frame { + msec: 4992 + hash: "6caa6b74ba935c2c9a6bf75ef94afedf" + } + Frame { + msec: 5008 + hash: "541ecf2b40931f8009a15c9c981e09aa" + } + Frame { + msec: 5024 + hash: "7a962dad8227d367b4af7dee6ea09c20" + } + Frame { + msec: 5040 + hash: "0c175618366090b8f21334e94a865464" + } + Frame { + msec: 5056 + hash: "f8e32badd5a839892ee4982ca37933db" + } + Frame { + msec: 5072 + hash: "3a91f3a25b245e79ddeb72778075ba8f" + } + Frame { + msec: 5088 + hash: "e8fd158c923d389a2d87db0023522934" + } + Frame { + msec: 5104 + hash: "9cfa7783d37010c10271d680d205ebc4" + } + Frame { + msec: 5120 + hash: "5e81c936f9627cf537f96a1674c920be" + } + Frame { + msec: 5136 + hash: "28679a61a44bf0d81d6a93d8ea301b97" + } + Frame { + msec: 5152 + hash: "ef41d71b99f078abe8a2a8326ed236c9" + } + Frame { + msec: 5168 + hash: "753da9af5dd15cbb6c9df83460f32631" + } + Frame { + msec: 5184 + hash: "49bbb9f30cf72a64b64ab19f0c2d5b9e" + } + Frame { + msec: 5200 + hash: "03d829cdb7da915da606dc1475debae8" + } + Frame { + msec: 5216 + hash: "1ee5d8c3c868e2f7d7f034f9bdc91c8f" + } + Frame { + msec: 5232 + hash: "0f497c52a8b4a7bbd9246c466182644c" + } + Frame { + msec: 5248 + hash: "1574e08a7db9c9a164147ca329d48dbd" + } + Frame { + msec: 5264 + hash: "bff3837578fd069d2b9000ad60123be3" + } + Frame { + msec: 5280 + hash: "99ce71c69566b92715a27014548d7346" + } + Frame { + msec: 5296 + hash: "78a78f00e598405d4e906a930ace9cb5" + } + Frame { + msec: 5312 + hash: "a0f44f1a8772d4dd8d70795811fdd4ab" + } + Frame { + msec: 5328 + hash: "3d5fd500d5c771b437a999659ea57dd7" + } + Frame { + msec: 5344 + hash: "53fbb22689627f55af20b3cb15a7a8cf" + } + Frame { + msec: 5360 + hash: "609838796118ab89566fe2fe664dfcb4" + } + Frame { + msec: 5376 + hash: "c2d7d5cb7cf470ed4d84f705c187f768" + } + Frame { + msec: 5392 + hash: "63c6de2754a0b9c23e5b652aa331716f" + } + Frame { + msec: 5408 + hash: "8cacae37981ebd8c0a6772f97d8e9342" + } + Frame { + msec: 5424 + hash: "b8ab40dbd1bb086eae5b80f2e751efe4" + } + Frame { + msec: 5440 + hash: "fb4211ee009b224b64092d106369f6a0" + } + Frame { + msec: 5456 + hash: "b59dd1dcbb128b6f7df51bd30ac0af31" + } + Frame { + msec: 5472 + hash: "075ff90195b6a0d37944aaf32eb560e7" + } + Frame { + msec: 5488 + hash: "26cb5dda92cfec934e4068322eb0c792" + } + Frame { + msec: 5504 + hash: "0938c360b6c8911074cda8fd58de5650" + } + Frame { + msec: 5520 + hash: "6491ba15d6566ab6f17ee6eb9c5472ab" + } + Frame { + msec: 5536 + hash: "83518cf990f5050d68bf1f09c774ae74" + } + Frame { + msec: 5552 + hash: "4ce84b0d70bc3ebf970e9161ffb7dc21" + } + Frame { + msec: 5568 + hash: "57270cebd25e5c6dd7fb204232e18eb3" + } + Frame { + msec: 5584 + hash: "d93f26948e6deb4bf074139468d12c27" + } + Frame { + msec: 5600 + hash: "581fe059cd632e242dd308b11ef8288a" + } + Frame { + msec: 5616 + hash: "2e19dc61944aa7671ac18303949e1c9e" + } + Frame { + msec: 5632 + hash: "37b4864ed528a3be221d7abb4106ec3a" + } + Frame { + msec: 5648 + hash: "4261fe6049e5dff81b33e503a4d1825d" + } + Frame { + msec: 5664 + hash: "c2bf99e089bc984abea63b8b43270859" + } + Frame { + msec: 5680 + hash: "d8de63e15f1f6e9c0cf0dd43afa03c42" + } + Frame { + msec: 5696 + hash: "3643a50c30b6d6f9b724155e49db7276" + } + Frame { + msec: 5712 + hash: "582e871460fe3056f7f3df97d5939d69" + } + Frame { + msec: 5728 + hash: "e46da1072974efc1c4df89d9c6243609" + } + Frame { + msec: 5744 + hash: "705ac82bb7a03eb5843aae7292739851" + } + Frame { + msec: 5760 + image: "follow.5.png" + } + Frame { + msec: 5776 + hash: "b2949af515524933f740057cae6d8c40" + } + Frame { + msec: 5792 + hash: "72a3526dbfeb42935a737f7876c86499" + } + Frame { + msec: 5808 + hash: "43907b91dec1412d0e6c8b53cec8e06f" + } + Frame { + msec: 5824 + hash: "66db45ca42d42e8a6eb279b892493af9" + } + Frame { + msec: 5840 + hash: "1f2d69898b90d344f337ac37a000e797" + } + Frame { + msec: 5856 + hash: "9c09edc9541d69e7565ef05fbe58fadf" + } + Frame { + msec: 5872 + hash: "0d68b6d05150981eff443cd7437b3d95" + } + Frame { + msec: 5888 + hash: "85558e393a1e0483ba27844cf409af47" + } + Frame { + msec: 5904 + hash: "83a73b6b3eb1052a9b1a12fb78326b26" + } + Frame { + msec: 5920 + hash: "4839882ecc497916b4ac964a5cc71d1b" + } + Frame { + msec: 5936 + hash: "28d6f5066f186a0d9ab7f4781374d3eb" + } + Frame { + msec: 5952 + hash: "d89148926c6dd636de953a55082e50f1" + } + Frame { + msec: 5968 + hash: "dbab902e252561849dba5551fc8f07d3" + } + Frame { + msec: 5984 + hash: "84a3a891fbbb1a0fca24324a3ea10c6a" + } + Frame { + msec: 6000 + hash: "64563bb68129f527b1c33c0d9a543f09" + } + Frame { + msec: 6016 + hash: "64563bb68129f527b1c33c0d9a543f09" + } + Frame { + msec: 6032 + hash: "7f3ae8ac99bf202414b03e9b33473044" + } + Frame { + msec: 6048 + hash: "7f3ae8ac99bf202414b03e9b33473044" + } + Frame { + msec: 6064 + hash: "7fbdf6396050da5b8945f1111c2ca973" + } + Frame { + msec: 6080 + hash: "5bf4fa18f24fc221685234a92c4cafb6" + } + Frame { + msec: 6096 + hash: "5bf4fa18f24fc221685234a92c4cafb6" + } + Frame { + msec: 6112 + hash: "e1b8d1d7298a3d3ade82493fb6f99909" + } + Frame { + msec: 6128 + hash: "6320b7b0bd1926c625f914d30f1f1fd9" + } + Frame { + msec: 6144 + hash: "74ecfaced66f630d1863c04000fa7f01" + } + Frame { + msec: 6160 + hash: "74ecfaced66f630d1863c04000fa7f01" + } + Frame { + msec: 6176 + hash: "c803b3258d0e1d8e6c1292ea2a00f76b" + } + Frame { + msec: 6192 + hash: "c803b3258d0e1d8e6c1292ea2a00f76b" + } + Frame { + msec: 6208 + hash: "8d359f95ee869714bb3972986637642d" + } + Frame { + msec: 6224 + hash: "9f3f4fe1be7bd4511a0408fd5ab1b11f" + } + Frame { + msec: 6240 + hash: "9f3f4fe1be7bd4511a0408fd5ab1b11f" + } + Frame { + msec: 6256 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 6272 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 6288 + hash: "cd2c4e1a288d09f46dd557973c22e1be" + } + Frame { + msec: 6304 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 6320 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 6336 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 6352 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 6368 + hash: "8109005d7e21d16b77f88efce2b530e4" + } + Frame { + msec: 6384 + hash: "e009f65ae035fb8a9c27a1d57f10c35f" + } + Frame { + msec: 6400 + hash: "e009f65ae035fb8a9c27a1d57f10c35f" + } + Frame { + msec: 6416 + hash: "e009f65ae035fb8a9c27a1d57f10c35f" + } + Frame { + msec: 6432 + hash: "e009f65ae035fb8a9c27a1d57f10c35f" + } + Frame { + msec: 6448 + hash: "e009f65ae035fb8a9c27a1d57f10c35f" + } + Frame { + msec: 6464 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6480 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6496 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6512 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6528 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6544 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6560 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 6576 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6592 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6608 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6624 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6640 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6656 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6672 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6688 + hash: "31a446fab3c9a92f20fbb065b62d4357" + } + Frame { + msec: 6704 + hash: "20dd4407adca55737dd4231405c38cff" + } +} diff --git a/tests/auto/declarative/visual/qmlspringfollow/follow.qml b/tests/auto/declarative/visual/qmlspringfollow/follow.qml new file mode 100644 index 0000000..3e164f9 --- /dev/null +++ b/tests/auto/declarative/visual/qmlspringfollow/follow.qml @@ -0,0 +1,73 @@ +import Qt 4.6 + +Rectangle { + color: "#ffffff" + width: 320; height: 240 + Rectangle { + id: rect + color: "#00ff00" + y: 200; width: 60; height: 20 + y: SequentialAnimation { + running: true; repeat: true + NumberAnimation { + to: 20; duration: 500 + easing: "easeInOutQuad" + } + NumberAnimation { + to: 200; duration: 2000 + easing: "easeOutBounce" + } + PauseAnimation { duration: 1000 } + } + } + + // Velocity + Rectangle { + color: "#ff0000" + x: rect.width; width: rect.width; height: 20 + y: 200 + y: SpringFollow { source: rect.y; velocity: 200 } + } + Text { x: rect.width; y: 220; text: "Velocity" } + + // Spring + Rectangle { + color: "#ff0000" + x: rect.width * 2; width: rect.width/2; height: 20 + y: 200 + y: SpringFollow { source: rect.y; spring: 1.0; damping: 0.2 } + } + Rectangle { + color: "#880000" + x: rect.width * 2.5; width: rect.width/2; height: 20 + y: 200 + y: SpringFollow { source: rect.y; spring: 1.0; damping: 0.2; mass: 3.0 } // "heavier" object + } + Text { x: rect.width * 2; y: 220; text: "Spring" } + + // Follow mouse + MouseRegion { + id: mouseRegion + anchors.fill: parent + Rectangle { + id: ball + width: 20; height: 20 + radius: 10 + color: "#0000ff" + x: SpringFollow { id: f1; source: mouseRegion.mouseX-10; spring: 1.0; damping: 0.05; epsilon: 0.25 } + y: SpringFollow { id: f2; source: mouseRegion.mouseY-10; spring: 1.0; damping: 0.05; epsilon: 0.25 } + states: [ + State { + name: "following" + when: !f1.inSync || !f2.inSync + PropertyChanges { target: ball; color: "#ff0000" } + } + ] + transitions: [ + Transition { + ColorAnimation { duration: 200 } + } + ] + } + } +} -- cgit v0.12 From 37aef8c7d55d3f5bf036d66613e87f89fcd9b897 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 6 Nov 2009 15:33:45 +1000 Subject: Fix crash when using anchors inside a positioner. Task-number: QTBUG-5428 --- .../graphicsitems/qmlgraphicsanchors.cpp | 47 +++++++++++++++------- .../graphicsitems/qmlgraphicsanchors_p_p.h | 4 +- tests/auto/declarative/anchors/data/crash1.qml | 11 +++++ tests/auto/declarative/anchors/tst_anchors.cpp | 15 +++++++ 4 files changed, 62 insertions(+), 15 deletions(-) create mode 100644 tests/auto/declarative/anchors/data/crash1.qml diff --git a/src/declarative/graphicsitems/qmlgraphicsanchors.cpp b/src/declarative/graphicsitems/qmlgraphicsanchors.cpp index 404daad..f6dc5fd 100644 --- a/src/declarative/graphicsitems/qmlgraphicsanchors.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsanchors.cpp @@ -152,13 +152,23 @@ void QmlGraphicsAnchorsPrivate::fillChanged() if (!fill || !isItemComplete()) return; - if (fill == item->parentItem()) { //child-parent - setItemPos(QPointF(leftMargin, topMargin)); - } else if (fill->parentItem() == item->parentItem()) { //siblings - setItemPos(QPointF(fill->x()+leftMargin, fill->y()+topMargin)); + if (updatingFill < 2) { + ++updatingFill; + + if (fill == item->parentItem()) { //child-parent + setItemPos(QPointF(leftMargin, topMargin)); + } else if (fill->parentItem() == item->parentItem()) { //siblings + setItemPos(QPointF(fill->x()+leftMargin, fill->y()+topMargin)); + } + setItemWidth(fill->width()-leftMargin-rightMargin); + setItemHeight(fill->height()-topMargin-bottomMargin); + + --updatingFill; + } else { + // ### Make this certain :) + qmlInfo(QmlGraphicsAnchors::tr("Possible anchor loop detected on fill."), item); } - setItemWidth(fill->width()-leftMargin-rightMargin); - setItemHeight(fill->height()-topMargin-bottomMargin); + } void QmlGraphicsAnchorsPrivate::centerInChanged() @@ -166,16 +176,25 @@ void QmlGraphicsAnchorsPrivate::centerInChanged() if (!centerIn || fill || !isItemComplete()) return; - if (centerIn == item->parentItem()) { - QPointF p((item->parentItem()->width() - item->width()) / 2., - (item->parentItem()->height() - item->height()) / 2.); - setItemPos(p); + if (updatingCenterIn < 2) { + ++updatingCenterIn; - } else if (centerIn->parentItem() == item->parentItem()) { + if (centerIn == item->parentItem()) { + QPointF p((item->parentItem()->width() - item->width()) / 2., + (item->parentItem()->height() - item->height()) / 2.); + setItemPos(p); - QPointF p(centerIn->x() + (centerIn->width() - item->width()) / 2., - centerIn->y() + (centerIn->height() - item->height()) / 2.); - setItemPos(p); + } else if (centerIn->parentItem() == item->parentItem()) { + + QPointF p(centerIn->x() + (centerIn->width() - item->width()) / 2., + centerIn->y() + (centerIn->height() - item->height()) / 2.); + setItemPos(p); + } + + --updatingCenterIn; + } else { + // ### Make this certain :) + qmlInfo(QmlGraphicsAnchors::tr("Possible anchor loop detected on centerIn."), item); } } diff --git a/src/declarative/graphicsitems/qmlgraphicsanchors_p_p.h b/src/declarative/graphicsitems/qmlgraphicsanchors_p_p.h index 5f8b2c1..d21d9c5 100644 --- a/src/declarative/graphicsitems/qmlgraphicsanchors_p_p.h +++ b/src/declarative/graphicsitems/qmlgraphicsanchors_p_p.h @@ -89,7 +89,7 @@ class QmlGraphicsAnchorsPrivate : public QObjectPrivate public: QmlGraphicsAnchorsPrivate() : updatingMe(false), updatingHorizontalAnchor(0), - updatingVerticalAnchor(0), item(0), usedAnchors(0), fill(0), + updatingVerticalAnchor(0), updatingFill(0), updatingCenterIn(0), item(0), usedAnchors(0), fill(0), centerIn(0), leftMargin(0), rightMargin(0), topMargin(0), bottomMargin(0), vCenterOffset(0), hCenterOffset(0), baselineOffset(0), componentComplete(true) @@ -109,6 +109,8 @@ public: bool updatingMe; int updatingHorizontalAnchor; int updatingVerticalAnchor; + int updatingFill; + int updatingCenterIn; void setItemHeight(qreal); void setItemWidth(qreal); diff --git a/tests/auto/declarative/anchors/data/crash1.qml b/tests/auto/declarative/anchors/data/crash1.qml new file mode 100644 index 0000000..fd9dc55 --- /dev/null +++ b/tests/auto/declarative/anchors/data/crash1.qml @@ -0,0 +1,11 @@ +import Qt 4.6 + +Column { + Text { + text: "foo" + anchors.fill: parent + } + Text { + text: "bar" + } +} diff --git a/tests/auto/declarative/anchors/tst_anchors.cpp b/tests/auto/declarative/anchors/tst_anchors.cpp index c3a857c..4c85d2d 100644 --- a/tests/auto/declarative/anchors/tst_anchors.cpp +++ b/tests/auto/declarative/anchors/tst_anchors.cpp @@ -62,6 +62,7 @@ private slots: void illegalSets(); void reset(); void nullItem(); + void crash1(); }; /* @@ -248,6 +249,20 @@ void tst_anchors::nullItem() item->anchors()->setBottom(anchor); } +void tst_anchors::crash1() +{ + QmlView *view = new QmlView; + + view->setUrl(QUrl("file://" SRCDIR "/data/crash1.qml")); + + QString expect = "QML QmlGraphicsText (" + view->url().toString() + ":4:5" + ") Possible anchor loop detected on fill."; + QTest::ignoreMessage(QtWarningMsg, expect.toLatin1()); + view->execute(); + qApp->processEvents(); + + delete view; +} + QTEST_MAIN(tst_anchors) #include "tst_anchors.moc" -- cgit v0.12 From dc7acac9552ce556d0388a11f6c5584ea8e10ae3 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 6 Nov 2009 16:15:17 +1000 Subject: Better section testing... and bug fixing. --- .../graphicsitems/qmlgraphicslistview.cpp | 3 ++ .../qmlgraphicslistview/data/listview-sections.qml | 2 +- .../tst_qmlgraphicslistview.cpp | 32 +++++++++++++++++++++- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp index 1f5d51d..59137a7 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp @@ -1748,6 +1748,7 @@ void QmlGraphicsListView::itemsInserted(int modelIndex, int count) d->updateUnrequestedIndexes(); if (!d->visibleItems.count() || d->model->count() <= 1) { d->layout(); + d->updateSections(); d->updateCurrent(qMax(0, qMin(d->currentIndex, d->model->count()-1))); emit countChanged(); return; @@ -1827,6 +1828,7 @@ void QmlGraphicsListView::itemsInserted(int modelIndex, int count) added.at(j)->attached->emitAdd(); d->updateUnrequestedPositions(); d->updateViewport(); + d->updateSections(); emit countChanged(); } @@ -2009,6 +2011,7 @@ void QmlGraphicsListView::itemsMoved(int from, int to, int count) d->visibleItems.first()->setPosition(firstItemPos); d->layout(); + d->updateSections(); } void QmlGraphicsListView::createdItem(int index, QmlGraphicsItem *item) diff --git a/tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml b/tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml index 56700be..2edc0bd 100644 --- a/tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml +++ b/tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml @@ -54,6 +54,6 @@ Rectangle { height: 320 model: testModel delegate: myDelegate - sectionExpression: "Math.floor(index/5)" + sectionExpression: "Math.floor(number/5)" } } diff --git a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp index 9f904b8..0015c48 100644 --- a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp +++ b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp @@ -702,7 +702,7 @@ void tst_QmlGraphicsListView::sections() TestModel model; for (int i = 0; i < 30; i++) - model.addItem("Item" + QString::number(i), ""); + model.addItem("Item" + QString::number(i), QString::number(i)); QmlContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testModel", &model); @@ -724,6 +724,36 @@ void tst_QmlGraphicsListView::sections() QCOMPARE(item->y(), qreal(i*20 + ((i+4)/5) * 20)); } + // Remove section boundary + model.removeItem(5); + + // New section header created + QmlGraphicsItem *item = findItem(viewport, "wrapper", 5); + QVERIFY(item); + QCOMPARE(item->height(), 40.0); + + model.insertItem(3, "New Item", "3"); + + // Section header moved + item = findItem(viewport, "wrapper", 5); + QVERIFY(item); + QCOMPARE(item->height(), 20.0); + + item = findItem(viewport, "wrapper", 6); + QVERIFY(item); + QCOMPARE(item->height(), 40.0); + + // insert item which will become a section header + model.insertItem(6, "Replace header", "5"); + + item = findItem(viewport, "wrapper", 6); + QVERIFY(item); + QCOMPARE(item->height(), 40.0); + + item = findItem(viewport, "wrapper", 7); + QVERIFY(item); + QCOMPARE(item->height(), 20.0); + QVERIFY(listview->currentSection() == "0"); listview->setViewportY(140); -- cgit v0.12 From 2c0aa64a1e59271c5cf212fee869070d881d3a51 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 6 Nov 2009 17:31:55 +1000 Subject: More ListView tests. --- .../graphicsitems/qmlgraphicslistview.cpp | 4 + .../data/listview-initCurrent.qml | 49 +++++++++ .../qmlgraphicslistview/data/listview.qml | 2 + .../tst_qmlgraphicslistview.cpp | 112 +++++++++++++++++---- 4 files changed, 148 insertions(+), 19 deletions(-) create mode 100644 tests/auto/declarative/qmlgraphicslistview/data/listview-initCurrent.qml diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp index 59137a7..a9bc721 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp @@ -1488,6 +1488,8 @@ void QmlGraphicsListView::setHighlightMoveSpeed(qreal speed) if (d->highlightMoveSpeed != speed) { d->highlightMoveSpeed = speed; + if (d->highlightPosAnimator) + d->highlightPosAnimator->setVelocity(d->highlightMoveSpeed); emit highlightMoveSpeedChanged(); } } @@ -1509,6 +1511,8 @@ void QmlGraphicsListView::setHighlightResizeSpeed(qreal speed) if (d->highlightResizeSpeed != speed) { d->highlightResizeSpeed = speed; + if (d->highlightSizeAnimator) + d->highlightSizeAnimator->setVelocity(d->highlightResizeSpeed); emit highlightResizeSpeedChanged(); } } diff --git a/tests/auto/declarative/qmlgraphicslistview/data/listview-initCurrent.qml b/tests/auto/declarative/qmlgraphicslistview/data/listview-initCurrent.qml new file mode 100644 index 0000000..5b1fee6 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicslistview/data/listview-initCurrent.qml @@ -0,0 +1,49 @@ +import Qt 4.6 + +Rectangle { + width: 240 + height: 320 + color: "#ffffff" + resources: [ + Component { + id: myDelegate + Rectangle { + id: wrapper + objectName: "wrapper" + height: 20 + width: 240 + Text { + text: index + } + Text { + x: 30 + id: textName + objectName: "textName" + text: name + } + Text { + x: 120 + id: textNumber + objectName: "textNumber" + text: number + } + Text { + x: 200 + text: wrapper.y + } + color: ListView.isCurrentItem ? "lightsteelblue" : "white" + } + } + ] + ListView { + id: list + objectName: "list" + focus: true + currentIndex: 3 + width: 240 + height: 320 + model: testModel + delegate: myDelegate + highlightMoveSpeed: 1000 + } +} diff --git a/tests/auto/declarative/qmlgraphicslistview/data/listview.qml b/tests/auto/declarative/qmlgraphicslistview/data/listview.qml index b7b838b..93a3ae3 100644 --- a/tests/auto/declarative/qmlgraphicslistview/data/listview.qml +++ b/tests/auto/declarative/qmlgraphicslistview/data/listview.qml @@ -38,9 +38,11 @@ Rectangle { ListView { id: list objectName: "list" + focus: true width: 240 height: 320 model: testModel delegate: myDelegate + highlightMoveSpeed: 1000 } } diff --git a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp index 0015c48..4a33770 100644 --- a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp +++ b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp @@ -72,6 +72,7 @@ private slots: void enforceRange(); void spacing(); void sections(); + void currentIndex(); private: template void items(); @@ -252,6 +253,9 @@ void tst_QmlGraphicsListView::items() QCOMPARE(listview->count(), model.count()); QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item + // current item should be first item + QCOMPARE(listview->currentItem(), findItem(viewport, "wrapper", 0)); + for (int i = 0; i < model.count(); ++i) { QmlGraphicsText *name = findItem(viewport, "textName", i); QVERIFY(name != 0); @@ -261,11 +265,6 @@ void tst_QmlGraphicsListView::items() QCOMPARE(number->text(), model.number(i)); } - listview->incrementCurrentIndex(); - QCOMPARE(listview->currentIndex(), 1); - listview->decrementCurrentIndex(); - QCOMPARE(listview->currentIndex(), 0); - // set an empty model and confirm that items are destroyed T model2; ctxt->setContextProperty("testModel", &model2); @@ -334,7 +333,7 @@ void tst_QmlGraphicsListView::inserted() model.insertItem(1, "Will", "9876"); // let transitions settle. - QTest::qWait(1000); + QTest::qWait(500); QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item @@ -354,7 +353,7 @@ void tst_QmlGraphicsListView::inserted() model.insertItem(0, "Foo", "1111"); // zero index, and current item // let transitions settle. - QTest::qWait(1000); + QTest::qWait(500); QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item @@ -375,14 +374,14 @@ void tst_QmlGraphicsListView::inserted() for (int i = model.count(); i < 30; ++i) model.insertItem(i, "Hello", QString::number(i)); - QTest::qWait(1000); + QTest::qWait(500); listview->setViewportY(80); - QTest::qWait(1000); + QTest::qWait(500); // Insert item outside visible area model.insertItem(1, "Hello", "1324"); - QTest::qWait(1000); + QTest::qWait(500); QVERIFY(listview->viewportY() == 80); @@ -420,7 +419,7 @@ void tst_QmlGraphicsListView::removed() model.removeItem(1); // let transitions settle. - QTest::qWait(1000); + QTest::qWait(500); QmlGraphicsText *name = findItem(viewport, "textName", 1); QVERIFY(name != 0); @@ -442,7 +441,7 @@ void tst_QmlGraphicsListView::removed() model.removeItem(0); // post: top item starts at 20 // let transitions settle. - QTest::qWait(1000); + QTest::qWait(500); name = findItem(viewport, "textName", 0); QVERIFY(name != 0); @@ -463,7 +462,7 @@ void tst_QmlGraphicsListView::removed() // Remove items not visible model.removeItem(18); // let transitions settle. - QTest::qWait(1000); + QTest::qWait(500); // Confirm items positioned correctly itemCount = findItems(viewport, "wrapper").count(); @@ -480,7 +479,7 @@ void tst_QmlGraphicsListView::removed() model.removeItem(1); // post: top item will be at 40 // let transitions settle. - QTest::qWait(1000); + QTest::qWait(500); // Confirm items positioned correctly for (int i = 2; i < 18; ++i) { @@ -492,7 +491,7 @@ void tst_QmlGraphicsListView::removed() listview->setViewportY(40); // That's the top now // let transitions settle. - QTest::qWait(1000); + QTest::qWait(500); // Confirm items positioned correctly itemCount = findItems(viewport, "wrapper").count(); @@ -530,7 +529,7 @@ void tst_QmlGraphicsListView::moved() model.moveItem(1, 4); // let transitions settle. - QTest::qWait(1000); + QTest::qWait(500); QmlGraphicsText *name = findItem(viewport, "textName", 1); QVERIFY(name != 0); @@ -561,7 +560,7 @@ void tst_QmlGraphicsListView::moved() model.moveItem(1, 18); // let transitions settle. - QTest::qWait(1000); + QTest::qWait(500); // Confirm items positioned correctly and indexes correct for (int i = 3; i < model.count() && i < itemCount; ++i) { @@ -581,7 +580,7 @@ void tst_QmlGraphicsListView::moved() model.moveItem(20, 4); // let transitions settle. - QTest::qWait(1000); + QTest::qWait(500); // Confirm items positioned correctly and indexes correct for (int i = 3; i < model.count() && i < itemCount; ++i) { @@ -617,6 +616,9 @@ void tst_QmlGraphicsListView::enforceRange() QmlGraphicsListView *listview = findItem(canvas->root(), "list"); QVERIFY(listview != 0); + QCOMPARE(listview->preferredHighlightBegin(), 100.0); + QCOMPARE(listview->preferredHighlightEnd(), 100.0); + QmlGraphicsItem *viewport = listview->viewport(); QVERIFY(viewport != 0); @@ -634,7 +636,7 @@ void tst_QmlGraphicsListView::enforceRange() // Check currentIndex is updated when viewport moves listview->setViewportY(20); - QTest::qWait(1000); + QTest::qWait(500); QCOMPARE(listview->currentIndex(), 6); @@ -762,6 +764,78 @@ void tst_QmlGraphicsListView::sections() delete canvas; } +void tst_QmlGraphicsListView::currentIndex() +{ + QmlView *canvas = createView(SRCDIR "/data/listview-initCurrent.qml"); + + TestModel model; + for (int i = 0; i < 30; i++) + model.addItem("Item" + QString::number(i), QString::number(i)); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsListView *listview = findItem(canvas->root(), "list"); + QVERIFY(listview != 0); + + QmlGraphicsItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + // current item should be third item + QCOMPARE(listview->currentItem(), findItem(viewport, "wrapper", 3)); + + // no wrap + listview->setCurrentIndex(0); + QCOMPARE(listview->currentIndex(), 0); + + listview->incrementCurrentIndex(); + QCOMPARE(listview->currentIndex(), 1); + listview->decrementCurrentIndex(); + QCOMPARE(listview->currentIndex(), 0); + + listview->decrementCurrentIndex(); + QCOMPARE(listview->currentIndex(), 0); + + // with wrap + listview->setWrapEnabled(true); + + listview->decrementCurrentIndex(); + QCOMPARE(listview->currentIndex(), model.count()-1); + + QTest::qWait(1000); + QCOMPARE(listview->viewportY(), 279.0); + + listview->incrementCurrentIndex(); + QCOMPARE(listview->currentIndex(), 0); + + QTest::qWait(1000); + QCOMPARE(listview->viewportY(), 0.0); + + // Test keys + canvas->show(); + qApp->processEvents(); + + QEvent wa(QEvent::WindowActivate); + QApplication::sendEvent(canvas, &wa); + QFocusEvent fe(QEvent::FocusIn); + QApplication::sendEvent(canvas, &fe); + + QKeyEvent key(QEvent::KeyPress, Qt::Key_Down, Qt::NoModifier, "", false, 1); + QApplication::sendEvent(canvas, &key); + QVERIFY(key.isAccepted()); + QCOMPARE(listview->currentIndex(), 1); + + key = QKeyEvent(QEvent::KeyPress, Qt::Key_Up, Qt::NoModifier, "", false, 1); + QApplication::sendEvent(canvas, &key); + QVERIFY(key.isAccepted()); + QCOMPARE(listview->currentIndex(), 0); + + delete canvas; +} + void tst_QmlGraphicsListView::qListModelInterface_items() { items(); -- cgit v0.12 From 565b78b3bd4b31761652f46b5fc2e0694adbc4df Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 6 Nov 2009 18:33:44 +1000 Subject: Remove dead code --- src/declarative/qml/qmldom.cpp | 7 --- src/declarative/qml/qmlparser.cpp | 94 --------------------------------------- src/declarative/qml/qmlparser_p.h | 6 --- 3 files changed, 107 deletions(-) diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp index b6e794b..39d6730 100644 --- a/src/declarative/qml/qmldom.cpp +++ b/src/declarative/qml/qmldom.cpp @@ -52,8 +52,6 @@ QT_BEGIN_NAMESPACE -DEFINE_BOOL_CONFIG_OPTION(compilerDump, QML_COMPILER_DUMP) - QmlDomDocumentPrivate::QmlDomDocumentPrivate() : root(0) { @@ -191,11 +189,6 @@ bool QmlDomDocument::load(QmlEngine *engine, const QByteArray &data, const QUrl } if (td->data.tree()) { - if (compilerDump()) { - qWarning() << "-AST------------------------------------------------------------------------------"; - td->data.tree()->dump(); - qWarning() << "----------------------------------------------------------------------------------"; - } d->root = td->data.tree(); d->root->addref(); } diff --git a/src/declarative/qml/qmlparser.cpp b/src/declarative/qml/qmlparser.cpp index 7fd57f3..ee69b14 100644 --- a/src/declarative/qml/qmlparser.cpp +++ b/src/declarative/qml/qmlparser.cpp @@ -200,28 +200,6 @@ QmlParser::Object::DynamicSlot::DynamicSlot(const DynamicSlot &o) { } -void QmlParser::Object::dump(int indent) const -{ - QByteArray ba(indent * 4, ' '); - if (type != -1) { - qWarning() << ba.constData() << "Object:" << typeName; - } else { - qWarning() << ba.constData() << "Object: fetched"; - } - - for (QHash::ConstIterator iter = properties.begin(); - iter != properties.end(); - ++iter) { - qWarning() << ba.constData() << " Property" << iter.key(); - (*iter)->dump(indent + 1); - } - - if (defaultProperty) { - qWarning() << ba.constData() << " Default property"; - defaultProperty->dump(indent + 1); - } -} - QmlParser::Property::Property() : parent(0), type(0), index(-1), value(0), isDefault(true), isDeferred(false) { @@ -256,15 +234,6 @@ bool QmlParser::Property::isEmpty() const return !value && values.isEmpty(); } -void QmlParser::Property::dump(int indent) const -{ - QByteArray ba(indent * 4, ' '); - for (int ii = 0; ii < values.count(); ++ii) - values.at(ii)->dump(indent); - if (value) - value->dump(indent); -} - QmlParser::Value::Value() : type(Unknown), object(0) { @@ -275,69 +244,6 @@ QmlParser::Value::~Value() if (object) object->release(); } -void QmlParser::Value::dump(int indent) const -{ - QByteArray type; - switch(this->type) { - default: - case Value::Unknown: - type = "Unknown"; - break; - case Value::Literal: - type = "Literal"; - break; - case Value::PropertyBinding: - type = "PropertyBinding"; - break; - case Value::ValueSource: - type = "ValueSource"; - break; - case Value::ValueInterceptor: - type = "ValueInterceptor"; - break; - case Value::CreatedObject: - type = "CreatedObject"; - break; - case Value::SignalObject: - type = "SignalObject"; - break; - case Value::SignalExpression: - type = "SignalExpression"; - break; - case Value::Id: - type = "Id"; - break; - } - - QByteArray primType; - switch(this->value.type()) { - default: - case Variant::Invalid: - primType = "Invalid"; - break; - case Variant::Boolean: - primType = "Boolean"; - break; - case Variant::Number: - primType = "Number"; - break; - case Variant::String: - primType = "String"; - break; - case Variant::Script: - primType = "Script"; - break; - } - - QByteArray ba(indent * 4, ' '); - if (object) { - qWarning() << ba.constData() << "Value (" << type << "):"; - object->dump(indent + 1); - } else { - qWarning() << ba.constData() << "Value (" << type << "):" << primType.constData() << primitive(); - } -} - QmlParser::Variant::Variant() : t(Invalid) {} diff --git a/src/declarative/qml/qmlparser_p.h b/src/declarative/qml/qmlparser_p.h index 5bffff2..4f080e5 100644 --- a/src/declarative/qml/qmlparser_p.h +++ b/src/declarative/qml/qmlparser_p.h @@ -216,8 +216,6 @@ namespace QmlParser QList dynamicSignals; // The list of dynamic slots QList dynamicSlots; - - void dump(int = 0) const; }; class Variant @@ -299,8 +297,6 @@ namespace QmlParser Object *object; LocationSpan location; - - void dump(int = 0) const; }; class Property : public QmlRefCount @@ -342,8 +338,6 @@ namespace QmlParser LocationSpan location; LocationRange listValueRange; QList listCommaPositions; - - void dump(int = 0) const; }; } -- cgit v0.12 From c4929ce81b6a4ee236cd67f7bb3faf5ae7367530 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 6 Nov 2009 18:34:08 +1000 Subject: Add visual test -listtests option --- tests/auto/declarative/visual/tst_visual.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tests/auto/declarative/visual/tst_visual.cpp b/tests/auto/declarative/visual/tst_visual.cpp index e40dec7..5a5318a 100644 --- a/tests/auto/declarative/visual/tst_visual.cpp +++ b/tests/auto/declarative/visual/tst_visual.cpp @@ -59,13 +59,13 @@ public: static QString toTestScript(const QString &, Mode=Test); static QString viewer(); + static QStringList findQmlFiles(const QDir &d); private slots: void visual_data(); void visual(); private: QString qmlviewer; - QStringList findQmlFiles(const QDir &d); }; @@ -257,6 +257,7 @@ void usage() { fprintf(stderr, "\n"); fprintf(stderr, "QML related options\n"); + fprintf(stderr, " -listtests : list all the tests seen by tst_visual, and then exit immediately\n"); fprintf(stderr, " -record file : record new test data for file\n"); fprintf(stderr, " -recordnovisuals file : record new test data for file, but ignore visuals\n"); fprintf(stderr, " -play file : playback test data for file, printing errors\n"); @@ -267,12 +268,12 @@ void usage() "Visual tests are recordings of manual interactions with a QML test,\n" "that can then be run automatically. To record a new test, run:\n" "\n" - " tst_visuals -record yourtestdir/yourtest # Note, no .qml extension\n" + " tst_visual -record yourtestdir/yourtest.qml\n" "\n" "This records everything you do (try to keep it short).\n" "To play back a test, run:\n" "\n" - " tst_visuals -play yourtestdir/yourtest\n" + " tst_visual -play yourtestdir/yourtest.qml\n" "\n" "Your test may include QML code to test itself, reporting any error to an\n" "'error' property on the root object - the test will fail if this property\n" @@ -281,7 +282,7 @@ void usage() "If your test changes slightly but is still correct (check with -play), you\n" "can update the visuals by running:\n" "\n" - " tst_visuals -updatevisuals yourtestdir/yourtest\n" + " tst_visual -updatevisuals yourtestdir/yourtest.qml\n" "\n" "If your test includes platform-sensitive visuals (eg. text in system fonts),\n" "you should create platform-specific visuals, using -updateplatformvisuals\n" @@ -332,10 +333,18 @@ int main(int argc, char **argv) newArgv[newArgc++] = argv[ii]; } - if (arg == "-help" || arg == "-?") { + if (arg == "-help" || arg == "-?" || arg == "--help") { atexit(usage); showHelp = true; } + + if (arg == "-listtests") { + QStringList list = tst_visual::findQmlFiles(QDir(QT_TEST_SOURCE_DIR)); + foreach (QString test, list) { + qWarning() << qPrintable(test); + } + return 0; + } } if (mode == Test || showHelp) { -- cgit v0.12 From ff93d358481aba86c77f12202269cda394533270 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 6 Nov 2009 09:52:09 +0100 Subject: Export symbols for class QmlContextPrivate Bauhaus needs a way to e.g. change the context hierarchy, and force the reevaluation of bindings. This cannot be done (right now) through the public QmlContext API. Reviewed-by: akennedy --- src/declarative/qml/qmlcontext_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/qml/qmlcontext_p.h b/src/declarative/qml/qmlcontext_p.h index 7f9be0f..22d981f 100644 --- a/src/declarative/qml/qmlcontext_p.h +++ b/src/declarative/qml/qmlcontext_p.h @@ -74,7 +74,7 @@ class QmlExpressionPrivate; class QmlAbstractExpression; class QmlBinding_Id; -class QmlContextPrivate : public QObjectPrivate +class Q_DECLARATIVE_EXPORT QmlContextPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QmlContext) public: -- cgit v0.12 From 2d60177787320c4dc1e9778a6c2975a3f09e658e Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 6 Nov 2009 19:07:30 +1000 Subject: parserstress autotest This stress tests our JS parser to ensure that it can parse embedded script blocks correctly. --- tests/auto/declarative/declarative.pro | 1 + .../auto/declarative/parserstress/parserstress.pro | 7 + .../declarative/parserstress/tst_parserstress.cpp | 141 +++++++++++++++++++++ 3 files changed, 149 insertions(+) create mode 100644 tests/auto/declarative/parserstress/parserstress.pro create mode 100644 tests/auto/declarative/parserstress/tst_parserstress.cpp diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 64672f6..000ceb3 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -10,6 +10,7 @@ SUBDIRS += \ qmlgraphicslistview \ # Cover qmlgraphicsgridview \ # Cover numberformatter \ # Cover + parserstress \ # Cover pathview \ # Cover qfxloader \ # Cover qfxtextedit \ # Cover diff --git a/tests/auto/declarative/parserstress/parserstress.pro b/tests/auto/declarative/parserstress/parserstress.pro new file mode 100644 index 0000000..48f147a --- /dev/null +++ b/tests/auto/declarative/parserstress/parserstress.pro @@ -0,0 +1,7 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + +SOURCES += tst_parserstress.cpp + +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/parserstress/tst_parserstress.cpp b/tests/auto/declarative/parserstress/tst_parserstress.cpp new file mode 100644 index 0000000..dd8f347 --- /dev/null +++ b/tests/auto/declarative/parserstress/tst_parserstress.cpp @@ -0,0 +1,141 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include +#include +#include +#include +#include + +class tst_parserstress : public QObject +{ + Q_OBJECT +public: + tst_parserstress() {} + +private slots: + void ecmascript_data(); + void ecmascript(); + +private: + static QStringList findJSFiles(const QDir &); + QmlEngine engine; +}; + +QStringList tst_parserstress::findJSFiles(const QDir &d) +{ + QStringList rv; + + QStringList files = d.entryList(QStringList() << QLatin1String("*.js"), + QDir::Files); + foreach (const QString &file, files) { + if (file == "browser.js") + continue; + rv << d.absoluteFilePath(file); + } + + QStringList dirs = d.entryList(QDir::Dirs | QDir::NoDotAndDotDot | + QDir::NoSymLinks); + foreach (const QString &dir, dirs) { + QDir sub = d; + sub.cd(dir); + rv << findJSFiles(sub); + } + + return rv; +} + +void tst_parserstress::ecmascript_data() +{ + QDir dir(SRCDIR); + dir.cdUp(); + dir.cdUp(); + dir.cd("qscriptjstestsuite"); + dir.cd("tests"); + + QStringList files = findJSFiles(dir); + + QTest::addColumn("file"); + foreach (const QString &file, files) { + QTest::newRow(qPrintable(file)) << file; + } +} + +void tst_parserstress::ecmascript() +{ + QFETCH(QString, file); + + QFile f(file); + QVERIFY(f.open(QIODevice::ReadOnly)); + + QByteArray data = f.readAll(); + + QVERIFY(!data.isEmpty()); + + QString dataStr = QString::fromUtf8(data); + + QString qml = "import Qt 4.6\n"; + qml+= "\n"; + qml+= "Object {\n"; + qml+= " property int test\n"; + qml+= " test: {\n"; + qml+= dataStr + "\n"; + qml+= " return 1;\n"; + qml+= " }\n"; + qml+= " Script {\n"; + qml+= " function stress() {\n"; + qml+= dataStr; + qml+= " }\n"; + qml+= " }\n"; + qml+= "}\n"; + + QByteArray qmlData = qml.toUtf8(); + + QmlComponent component(&engine, qmlData, + QUrl::fromLocalFile(SRCDIR + QString("/dummy.qml"))); + QVERIFY(!component.isError()); +} + + +QTEST_MAIN(tst_parserstress) + +#include "tst_parserstress.moc" -- cgit v0.12 From 371856e3e37670ae5333f2d170d56f867e1350d7 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 3 Nov 2009 14:05:00 +0100 Subject: Compile... Reviewed-by: TrustMe --- src/gui/styles/qwindowsxpstyle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp index 9fd9ce9..fe7f5d7 100644 --- a/src/gui/styles/qwindowsxpstyle.cpp +++ b/src/gui/styles/qwindowsxpstyle.cpp @@ -2926,10 +2926,10 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo } // Draw arrow p->save(); - p->setPen(option->palette.dark()); + p->setPen(option->palette.dark().color()); p->drawLine(menuarea.left(), menuarea.top() + 3, menuarea.left(), menuarea.bottom() - 3); - p->setPen(option->palette.light()); + p->setPen(option->palette.light().color()); p->drawLine(menuarea.left() - 1, menuarea.top() + 3, menuarea.left() - 1, menuarea.bottom() - 3); -- cgit v0.12 From 3ceeb87db6b6f7beeffe9df0417bd076fa72eece Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Fri, 6 Nov 2009 14:18:42 +0100 Subject: qdoc3: Output the full signature for QML signals and methods In the Method Documentation and Signal Documentation sections. --- tools/qdoc3/cppcodemarker.cpp | 2 ++ tools/qdoc3/htmlgenerator.cpp | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp index f3188bd..a8f6a02 100644 --- a/tools/qdoc3/cppcodemarker.cpp +++ b/tools/qdoc3/cppcodemarker.cpp @@ -194,6 +194,8 @@ QString CppCodeMarker::markedUpSynopsis(const Node *node, synopsis = "class " + name; break; case Node::Function: + case Node::QmlSignal: + case Node::QmlMethod: func = (const FunctionNode *) node; if (style != SeparateList && !func->returnType().isEmpty()) synopsis = typified(func->returnType()) + " "; diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index ae47fc0..f0ddade 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -4224,7 +4224,8 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, out() << ""; out() << ""; out() << "
"; out() << ""; - generateQmlItem(qsn,relative,marker,false); + generateSynopsis(qsn,relative,marker,CodeMarker::Detailed,false); + //generateQmlItem(qsn,relative,marker,false); out() << "
"; out() << ""; @@ -4235,7 +4236,7 @@ void HtmlGenerator::generateDetailedQmlMember(const Node *node, out() << ""; out() << ""; out() << "
"; out() << ""; - generateQmlItem(qmn,relative,marker,false); + generateSynopsis(qmn,relative,marker,CodeMarker::Detailed,false); out() << "
"; out() << ""; -- cgit v0.12 From b615f8667dfc9a36a9bef2bc2e2e509a9a2e478a Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 9 Nov 2009 09:30:15 +1000 Subject: Fix Flickable.flickDeceleration docs --- src/declarative/graphicsitems/qmlgraphicsflickable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp index b030495..ea9c173 100644 --- a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp +++ b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp @@ -1177,7 +1177,7 @@ void QmlGraphicsFlickable::setMaximumFlickVelocity(qreal v) } /*! - \qmlproperty real Flickable::maximumFlickVelocity + \qmlproperty real Flickable::flickDeceleration This property holds the rate at which a flick will decelerate. The default is 500. -- cgit v0.12 From 76c1d526022220f487bee0384eca586d680e5eb2 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 9 Nov 2009 10:51:21 +1000 Subject: Fix initialization of currentIndex and add test. --- .../graphicsitems/qmlgraphicslistview.cpp | 30 ++++++++++++++-------- .../tst_qmlgraphicslistview.cpp | 14 +++++++--- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp index a9bc721..33159a7 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp @@ -434,7 +434,6 @@ void QmlGraphicsListViewPrivate::clear() visibleIndex = 0; releaseItem(currentItem); currentItem = 0; - currentIndex = -1; createHighlight(); trackedItem = 0; } @@ -746,7 +745,7 @@ void QmlGraphicsListViewPrivate::updateCurrentSection() void QmlGraphicsListViewPrivate::updateCurrent(int modelIndex) { Q_Q(QmlGraphicsListView); - if (!isValid() || modelIndex < 0 || modelIndex >= model->count()) { + if (!q->isComponentComplete() || !isValid() || modelIndex < 0 || modelIndex >= model->count()) { if (currentItem) { currentItem->attached->setIsCurrentItem(false); releaseItem(currentItem); @@ -1114,16 +1113,20 @@ void QmlGraphicsListView::setModel(const QVariant &model) dataModel->setModel(model); } if (d->model) { - if (d->currentIndex >= d->model->count() || d->currentIndex < 0) - setCurrentIndex(0); - else - d->updateCurrent(d->currentIndex); + if (isComponentComplete()) { + refill(); + if (d->currentIndex >= d->model->count() || d->currentIndex < 0) { + setCurrentIndex(0); + } else { + d->moveReason = QmlGraphicsListViewPrivate::SetIndex; + d->updateCurrent(d->currentIndex); + } + } connect(d->model, SIGNAL(itemsInserted(int,int)), this, SLOT(itemsInserted(int,int))); connect(d->model, SIGNAL(itemsRemoved(int,int)), this, SLOT(itemsRemoved(int,int))); connect(d->model, SIGNAL(itemsMoved(int,int,int)), this, SLOT(itemsMoved(int,int,int))); connect(d->model, SIGNAL(createdItem(int, QmlGraphicsItem*)), this, SLOT(createdItem(int,QmlGraphicsItem*))); connect(d->model, SIGNAL(destroyingItem(QmlGraphicsItem*)), this, SLOT(destroyingItem(QmlGraphicsItem*))); - refill(); emit countChanged(); } } @@ -1156,8 +1159,11 @@ void QmlGraphicsListView::setDelegate(QmlComponent *delegate) } if (QmlGraphicsVisualDataModel *dataModel = qobject_cast(d->model)) { dataModel->setDelegate(delegate); - d->updateCurrent(d->currentIndex); - refill(); + if (isComponentComplete()) { + refill(); + d->moveReason = QmlGraphicsListViewPrivate::SetIndex; + d->updateCurrent(d->currentIndex); + } } } @@ -1178,7 +1184,7 @@ int QmlGraphicsListView::currentIndex() const void QmlGraphicsListView::setCurrentIndex(int index) { Q_D(QmlGraphicsListView); - if (d->isValid() && index != d->currentIndex && index < d->model->count() && index >= 0) { + if (isComponentComplete() && d->isValid() && index != d->currentIndex && index < d->model->count() && index >= 0) { d->moveReason = QmlGraphicsListViewPrivate::SetIndex; cancelFlick(); d->updateCurrent(index); @@ -1670,9 +1676,11 @@ void QmlGraphicsListView::componentComplete() { Q_D(QmlGraphicsListView); QmlGraphicsFlickable::componentComplete(); + refill(); if (d->currentIndex < 0) d->updateCurrent(0); - refill(); + else + d->updateCurrent(d->currentIndex); d->fixupPosition(); } diff --git a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp index 4a33770..de26635 100644 --- a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp +++ b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp @@ -69,10 +69,10 @@ private slots: void qListModelInterface_moved(); void qAbstractItemModel_moved(); + void currentIndex(); void enforceRange(); void spacing(); void sections(); - void currentIndex(); private: template void items(); @@ -766,15 +766,22 @@ void tst_QmlGraphicsListView::sections() void tst_QmlGraphicsListView::currentIndex() { - QmlView *canvas = createView(SRCDIR "/data/listview-initCurrent.qml"); - TestModel model; for (int i = 0; i < 30; i++) model.addItem("Item" + QString::number(i), QString::number(i)); + QmlView *canvas = new QmlView(0); + canvas->setFixedSize(240,320); + QmlContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testModel", &model); + QString filename(SRCDIR "/data/listview-initCurrent.qml"); + QFile file(filename); + file.open(QFile::ReadOnly); + QString qml = file.readAll(); + canvas->setQml(qml, filename); + canvas->execute(); qApp->processEvents(); @@ -785,6 +792,7 @@ void tst_QmlGraphicsListView::currentIndex() QVERIFY(viewport != 0); // current item should be third item + QCOMPARE(listview->currentIndex(), 3); QCOMPARE(listview->currentItem(), findItem(viewport, "wrapper", 3)); // no wrap -- cgit v0.12 From 766251f5eb9af692f6cfc155471c4a58f5d5be3d Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Mon, 9 Nov 2009 11:17:16 +1000 Subject: Doc. --- src/declarative/graphicsitems/qmlgraphicslistview.cpp | 14 +++++++------- src/declarative/graphicsitems/qmlgraphicslistview_p.h | 5 +++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp index 33159a7..53287a6 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp +++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp @@ -1260,7 +1260,7 @@ void QmlGraphicsListView::setHighlight(QmlComponent *highlight) is scrolled. This is because the view moves to maintain the highlight within the preferred highlight range (or visible viewport). - \sa highlight + \sa highlight, highlightMoveSpeed */ bool QmlGraphicsListView::highlightFollowsCurrentItem() const { @@ -1479,8 +1479,13 @@ QString QmlGraphicsListView::currentSection() const /*! \qmlproperty real ListView::highlightMoveSpeed + \qmlproperty real ListView::highlightResizeSpeed + These properties hold the move and resize animation speed of the highlight delegate. + + highlightFollowsCurrentItem must be true for these properties + to have effect. - This property holds the moving animation speed of the highlight delegate. + \sa highlightFollowsCurrentItem */ qreal QmlGraphicsListView::highlightMoveSpeed() const { @@ -1500,11 +1505,6 @@ void QmlGraphicsListView::setHighlightMoveSpeed(qreal speed) } } -/*! - \qmlproperty real ListView::highlightResizeSpeed - - This property holds the resizing animation speed of the highlight delegate. -*/ qreal QmlGraphicsListView::highlightResizeSpeed() const { Q_D(const QmlGraphicsListView);\ diff --git a/src/declarative/graphicsitems/qmlgraphicslistview_p.h b/src/declarative/graphicsitems/qmlgraphicslistview_p.h index 446d71a..3f46434 100644 --- a/src/declarative/graphicsitems/qmlgraphicslistview_p.h +++ b/src/declarative/graphicsitems/qmlgraphicslistview_p.h @@ -64,8 +64,11 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsListView : public QmlGraphicsFlickable Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged) Q_PROPERTY(QmlGraphicsItem *currentItem READ currentItem NOTIFY currentIndexChanged) Q_PROPERTY(int count READ count NOTIFY countChanged) + Q_PROPERTY(QmlComponent *highlight READ highlight WRITE setHighlight) Q_PROPERTY(bool highlightFollowsCurrentItem READ highlightFollowsCurrentItem WRITE setHighlightFollowsCurrentItem) + Q_PROPERTY(qreal highlightMoveSpeed READ highlightMoveSpeed WRITE setHighlightMoveSpeed NOTIFY highlightMoveSpeedChanged) + Q_PROPERTY(qreal highlightResizeSpeed READ highlightResizeSpeed WRITE setHighlightResizeSpeed NOTIFY highlightResizeSpeedChanged) Q_PROPERTY(qreal preferredHighlightBegin READ preferredHighlightBegin WRITE setPreferredHighlightBegin) Q_PROPERTY(qreal preferredHighlightEnd READ preferredHighlightEnd WRITE setPreferredHighlightEnd) @@ -78,8 +81,6 @@ class Q_DECLARATIVE_EXPORT QmlGraphicsListView : public QmlGraphicsFlickable Q_PROPERTY(QString sectionExpression READ sectionExpression WRITE setSectionExpression NOTIFY sectionExpressionChanged) Q_PROPERTY(QString currentSection READ currentSection NOTIFY currentSectionChanged) - Q_PROPERTY(qreal highlightMoveSpeed READ highlightMoveSpeed WRITE setHighlightMoveSpeed NOTIFY highlightMoveSpeedChanged) - Q_PROPERTY(qreal highlightResizeSpeed READ highlightResizeSpeed WRITE setHighlightResizeSpeed NOTIFY highlightResizeSpeedChanged) Q_ENUMS(HighlightRangeMode) Q_ENUMS(Orientation) Q_CLASSINFO("DefaultProperty", "data") -- cgit v0.12 From 7b5ecf9d033708bbc86e8b2901e3634970b6d9ab Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Mon, 9 Nov 2009 12:10:34 +1000 Subject: Rename TextEdit and TextInput autotests --- tests/auto/declarative/declarative.pro | 4 +- .../declarative/qfxtextedit/data/cursorTest.qml | 8 - .../declarative/qfxtextedit/data/navigation.qml | 23 - tests/auto/declarative/qfxtextedit/qfxtextedit.pro | 8 - .../declarative/qfxtextedit/tst_qfxtextedit.cpp | 555 --------------------- .../declarative/qfxtextinput/data/cursorTest.qml | 8 - .../declarative/qfxtextinput/data/navigation.qml | 23 - .../auto/declarative/qfxtextinput/qfxtextinput.pro | 8 - .../declarative/qfxtextinput/tst_qfxtextinput.cpp | 422 ---------------- .../qmlgraphicstextedit/data/cursorTest.qml | 8 + .../qmlgraphicstextedit/data/navigation.qml | 23 + .../qmlgraphicstextedit/qmlgraphicstextedit.pro | 8 + .../tst_qmlgraphicstextedit.cpp | 555 +++++++++++++++++++++ .../qmlgraphicstextinput/data/cursorTest.qml | 8 + .../qmlgraphicstextinput/data/navigation.qml | 23 + .../qmlgraphicstextinput/qmlgraphicstextinput.pro | 8 + .../tst_qmlgraphicstextinput.cpp | 422 ++++++++++++++++ 17 files changed, 1057 insertions(+), 1057 deletions(-) delete mode 100644 tests/auto/declarative/qfxtextedit/data/cursorTest.qml delete mode 100644 tests/auto/declarative/qfxtextedit/data/navigation.qml delete mode 100644 tests/auto/declarative/qfxtextedit/qfxtextedit.pro delete mode 100644 tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp delete mode 100644 tests/auto/declarative/qfxtextinput/data/cursorTest.qml delete mode 100644 tests/auto/declarative/qfxtextinput/data/navigation.qml delete mode 100644 tests/auto/declarative/qfxtextinput/qfxtextinput.pro delete mode 100644 tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp create mode 100644 tests/auto/declarative/qmlgraphicstextedit/data/cursorTest.qml create mode 100644 tests/auto/declarative/qmlgraphicstextedit/data/navigation.qml create mode 100644 tests/auto/declarative/qmlgraphicstextedit/qmlgraphicstextedit.pro create mode 100644 tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp create mode 100644 tests/auto/declarative/qmlgraphicstextinput/data/cursorTest.qml create mode 100644 tests/auto/declarative/qmlgraphicstextinput/data/navigation.qml create mode 100644 tests/auto/declarative/qmlgraphicstextinput/qmlgraphicstextinput.pro create mode 100644 tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 000ceb3..b6d2241 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -13,8 +13,6 @@ SUBDIRS += \ parserstress \ # Cover pathview \ # Cover qfxloader \ # Cover - qfxtextedit \ # Cover - qfxtextinput \ # Cover qmetaobjectbuilder \ # Cover qmlbinding \ # Cover qmlconnection \ # Cover @@ -27,6 +25,8 @@ SUBDIRS += \ qmlgraphicsborderimage \ # Cover qmlgraphicsparticles \ # Cover qmlgraphicstext \ # Cover + qmlgraphicstextedit \ # Cover + qmlgraphicstextinput \ # Cover qmlgraphicswebview \ # Cover qmlinfo \ # Cover qmllanguage \ # Cover diff --git a/tests/auto/declarative/qfxtextedit/data/cursorTest.qml b/tests/auto/declarative/qfxtextedit/data/cursorTest.qml deleted file mode 100644 index e5df8f1..0000000 --- a/tests/auto/declarative/qfxtextedit/data/cursorTest.qml +++ /dev/null @@ -1,8 +0,0 @@ -import Qt 4.6 - -Rectangle { width: 300; height: 300; color: "white" - TextEdit { text: "Hello world!"; id: textEditObject; objectName: "textEditObject" - resources: [ Component { id:cursor; Item { id:cursorInstance; objectName: "cursorInstance" } } ] - cursorDelegate: cursor - } -} diff --git a/tests/auto/declarative/qfxtextedit/data/navigation.qml b/tests/auto/declarative/qfxtextedit/data/navigation.qml deleted file mode 100644 index 5b8613f..0000000 --- a/tests/auto/declarative/qfxtextedit/data/navigation.qml +++ /dev/null @@ -1,23 +0,0 @@ -import Qt 4.6 - -Rectangle { - property var myInput: Input - - width: 800; height: 600; color: "blue" - - Item { - id: FirstItem; - KeyNavigation.right: Input - } - - TextEdit { id: Input; focus: true - KeyNavigation.left: FirstItem - KeyNavigation.right: LastItem - KeyNavigation.up: FirstItem - KeyNavigation.down: LastItem - } - Item { - id: LastItem - KeyNavigation.left: Input - } -} diff --git a/tests/auto/declarative/qfxtextedit/qfxtextedit.pro b/tests/auto/declarative/qfxtextedit/qfxtextedit.pro deleted file mode 100644 index b5e0464..0000000 --- a/tests/auto/declarative/qfxtextedit/qfxtextedit.pro +++ /dev/null @@ -1,8 +0,0 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui -macx:CONFIG -= app_bundle - -SOURCES += tst_qfxtextedit.cpp - -# Define SRCDIR equal to test's source directory -DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp b/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp deleted file mode 100644 index 19d5998..0000000 --- a/tests/auto/declarative/qfxtextedit/tst_qfxtextedit.cpp +++ /dev/null @@ -1,555 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -#include "../../../shared/util.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class tst_qfxtextedit : public QObject - -{ - Q_OBJECT -public: - tst_qfxtextedit(); - -private slots: - void text(); - void width(); - void wrap(); - - // ### these tests may be trivial - void hAlign(); - void vAlign(); - void font(); - void color(); - void selection(); - - void cursorDelegate(); - void navigation(); - -private: - void simulateKey(QmlView *, int key); - QmlView *createView(const QString &filename); - - QStringList standard; - QStringList richText; - - QStringList hAlignmentStrings; - QStringList vAlignmentStrings; - - QList vAlignments; - QList hAlignments; - - QStringList colorStrings; - - QmlEngine engine; -}; - -tst_qfxtextedit::tst_qfxtextedit() -{ - standard << "the quick brown fox jumped over the lazy dog" - << "the quick brown fox\n jumped over the lazy dog"; - - richText << "the quick brown fox jumped over the lazy dog" - << "the quick brown fox
jumped over the lazy dog
"; - - hAlignmentStrings << "AlignLeft" - << "AlignRight" - << "AlignHCenter"; - - vAlignmentStrings << "AlignTop" - << "AlignBottom" - << "AlignVCenter"; - - hAlignments << Qt::AlignLeft - << Qt::AlignRight - << Qt::AlignHCenter; - - vAlignments << Qt::AlignTop - << Qt::AlignBottom - << Qt::AlignVCenter; - - colorStrings << "aliceblue" - << "antiquewhite" - << "aqua" - << "darkkhaki" - << "darkolivegreen" - << "dimgray" - << "palevioletred" - << "lightsteelblue" - << "#000000" - << "#AAAAAA" - << "#FFFFFF" - << "#2AC05F"; - // - // need a different test to do alpha channel test - // << "#AA0011DD" - // << "#00F16B11"; - // -} - -void tst_qfxtextedit::text() -{ - { - QmlComponent texteditComponent(&engine, "import Qt 4.6\nTextEdit { text: \"\" }", QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->text(), QString("")); - } - - for (int i = 0; i < standard.size(); i++) - { - QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + standard.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->text(), standard.at(i)); - } - - for (int i = 0; i < richText.size(); i++) - { - QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + richText.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QString actual = textEditObject->text(); - QString expected = richText.at(i); - actual.replace(QRegExp(".*]*>"),""); - actual.replace(QRegExp("(<[^>]*>)+"),"<>"); - expected.replace(QRegExp("(<[^>]*>)+"),"<>"); - QCOMPARE(actual.simplified(),expected.simplified()); - } -} - -void tst_qfxtextedit::width() -{ - // uses Font metrics to find the width for standard and document to find the width for rich - { - QmlComponent texteditComponent(&engine, "import Qt 4.6\nTextEdit { text: \"\" }", QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->width(), 1.);//+1 for cursor - } - - for (int i = 0; i < standard.size(); i++) - { - QFont f; - QFontMetricsF fm(f); - qreal metricWidth = fm.size(Qt::TextExpandTabs && Qt::TextShowMnemonic, standard.at(i)).width(); - metricWidth = floor(metricWidth); - - QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + standard.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->width(), qreal(metricWidth + 1 + 3));//+3 is the current way of accounting for space between cursor and last character. - } - - for (int i = 0; i < richText.size(); i++) - { - QTextDocument document; - document.setHtml(richText.at(i)); - document.setDocumentMargin(0); - - int documentWidth = document.idealWidth(); - - QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + richText.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->width(), qreal(documentWidth + 1 + 3)); - } -} - -void tst_qfxtextedit::wrap() -{ - // for specified width and wrap set true - { - QmlComponent texteditComponent(&engine, "import Qt 4.6\nTextEdit { text: \"\"; wrap: true; width: 300 }", QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->width(), 300.); - } - - for (int i = 0; i < standard.size(); i++) - { - QString componentStr = "import Qt 4.6\nTextEdit { wrap: true; width: 300; text: \"" + standard.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->width(), 300.); - } - - for (int i = 0; i < richText.size(); i++) - { - QString componentStr = "import Qt 4.6\nTextEdit { wrap: true; width: 300; text: \"" + richText.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->width(), 300.); - } - -} - -//the alignment tests may be trivial o.oa -void tst_qfxtextedit::hAlign() -{ - //test one align each, and then test if two align fails. - - for (int i = 0; i < standard.size(); i++) - { - for (int j=0; j < hAlignmentStrings.size(); j++) - { - QString componentStr = "import Qt 4.6\nTextEdit { horizontalAlignment: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE((int)textEditObject->hAlign(), (int)hAlignments.at(j)); - } - } - - for (int i = 0; i < richText.size(); i++) - { - for (int j=0; j < hAlignmentStrings.size(); j++) - { - QString componentStr = "import Qt 4.6\nTextEdit { horizontalAlignment: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE((int)textEditObject->hAlign(), (int)hAlignments.at(j)); - } - } - -} - -void tst_qfxtextedit::vAlign() -{ - //test one align each, and then test if two align fails. - - for (int i = 0; i < standard.size(); i++) - { - for (int j=0; j < vAlignmentStrings.size(); j++) - { - QString componentStr = "import Qt 4.6\nTextEdit { verticalAlignment: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE((int)textEditObject->vAlign(), (int)vAlignments.at(j)); - } - } - - for (int i = 0; i < richText.size(); i++) - { - for (int j=0; j < vAlignmentStrings.size(); j++) - { - QString componentStr = "import Qt 4.6\nTextEdit { verticalAlignment: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE((int)textEditObject->vAlign(), (int)vAlignments.at(j)); - } - } - -} - -void tst_qfxtextedit::font() -{ - //test size, then bold, then italic, then family - { - QString componentStr = "import Qt 4.6\nTextEdit { font.pointSize: 40; text: \"Hello World\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->font().pointSize(), 40); - QCOMPARE(textEditObject->font().bold(), false); - QCOMPARE(textEditObject->font().italic(), false); - } - - { - QString componentStr = "import Qt 4.6\nTextEdit { font.bold: true; text: \"Hello World\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->font().bold(), true); - QCOMPARE(textEditObject->font().italic(), false); - } - - { - QString componentStr = "import Qt 4.6\nTextEdit { font.italic: true; text: \"Hello World\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->font().italic(), true); - QCOMPARE(textEditObject->font().bold(), false); - } - - { - QString componentStr = "import Qt 4.6\nTextEdit { font.family: \"Helvetica\"; text: \"Hello World\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->font().family(), QString("Helvetica")); - QCOMPARE(textEditObject->font().bold(), false); - QCOMPARE(textEditObject->font().italic(), false); - } - - { - QString componentStr = "import Qt 4.6\nTextEdit { font.family: \"\"; text: \"Hello World\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->font().family(), QString("")); - } -} - -void tst_qfxtextedit::color() -{ - //test style - for (int i = 0; i < colorStrings.size(); i++) - { - QString componentStr = "import Qt 4.6\nTextEdit { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - //qDebug() << "textEditObject: " << textEditObject->color() << "vs. " << QColor(colorStrings.at(i)); - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->color(), QColor(colorStrings.at(i))); - } - - { - QString colorStr = "#AA001234"; - QColor testColor("#001234"); - testColor.setAlpha(170); - - QString componentStr = "import Qt 4.6\nTextEdit { color: \"" + colorStr + "\"; text: \"Hello World\" }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - - QVERIFY(textEditObject != 0); - QCOMPARE(textEditObject->color(), testColor); - } -} - -void tst_qfxtextedit::selection() -{ - QString testStr = standard[0];//TODO: What should happen for multiline/rich text? - QString componentStr = "import Qt 4.6\nTextEdit { text: \""+ testStr +"\"; }"; - QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); - QVERIFY(textEditObject != 0); - - - //Test selection follows cursor - for(int i=0; i<= testStr.size(); i++) { - textEditObject->setCursorPosition(i); - QCOMPARE(textEditObject->cursorPosition(), i); - QCOMPARE(textEditObject->selectionStart(), i); - QCOMPARE(textEditObject->selectionEnd(), i); - QVERIFY(textEditObject->selectedText().isNull()); - } - - textEditObject->setCursorPosition(0); - QVERIFY(textEditObject->cursorPosition() == 0); - QVERIFY(textEditObject->selectionStart() == 0); - QVERIFY(textEditObject->selectionEnd() == 0); - QVERIFY(textEditObject->selectedText().isNull()); - - //Test selection - for(int i=0; i<= testStr.size(); i++) { - textEditObject->setSelectionEnd(i); - QCOMPARE(testStr.mid(0,i), textEditObject->selectedText()); - } - for(int i=0; i<= testStr.size(); i++) { - textEditObject->setSelectionStart(i); - QCOMPARE(testStr.mid(i,testStr.size()-i), textEditObject->selectedText()); - } - - textEditObject->setCursorPosition(0); - QVERIFY(textEditObject->cursorPosition() == 0); - QVERIFY(textEditObject->selectionStart() == 0); - QVERIFY(textEditObject->selectionEnd() == 0); - QVERIFY(textEditObject->selectedText().isNull()); - - for(int i=0; i< testStr.size(); i++) { - textEditObject->setSelectionStart(i); - QCOMPARE(textEditObject->selectionEnd(), i); - QCOMPARE(testStr.mid(i,0), textEditObject->selectedText()); - textEditObject->setSelectionEnd(i+1); - QCOMPARE(textEditObject->selectionStart(), i); - QCOMPARE(testStr.mid(i,1), textEditObject->selectedText()); - } - - for(int i= testStr.size() - 1; i>0; i--) { - textEditObject->setSelectionEnd(i); - QCOMPARE(testStr.mid(i,0), textEditObject->selectedText()); - textEditObject->setSelectionStart(i-1); - QCOMPARE(testStr.mid(i-1,1), textEditObject->selectedText()); - } - - //Test Error Ignoring behaviour - textEditObject->setCursorPosition(0); - QVERIFY(textEditObject->selectedText().isNull()); - textEditObject->setSelectionStart(-10); - QVERIFY(textEditObject->selectedText().isNull()); - textEditObject->setSelectionStart(100); - QVERIFY(textEditObject->selectedText().isNull()); - textEditObject->setSelectionEnd(-10); - QVERIFY(textEditObject->selectedText().isNull()); - textEditObject->setSelectionEnd(100); - QVERIFY(textEditObject->selectedText().isNull()); - textEditObject->setSelectionStart(0); - textEditObject->setSelectionEnd(10); - QVERIFY(textEditObject->selectedText().size() == 10); - textEditObject->setSelectionStart(-10); - QVERIFY(textEditObject->selectedText().size() == 10); - textEditObject->setSelectionStart(100); - QVERIFY(textEditObject->selectedText().size() == 10); - textEditObject->setSelectionEnd(-10); - QVERIFY(textEditObject->selectedText().size() == 10); - textEditObject->setSelectionEnd(100); - QVERIFY(textEditObject->selectedText().size() == 10); -} - -void tst_qfxtextedit::cursorDelegate() -{ - QmlView* view = createView(SRCDIR "/data/cursorTest.qml"); - view->execute(); - view->show(); - view->setFocus(); - QmlGraphicsTextEdit *textEditObject = view->root()->findChild("textEditObject"); - QVERIFY(textEditObject != 0); - QVERIFY(textEditObject->findChild("cursorInstance")); - //Test Delegate gets created - textEditObject->setFocus(true); - QmlGraphicsItem* delegateObject = textEditObject->findChild("cursorInstance"); - QVERIFY(delegateObject); - //Test Delegate gets moved - for(int i=0; i<= textEditObject->text().length(); i++){ - textEditObject->setCursorPosition(i); - QCOMPARE(textEditObject->cursorRect().x(), qRound(delegateObject->x())); - QCOMPARE(textEditObject->cursorRect().y(), qRound(delegateObject->y())); - } - textEditObject->setCursorPosition(0); - QCOMPARE(textEditObject->cursorRect().x(), qRound(delegateObject->x())); - QCOMPARE(textEditObject->cursorRect().y(), qRound(delegateObject->y())); - //Test Delegate gets deleted - textEditObject->setCursorDelegate(0); - QVERIFY(!textEditObject->findChild("cursorInstance")); -} - -/* -TextEdit element should only handle left/right keys until the cursor reaches -the extent of the text, then they should ignore the keys. -*/ -void tst_qfxtextedit::navigation() -{ - QmlView *canvas = createView(SRCDIR "/data/navigation.qml"); - canvas->execute(); - canvas->show(); - canvas->setFocus(); - - QVERIFY(canvas->root() != 0); - - QmlGraphicsItem *input = qobject_cast(qvariant_cast(canvas->root()->property("myInput"))); - - QVERIFY(input != 0); - QTRY_VERIFY(input->hasFocus() == true); - QEXPECT_FAIL("", "Depends on QT-2236", Abort); - simulateKey(canvas, Qt::Key_Left); - QVERIFY(input->hasFocus() == false); - simulateKey(canvas, Qt::Key_Right); - QVERIFY(input->hasFocus() == true); - simulateKey(canvas, Qt::Key_Right); - QVERIFY(input->hasFocus() == false); - simulateKey(canvas, Qt::Key_Left); - QVERIFY(input->hasFocus() == true); -} - -void tst_qfxtextedit::simulateKey(QmlView *view, int key) -{ - QKeyEvent press(QKeyEvent::KeyPress, key, 0); - QKeyEvent release(QKeyEvent::KeyRelease, key, 0); - - QApplication::sendEvent(view, &press); - QApplication::sendEvent(view, &release); -} - -QmlView *tst_qfxtextedit::createView(const QString &filename) -{ - QmlView *canvas = new QmlView(0); - - QFile file(filename); - file.open(QFile::ReadOnly); - QString xml = file.readAll(); - canvas->setQml(xml, filename); - - return canvas; -} - - -QTEST_MAIN(tst_qfxtextedit) - -#include "tst_qfxtextedit.moc" diff --git a/tests/auto/declarative/qfxtextinput/data/cursorTest.qml b/tests/auto/declarative/qfxtextinput/data/cursorTest.qml deleted file mode 100644 index ddc98cc..0000000 --- a/tests/auto/declarative/qfxtextinput/data/cursorTest.qml +++ /dev/null @@ -1,8 +0,0 @@ -import Qt 4.6 - -Rectangle { width: 300; height: 300; color: "white" - TextInput { text: "Hello world!"; id: textInputObject; objectName: "textInputObject" - resources: [ Component { id:cursor; Item { id:cursorInstance; objectName: "cursorInstance";} } ] - cursorDelegate: cursor - } -} diff --git a/tests/auto/declarative/qfxtextinput/data/navigation.qml b/tests/auto/declarative/qfxtextinput/data/navigation.qml deleted file mode 100644 index 282c52c..0000000 --- a/tests/auto/declarative/qfxtextinput/data/navigation.qml +++ /dev/null @@ -1,23 +0,0 @@ -import Qt 4.6 - -Rectangle { - property var myInput: Input - - width: 800; height: 600; color: "blue" - - Item { - id: FirstItem; - KeyNavigation.right: Input - } - - TextInput { id: Input; focus: true - KeyNavigation.left: FirstItem - KeyNavigation.right: LastItem - KeyNavigation.up: FirstItem - KeyNavigation.down: LastItem - } - Item { - id: LastItem - KeyNavigation.left: Input - } -} diff --git a/tests/auto/declarative/qfxtextinput/qfxtextinput.pro b/tests/auto/declarative/qfxtextinput/qfxtextinput.pro deleted file mode 100644 index fe2e3e3..0000000 --- a/tests/auto/declarative/qfxtextinput/qfxtextinput.pro +++ /dev/null @@ -1,8 +0,0 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative gui -macx:CONFIG -= app_bundle - -SOURCES += tst_qfxtextinput.cpp - -# Define SRCDIR equal to test's source directory -DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp b/tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp deleted file mode 100644 index 8eeb22d..0000000 --- a/tests/auto/declarative/qfxtextinput/tst_qfxtextinput.cpp +++ /dev/null @@ -1,422 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -#include "../../../shared/util.h" -#include -#include -#include -#include -#include - -class tst_qfxtextinput : public QObject - -{ - Q_OBJECT -public: - tst_qfxtextinput(); - -private slots: - void text(); - void width(); - void font(); - void color(); - void selection(); - - void maxLength(); - void masks(); - void validators(); - - void cursorDelegate(); - void navigation(); - -private: - void simulateKey(QmlView *, int key); - QmlView *createView(const QString &filename); - - QmlEngine engine; - QStringList standard; - QStringList colorStrings; -}; - -tst_qfxtextinput::tst_qfxtextinput() -{ - standard << "the quick brown fox jumped over the lazy dog" - << "It's supercalifragisiticexpialidocious!" - << "Hello, world!"; - - colorStrings << "aliceblue" - << "antiquewhite" - << "aqua" - << "darkkhaki" - << "darkolivegreen" - << "dimgray" - << "palevioletred" - << "lightsteelblue" - << "#000000" - << "#AAAAAA" - << "#FFFFFF" - << "#2AC05F"; -} - -void tst_qfxtextinput::text() -{ - { - QmlComponent textinputComponent(&engine, "import Qt 4.6\nTextInput { text: \"\" }", QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->text(), QString("")); - } - - for (int i = 0; i < standard.size(); i++) - { - QString componentStr = "import Qt 4.6\nTextInput { text: \"" + standard.at(i) + "\" }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->text(), standard.at(i)); - } - -} - -void tst_qfxtextinput::width() -{ - // uses Font metrics to find the width for standard - { - QmlComponent textinputComponent(&engine, "import Qt 4.6\nTextInput { text: \"\" }", QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->width(), 1.);//1 for the cursor - } - - for (int i = 0; i < standard.size(); i++) - { - QFont f; - QFontMetricsF fm(f); - qreal metricWidth = fm.width(standard.at(i)); - - QString componentStr = "import Qt 4.6\nTextInput { text: \"" + standard.at(i) + "\" }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->width(), qreal(metricWidth) + 1.);//1 for the cursor - } -} - -void tst_qfxtextinput::font() -{ - //test size, then bold, then italic, then family - { - QString componentStr = "import Qt 4.6\nTextInput { font.pointSize: 40; text: \"Hello World\" }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->font().pointSize(), 40); - QCOMPARE(textinputObject->font().bold(), false); - QCOMPARE(textinputObject->font().italic(), false); - } - - { - QString componentStr = "import Qt 4.6\nTextInput { font.bold: true; text: \"Hello World\" }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->font().bold(), true); - QCOMPARE(textinputObject->font().italic(), false); - } - - { - QString componentStr = "import Qt 4.6\nTextInput { font.italic: true; text: \"Hello World\" }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->font().italic(), true); - QCOMPARE(textinputObject->font().bold(), false); - } - - { - QString componentStr = "import Qt 4.6\nTextInput { font.family: \"Helvetica\"; text: \"Hello World\" }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->font().family(), QString("Helvetica")); - QCOMPARE(textinputObject->font().bold(), false); - QCOMPARE(textinputObject->font().italic(), false); - } - - { - QString componentStr = "import Qt 4.6\nTextInput { font.family: \"\"; text: \"Hello World\" }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->font().family(), QString("")); - } -} - -void tst_qfxtextinput::color() -{ - //test style - for (int i = 0; i < colorStrings.size(); i++) - { - QString componentStr = "import Qt 4.6\nTextInput { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - //qDebug() << "textinputObject: " << textinputObject->color() << "vs. " << QColor(colorStrings.at(i)); - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->color(), QColor(colorStrings.at(i))); - } - - { - QString colorStr = "#AA001234"; - QColor testColor("#001234"); - testColor.setAlpha(170); - - QString componentStr = "import Qt 4.6\nTextInput { color: \"" + colorStr + "\"; text: \"Hello World\" }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - - QVERIFY(textinputObject != 0); - QCOMPARE(textinputObject->color(), testColor); - } -} - -void tst_qfxtextinput::selection() -{ - QString testStr = standard[0]; - QString componentStr = "import Qt 4.6\nTextInput { text: \""+ testStr +"\"; }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - QVERIFY(textinputObject != 0); - - - //Test selection follows cursor - for(int i=0; i<= testStr.size(); i++) { - textinputObject->setCursorPosition(i); - QCOMPARE(textinputObject->cursorPosition(), i); - QCOMPARE(textinputObject->selectionStart(), i); - QCOMPARE(textinputObject->selectionEnd(), i); - QVERIFY(textinputObject->selectedText().isNull()); - } - - textinputObject->setCursorPosition(0); - QVERIFY(textinputObject->cursorPosition() == 0); - QVERIFY(textinputObject->selectionStart() == 0); - QVERIFY(textinputObject->selectionEnd() == 0); - QVERIFY(textinputObject->selectedText().isNull()); - - //Test selection - for(int i=0; i<= testStr.size(); i++) { - textinputObject->setSelectionEnd(i); - QCOMPARE(testStr.mid(0,i), textinputObject->selectedText()); - } - for(int i=0; i<= testStr.size(); i++) { - textinputObject->setSelectionStart(i); - QCOMPARE(testStr.mid(i,testStr.size()-i), textinputObject->selectedText()); - } - - textinputObject->setCursorPosition(0); - QVERIFY(textinputObject->cursorPosition() == 0); - QVERIFY(textinputObject->selectionStart() == 0); - QVERIFY(textinputObject->selectionEnd() == 0); - QVERIFY(textinputObject->selectedText().isNull()); - - for(int i=0; i< testStr.size(); i++) { - textinputObject->setSelectionStart(i); - QCOMPARE(textinputObject->selectionEnd(), i); - QCOMPARE(testStr.mid(i,0), textinputObject->selectedText()); - textinputObject->setSelectionEnd(i+1); - QCOMPARE(textinputObject->selectionStart(), i); - QCOMPARE(testStr.mid(i,1), textinputObject->selectedText()); - } - - for(int i= testStr.size() - 1; i>0; i--) { - textinputObject->setSelectionEnd(i); - QCOMPARE(testStr.mid(i,0), textinputObject->selectedText()); - textinputObject->setSelectionStart(i-1); - QCOMPARE(testStr.mid(i-1,1), textinputObject->selectedText()); - } - - //Test Error Ignoring behaviour - textinputObject->setCursorPosition(0); - QVERIFY(textinputObject->selectedText().isNull()); - textinputObject->setSelectionStart(-10); - QVERIFY(textinputObject->selectedText().isNull()); - textinputObject->setSelectionStart(100); - QVERIFY(textinputObject->selectedText().isNull()); - textinputObject->setSelectionEnd(-10); - QVERIFY(textinputObject->selectedText().isNull()); - textinputObject->setSelectionEnd(100); - QVERIFY(textinputObject->selectedText().isNull()); - textinputObject->setSelectionStart(0); - textinputObject->setSelectionEnd(10); - QVERIFY(textinputObject->selectedText().size() == 10); - textinputObject->setSelectionStart(-10); - QVERIFY(textinputObject->selectedText().size() == 10); - textinputObject->setSelectionStart(100); - QVERIFY(textinputObject->selectedText().size() == 10); - textinputObject->setSelectionEnd(-10); - QVERIFY(textinputObject->selectedText().size() == 10); - textinputObject->setSelectionEnd(100); - QVERIFY(textinputObject->selectedText().size() == 10); -} - -void tst_qfxtextinput::maxLength() -{ - QString componentStr = "import Qt 4.6\nTextInput { maximumLength: 10; }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - QVERIFY(textinputObject != 0); - QVERIFY(textinputObject->text().isEmpty()); - foreach(const QString &str, standard){ - QVERIFY(textinputObject->text().length() <= 10); - textinputObject->setText(str); - QVERIFY(textinputObject->text().length() <= 10); - } - //TODO: Simulated keypress input adding 11 chars at a time -} - -void tst_qfxtextinput::masks() -{ - QString componentStr = "import Qt 4.6\nTextInput { maximumLength: 10; }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - QVERIFY(textinputObject != 0); - - //TODO: Me -} - -void tst_qfxtextinput::validators() -{ - QString componentStr = "import Qt 4.6\nTextInput { maximumLength: 10; }"; - QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); - QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); - QVERIFY(textinputObject != 0); - - //TODO: Me -} - -/* -TextInput element should only handle left/right keys until the cursor reaches -the extent of the text, then they should ignore the keys. -*/ -void tst_qfxtextinput::navigation() -{ - QmlView *canvas = createView(SRCDIR "/data/navigation.qml"); - canvas->execute(); - canvas->show(); - canvas->setFocus(); - - QVERIFY(canvas->root() != 0); - - QmlGraphicsItem *input = qobject_cast(qvariant_cast(canvas->root()->property("myInput"))); - - QVERIFY(input != 0); - QTRY_VERIFY(input->hasFocus() == true); - simulateKey(canvas, Qt::Key_Left); - QVERIFY(input->hasFocus() == false); - simulateKey(canvas, Qt::Key_Right); - QVERIFY(input->hasFocus() == true); - simulateKey(canvas, Qt::Key_Right); - QVERIFY(input->hasFocus() == false); - simulateKey(canvas, Qt::Key_Left); - QVERIFY(input->hasFocus() == true); -} - -void tst_qfxtextinput::cursorDelegate() -{ - QmlView* view = createView(SRCDIR "/data/cursorTest.qml"); - view->execute(); - view->show(); - view->setFocus(); - QmlGraphicsTextInput *textInputObject = view->root()->findChild("textInputObject"); - QVERIFY(textInputObject != 0); - QVERIFY(textInputObject->findChild("cursorInstance")); - //Test Delegate gets created - textInputObject->setFocus(true); - QmlGraphicsItem* delegateObject = textInputObject->findChild("cursorInstance"); - QVERIFY(delegateObject); - //Test Delegate gets moved - for(int i=0; i<= textInputObject->text().length(); i++){ - textInputObject->setCursorPosition(i); - //+5 is because the TextInput cursorRect is just a 10xHeight area centered on cursor position - QCOMPARE(textInputObject->cursorRect().x() + 5, qRound(delegateObject->x())); - QCOMPARE(textInputObject->cursorRect().y(), qRound(delegateObject->y())); - } - textInputObject->setCursorPosition(0); - QCOMPARE(textInputObject->cursorRect().x()+5, qRound(delegateObject->x())); - QCOMPARE(textInputObject->cursorRect().y(), qRound(delegateObject->y())); - //Test Delegate gets deleted - textInputObject->setCursorDelegate(0); - QVERIFY(!textInputObject->findChild("cursorInstance")); -} - -void tst_qfxtextinput::simulateKey(QmlView *view, int key) -{ - QKeyEvent press(QKeyEvent::KeyPress, key, 0); - QKeyEvent release(QKeyEvent::KeyRelease, key, 0); - - QApplication::sendEvent(view, &press); - QApplication::sendEvent(view, &release); -} - -QmlView *tst_qfxtextinput::createView(const QString &filename) -{ - QmlView *canvas = new QmlView(0); - - QFile file(filename); - file.open(QFile::ReadOnly); - QString xml = file.readAll(); - canvas->setQml(xml, filename); - - return canvas; -} - -QTEST_MAIN(tst_qfxtextinput) - -#include "tst_qfxtextinput.moc" diff --git a/tests/auto/declarative/qmlgraphicstextedit/data/cursorTest.qml b/tests/auto/declarative/qmlgraphicstextedit/data/cursorTest.qml new file mode 100644 index 0000000..e5df8f1 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicstextedit/data/cursorTest.qml @@ -0,0 +1,8 @@ +import Qt 4.6 + +Rectangle { width: 300; height: 300; color: "white" + TextEdit { text: "Hello world!"; id: textEditObject; objectName: "textEditObject" + resources: [ Component { id:cursor; Item { id:cursorInstance; objectName: "cursorInstance" } } ] + cursorDelegate: cursor + } +} diff --git a/tests/auto/declarative/qmlgraphicstextedit/data/navigation.qml b/tests/auto/declarative/qmlgraphicstextedit/data/navigation.qml new file mode 100644 index 0000000..5b8613f --- /dev/null +++ b/tests/auto/declarative/qmlgraphicstextedit/data/navigation.qml @@ -0,0 +1,23 @@ +import Qt 4.6 + +Rectangle { + property var myInput: Input + + width: 800; height: 600; color: "blue" + + Item { + id: FirstItem; + KeyNavigation.right: Input + } + + TextEdit { id: Input; focus: true + KeyNavigation.left: FirstItem + KeyNavigation.right: LastItem + KeyNavigation.up: FirstItem + KeyNavigation.down: LastItem + } + Item { + id: LastItem + KeyNavigation.left: Input + } +} diff --git a/tests/auto/declarative/qmlgraphicstextedit/qmlgraphicstextedit.pro b/tests/auto/declarative/qmlgraphicstextedit/qmlgraphicstextedit.pro new file mode 100644 index 0000000..9e6a71a --- /dev/null +++ b/tests/auto/declarative/qmlgraphicstextedit/qmlgraphicstextedit.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + +SOURCES += tst_qmlgraphicstextedit.cpp + +# Define SRCDIR equal to test's source directory +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp b/tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp new file mode 100644 index 0000000..4287f01 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicstextedit/tst_qmlgraphicstextedit.cpp @@ -0,0 +1,555 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include "../../../shared/util.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class tst_qmlgraphicstextedit : public QObject + +{ + Q_OBJECT +public: + tst_qmlgraphicstextedit(); + +private slots: + void text(); + void width(); + void wrap(); + + // ### these tests may be trivial + void hAlign(); + void vAlign(); + void font(); + void color(); + void selection(); + + void cursorDelegate(); + void navigation(); + +private: + void simulateKey(QmlView *, int key); + QmlView *createView(const QString &filename); + + QStringList standard; + QStringList richText; + + QStringList hAlignmentStrings; + QStringList vAlignmentStrings; + + QList vAlignments; + QList hAlignments; + + QStringList colorStrings; + + QmlEngine engine; +}; + +tst_qmlgraphicstextedit::tst_qmlgraphicstextedit() +{ + standard << "the quick brown fox jumped over the lazy dog" + << "the quick brown fox\n jumped over the lazy dog"; + + richText << "the quick brown fox jumped over the lazy dog" + << "the quick brown fox
jumped over the lazy dog
"; + + hAlignmentStrings << "AlignLeft" + << "AlignRight" + << "AlignHCenter"; + + vAlignmentStrings << "AlignTop" + << "AlignBottom" + << "AlignVCenter"; + + hAlignments << Qt::AlignLeft + << Qt::AlignRight + << Qt::AlignHCenter; + + vAlignments << Qt::AlignTop + << Qt::AlignBottom + << Qt::AlignVCenter; + + colorStrings << "aliceblue" + << "antiquewhite" + << "aqua" + << "darkkhaki" + << "darkolivegreen" + << "dimgray" + << "palevioletred" + << "lightsteelblue" + << "#000000" + << "#AAAAAA" + << "#FFFFFF" + << "#2AC05F"; + // + // need a different test to do alpha channel test + // << "#AA0011DD" + // << "#00F16B11"; + // +} + +void tst_qmlgraphicstextedit::text() +{ + { + QmlComponent texteditComponent(&engine, "import Qt 4.6\nTextEdit { text: \"\" }", QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->text(), QString("")); + } + + for (int i = 0; i < standard.size(); i++) + { + QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + standard.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->text(), standard.at(i)); + } + + for (int i = 0; i < richText.size(); i++) + { + QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + richText.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QString actual = textEditObject->text(); + QString expected = richText.at(i); + actual.replace(QRegExp(".*]*>"),""); + actual.replace(QRegExp("(<[^>]*>)+"),"<>"); + expected.replace(QRegExp("(<[^>]*>)+"),"<>"); + QCOMPARE(actual.simplified(),expected.simplified()); + } +} + +void tst_qmlgraphicstextedit::width() +{ + // uses Font metrics to find the width for standard and document to find the width for rich + { + QmlComponent texteditComponent(&engine, "import Qt 4.6\nTextEdit { text: \"\" }", QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->width(), 1.);//+1 for cursor + } + + for (int i = 0; i < standard.size(); i++) + { + QFont f; + QFontMetricsF fm(f); + qreal metricWidth = fm.size(Qt::TextExpandTabs && Qt::TextShowMnemonic, standard.at(i)).width(); + metricWidth = floor(metricWidth); + + QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + standard.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->width(), qreal(metricWidth + 1 + 3));//+3 is the current way of accounting for space between cursor and last character. + } + + for (int i = 0; i < richText.size(); i++) + { + QTextDocument document; + document.setHtml(richText.at(i)); + document.setDocumentMargin(0); + + int documentWidth = document.idealWidth(); + + QString componentStr = "import Qt 4.6\nTextEdit { text: \"" + richText.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->width(), qreal(documentWidth + 1 + 3)); + } +} + +void tst_qmlgraphicstextedit::wrap() +{ + // for specified width and wrap set true + { + QmlComponent texteditComponent(&engine, "import Qt 4.6\nTextEdit { text: \"\"; wrap: true; width: 300 }", QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->width(), 300.); + } + + for (int i = 0; i < standard.size(); i++) + { + QString componentStr = "import Qt 4.6\nTextEdit { wrap: true; width: 300; text: \"" + standard.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->width(), 300.); + } + + for (int i = 0; i < richText.size(); i++) + { + QString componentStr = "import Qt 4.6\nTextEdit { wrap: true; width: 300; text: \"" + richText.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->width(), 300.); + } + +} + +//the alignment tests may be trivial o.oa +void tst_qmlgraphicstextedit::hAlign() +{ + //test one align each, and then test if two align fails. + + for (int i = 0; i < standard.size(); i++) + { + for (int j=0; j < hAlignmentStrings.size(); j++) + { + QString componentStr = "import Qt 4.6\nTextEdit { horizontalAlignment: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE((int)textEditObject->hAlign(), (int)hAlignments.at(j)); + } + } + + for (int i = 0; i < richText.size(); i++) + { + for (int j=0; j < hAlignmentStrings.size(); j++) + { + QString componentStr = "import Qt 4.6\nTextEdit { horizontalAlignment: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE((int)textEditObject->hAlign(), (int)hAlignments.at(j)); + } + } + +} + +void tst_qmlgraphicstextedit::vAlign() +{ + //test one align each, and then test if two align fails. + + for (int i = 0; i < standard.size(); i++) + { + for (int j=0; j < vAlignmentStrings.size(); j++) + { + QString componentStr = "import Qt 4.6\nTextEdit { verticalAlignment: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE((int)textEditObject->vAlign(), (int)vAlignments.at(j)); + } + } + + for (int i = 0; i < richText.size(); i++) + { + for (int j=0; j < vAlignmentStrings.size(); j++) + { + QString componentStr = "import Qt 4.6\nTextEdit { verticalAlignment: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE((int)textEditObject->vAlign(), (int)vAlignments.at(j)); + } + } + +} + +void tst_qmlgraphicstextedit::font() +{ + //test size, then bold, then italic, then family + { + QString componentStr = "import Qt 4.6\nTextEdit { font.pointSize: 40; text: \"Hello World\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->font().pointSize(), 40); + QCOMPARE(textEditObject->font().bold(), false); + QCOMPARE(textEditObject->font().italic(), false); + } + + { + QString componentStr = "import Qt 4.6\nTextEdit { font.bold: true; text: \"Hello World\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->font().bold(), true); + QCOMPARE(textEditObject->font().italic(), false); + } + + { + QString componentStr = "import Qt 4.6\nTextEdit { font.italic: true; text: \"Hello World\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->font().italic(), true); + QCOMPARE(textEditObject->font().bold(), false); + } + + { + QString componentStr = "import Qt 4.6\nTextEdit { font.family: \"Helvetica\"; text: \"Hello World\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->font().family(), QString("Helvetica")); + QCOMPARE(textEditObject->font().bold(), false); + QCOMPARE(textEditObject->font().italic(), false); + } + + { + QString componentStr = "import Qt 4.6\nTextEdit { font.family: \"\"; text: \"Hello World\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->font().family(), QString("")); + } +} + +void tst_qmlgraphicstextedit::color() +{ + //test style + for (int i = 0; i < colorStrings.size(); i++) + { + QString componentStr = "import Qt 4.6\nTextEdit { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + //qDebug() << "textEditObject: " << textEditObject->color() << "vs. " << QColor(colorStrings.at(i)); + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->color(), QColor(colorStrings.at(i))); + } + + { + QString colorStr = "#AA001234"; + QColor testColor("#001234"); + testColor.setAlpha(170); + + QString componentStr = "import Qt 4.6\nTextEdit { color: \"" + colorStr + "\"; text: \"Hello World\" }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + + QVERIFY(textEditObject != 0); + QCOMPARE(textEditObject->color(), testColor); + } +} + +void tst_qmlgraphicstextedit::selection() +{ + QString testStr = standard[0];//TODO: What should happen for multiline/rich text? + QString componentStr = "import Qt 4.6\nTextEdit { text: \""+ testStr +"\"; }"; + QmlComponent texteditComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextEdit *textEditObject = qobject_cast(texteditComponent.create()); + QVERIFY(textEditObject != 0); + + + //Test selection follows cursor + for(int i=0; i<= testStr.size(); i++) { + textEditObject->setCursorPosition(i); + QCOMPARE(textEditObject->cursorPosition(), i); + QCOMPARE(textEditObject->selectionStart(), i); + QCOMPARE(textEditObject->selectionEnd(), i); + QVERIFY(textEditObject->selectedText().isNull()); + } + + textEditObject->setCursorPosition(0); + QVERIFY(textEditObject->cursorPosition() == 0); + QVERIFY(textEditObject->selectionStart() == 0); + QVERIFY(textEditObject->selectionEnd() == 0); + QVERIFY(textEditObject->selectedText().isNull()); + + //Test selection + for(int i=0; i<= testStr.size(); i++) { + textEditObject->setSelectionEnd(i); + QCOMPARE(testStr.mid(0,i), textEditObject->selectedText()); + } + for(int i=0; i<= testStr.size(); i++) { + textEditObject->setSelectionStart(i); + QCOMPARE(testStr.mid(i,testStr.size()-i), textEditObject->selectedText()); + } + + textEditObject->setCursorPosition(0); + QVERIFY(textEditObject->cursorPosition() == 0); + QVERIFY(textEditObject->selectionStart() == 0); + QVERIFY(textEditObject->selectionEnd() == 0); + QVERIFY(textEditObject->selectedText().isNull()); + + for(int i=0; i< testStr.size(); i++) { + textEditObject->setSelectionStart(i); + QCOMPARE(textEditObject->selectionEnd(), i); + QCOMPARE(testStr.mid(i,0), textEditObject->selectedText()); + textEditObject->setSelectionEnd(i+1); + QCOMPARE(textEditObject->selectionStart(), i); + QCOMPARE(testStr.mid(i,1), textEditObject->selectedText()); + } + + for(int i= testStr.size() - 1; i>0; i--) { + textEditObject->setSelectionEnd(i); + QCOMPARE(testStr.mid(i,0), textEditObject->selectedText()); + textEditObject->setSelectionStart(i-1); + QCOMPARE(testStr.mid(i-1,1), textEditObject->selectedText()); + } + + //Test Error Ignoring behaviour + textEditObject->setCursorPosition(0); + QVERIFY(textEditObject->selectedText().isNull()); + textEditObject->setSelectionStart(-10); + QVERIFY(textEditObject->selectedText().isNull()); + textEditObject->setSelectionStart(100); + QVERIFY(textEditObject->selectedText().isNull()); + textEditObject->setSelectionEnd(-10); + QVERIFY(textEditObject->selectedText().isNull()); + textEditObject->setSelectionEnd(100); + QVERIFY(textEditObject->selectedText().isNull()); + textEditObject->setSelectionStart(0); + textEditObject->setSelectionEnd(10); + QVERIFY(textEditObject->selectedText().size() == 10); + textEditObject->setSelectionStart(-10); + QVERIFY(textEditObject->selectedText().size() == 10); + textEditObject->setSelectionStart(100); + QVERIFY(textEditObject->selectedText().size() == 10); + textEditObject->setSelectionEnd(-10); + QVERIFY(textEditObject->selectedText().size() == 10); + textEditObject->setSelectionEnd(100); + QVERIFY(textEditObject->selectedText().size() == 10); +} + +void tst_qmlgraphicstextedit::cursorDelegate() +{ + QmlView* view = createView(SRCDIR "/data/cursorTest.qml"); + view->execute(); + view->show(); + view->setFocus(); + QmlGraphicsTextEdit *textEditObject = view->root()->findChild("textEditObject"); + QVERIFY(textEditObject != 0); + QVERIFY(textEditObject->findChild("cursorInstance")); + //Test Delegate gets created + textEditObject->setFocus(true); + QmlGraphicsItem* delegateObject = textEditObject->findChild("cursorInstance"); + QVERIFY(delegateObject); + //Test Delegate gets moved + for(int i=0; i<= textEditObject->text().length(); i++){ + textEditObject->setCursorPosition(i); + QCOMPARE(textEditObject->cursorRect().x(), qRound(delegateObject->x())); + QCOMPARE(textEditObject->cursorRect().y(), qRound(delegateObject->y())); + } + textEditObject->setCursorPosition(0); + QCOMPARE(textEditObject->cursorRect().x(), qRound(delegateObject->x())); + QCOMPARE(textEditObject->cursorRect().y(), qRound(delegateObject->y())); + //Test Delegate gets deleted + textEditObject->setCursorDelegate(0); + QVERIFY(!textEditObject->findChild("cursorInstance")); +} + +/* +TextEdit element should only handle left/right keys until the cursor reaches +the extent of the text, then they should ignore the keys. +*/ +void tst_qmlgraphicstextedit::navigation() +{ + QmlView *canvas = createView(SRCDIR "/data/navigation.qml"); + canvas->execute(); + canvas->show(); + canvas->setFocus(); + + QVERIFY(canvas->root() != 0); + + QmlGraphicsItem *input = qobject_cast(qvariant_cast(canvas->root()->property("myInput"))); + + QVERIFY(input != 0); + QTRY_VERIFY(input->hasFocus() == true); + QEXPECT_FAIL("", "Depends on QT-2236", Abort); + simulateKey(canvas, Qt::Key_Left); + QVERIFY(input->hasFocus() == false); + simulateKey(canvas, Qt::Key_Right); + QVERIFY(input->hasFocus() == true); + simulateKey(canvas, Qt::Key_Right); + QVERIFY(input->hasFocus() == false); + simulateKey(canvas, Qt::Key_Left); + QVERIFY(input->hasFocus() == true); +} + +void tst_qmlgraphicstextedit::simulateKey(QmlView *view, int key) +{ + QKeyEvent press(QKeyEvent::KeyPress, key, 0); + QKeyEvent release(QKeyEvent::KeyRelease, key, 0); + + QApplication::sendEvent(view, &press); + QApplication::sendEvent(view, &release); +} + +QmlView *tst_qmlgraphicstextedit::createView(const QString &filename) +{ + QmlView *canvas = new QmlView(0); + + QFile file(filename); + file.open(QFile::ReadOnly); + QString xml = file.readAll(); + canvas->setQml(xml, filename); + + return canvas; +} + + +QTEST_MAIN(tst_qmlgraphicstextedit) + +#include "tst_qmlgraphicstextedit.moc" diff --git a/tests/auto/declarative/qmlgraphicstextinput/data/cursorTest.qml b/tests/auto/declarative/qmlgraphicstextinput/data/cursorTest.qml new file mode 100644 index 0000000..ddc98cc --- /dev/null +++ b/tests/auto/declarative/qmlgraphicstextinput/data/cursorTest.qml @@ -0,0 +1,8 @@ +import Qt 4.6 + +Rectangle { width: 300; height: 300; color: "white" + TextInput { text: "Hello world!"; id: textInputObject; objectName: "textInputObject" + resources: [ Component { id:cursor; Item { id:cursorInstance; objectName: "cursorInstance";} } ] + cursorDelegate: cursor + } +} diff --git a/tests/auto/declarative/qmlgraphicstextinput/data/navigation.qml b/tests/auto/declarative/qmlgraphicstextinput/data/navigation.qml new file mode 100644 index 0000000..282c52c --- /dev/null +++ b/tests/auto/declarative/qmlgraphicstextinput/data/navigation.qml @@ -0,0 +1,23 @@ +import Qt 4.6 + +Rectangle { + property var myInput: Input + + width: 800; height: 600; color: "blue" + + Item { + id: FirstItem; + KeyNavigation.right: Input + } + + TextInput { id: Input; focus: true + KeyNavigation.left: FirstItem + KeyNavigation.right: LastItem + KeyNavigation.up: FirstItem + KeyNavigation.down: LastItem + } + Item { + id: LastItem + KeyNavigation.left: Input + } +} diff --git a/tests/auto/declarative/qmlgraphicstextinput/qmlgraphicstextinput.pro b/tests/auto/declarative/qmlgraphicstextinput/qmlgraphicstextinput.pro new file mode 100644 index 0000000..fd75fec --- /dev/null +++ b/tests/auto/declarative/qmlgraphicstextinput/qmlgraphicstextinput.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + +SOURCES += tst_qmlgraphicstextinput.cpp + +# Define SRCDIR equal to test's source directory +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp b/tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp new file mode 100644 index 0000000..8e9fa5e --- /dev/null +++ b/tests/auto/declarative/qmlgraphicstextinput/tst_qmlgraphicstextinput.cpp @@ -0,0 +1,422 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include "../../../shared/util.h" +#include +#include +#include +#include +#include + +class tst_qmlgraphicstextinput : public QObject + +{ + Q_OBJECT +public: + tst_qmlgraphicstextinput(); + +private slots: + void text(); + void width(); + void font(); + void color(); + void selection(); + + void maxLength(); + void masks(); + void validators(); + + void cursorDelegate(); + void navigation(); + +private: + void simulateKey(QmlView *, int key); + QmlView *createView(const QString &filename); + + QmlEngine engine; + QStringList standard; + QStringList colorStrings; +}; + +tst_qmlgraphicstextinput::tst_qmlgraphicstextinput() +{ + standard << "the quick brown fox jumped over the lazy dog" + << "It's supercalifragisiticexpialidocious!" + << "Hello, world!"; + + colorStrings << "aliceblue" + << "antiquewhite" + << "aqua" + << "darkkhaki" + << "darkolivegreen" + << "dimgray" + << "palevioletred" + << "lightsteelblue" + << "#000000" + << "#AAAAAA" + << "#FFFFFF" + << "#2AC05F"; +} + +void tst_qmlgraphicstextinput::text() +{ + { + QmlComponent textinputComponent(&engine, "import Qt 4.6\nTextInput { text: \"\" }", QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->text(), QString("")); + } + + for (int i = 0; i < standard.size(); i++) + { + QString componentStr = "import Qt 4.6\nTextInput { text: \"" + standard.at(i) + "\" }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->text(), standard.at(i)); + } + +} + +void tst_qmlgraphicstextinput::width() +{ + // uses Font metrics to find the width for standard + { + QmlComponent textinputComponent(&engine, "import Qt 4.6\nTextInput { text: \"\" }", QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->width(), 1.);//1 for the cursor + } + + for (int i = 0; i < standard.size(); i++) + { + QFont f; + QFontMetricsF fm(f); + qreal metricWidth = fm.width(standard.at(i)); + + QString componentStr = "import Qt 4.6\nTextInput { text: \"" + standard.at(i) + "\" }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->width(), qreal(metricWidth) + 1.);//1 for the cursor + } +} + +void tst_qmlgraphicstextinput::font() +{ + //test size, then bold, then italic, then family + { + QString componentStr = "import Qt 4.6\nTextInput { font.pointSize: 40; text: \"Hello World\" }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->font().pointSize(), 40); + QCOMPARE(textinputObject->font().bold(), false); + QCOMPARE(textinputObject->font().italic(), false); + } + + { + QString componentStr = "import Qt 4.6\nTextInput { font.bold: true; text: \"Hello World\" }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->font().bold(), true); + QCOMPARE(textinputObject->font().italic(), false); + } + + { + QString componentStr = "import Qt 4.6\nTextInput { font.italic: true; text: \"Hello World\" }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->font().italic(), true); + QCOMPARE(textinputObject->font().bold(), false); + } + + { + QString componentStr = "import Qt 4.6\nTextInput { font.family: \"Helvetica\"; text: \"Hello World\" }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->font().family(), QString("Helvetica")); + QCOMPARE(textinputObject->font().bold(), false); + QCOMPARE(textinputObject->font().italic(), false); + } + + { + QString componentStr = "import Qt 4.6\nTextInput { font.family: \"\"; text: \"Hello World\" }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->font().family(), QString("")); + } +} + +void tst_qmlgraphicstextinput::color() +{ + //test style + for (int i = 0; i < colorStrings.size(); i++) + { + QString componentStr = "import Qt 4.6\nTextInput { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + //qDebug() << "textinputObject: " << textinputObject->color() << "vs. " << QColor(colorStrings.at(i)); + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->color(), QColor(colorStrings.at(i))); + } + + { + QString colorStr = "#AA001234"; + QColor testColor("#001234"); + testColor.setAlpha(170); + + QString componentStr = "import Qt 4.6\nTextInput { color: \"" + colorStr + "\"; text: \"Hello World\" }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + + QVERIFY(textinputObject != 0); + QCOMPARE(textinputObject->color(), testColor); + } +} + +void tst_qmlgraphicstextinput::selection() +{ + QString testStr = standard[0]; + QString componentStr = "import Qt 4.6\nTextInput { text: \""+ testStr +"\"; }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + QVERIFY(textinputObject != 0); + + + //Test selection follows cursor + for(int i=0; i<= testStr.size(); i++) { + textinputObject->setCursorPosition(i); + QCOMPARE(textinputObject->cursorPosition(), i); + QCOMPARE(textinputObject->selectionStart(), i); + QCOMPARE(textinputObject->selectionEnd(), i); + QVERIFY(textinputObject->selectedText().isNull()); + } + + textinputObject->setCursorPosition(0); + QVERIFY(textinputObject->cursorPosition() == 0); + QVERIFY(textinputObject->selectionStart() == 0); + QVERIFY(textinputObject->selectionEnd() == 0); + QVERIFY(textinputObject->selectedText().isNull()); + + //Test selection + for(int i=0; i<= testStr.size(); i++) { + textinputObject->setSelectionEnd(i); + QCOMPARE(testStr.mid(0,i), textinputObject->selectedText()); + } + for(int i=0; i<= testStr.size(); i++) { + textinputObject->setSelectionStart(i); + QCOMPARE(testStr.mid(i,testStr.size()-i), textinputObject->selectedText()); + } + + textinputObject->setCursorPosition(0); + QVERIFY(textinputObject->cursorPosition() == 0); + QVERIFY(textinputObject->selectionStart() == 0); + QVERIFY(textinputObject->selectionEnd() == 0); + QVERIFY(textinputObject->selectedText().isNull()); + + for(int i=0; i< testStr.size(); i++) { + textinputObject->setSelectionStart(i); + QCOMPARE(textinputObject->selectionEnd(), i); + QCOMPARE(testStr.mid(i,0), textinputObject->selectedText()); + textinputObject->setSelectionEnd(i+1); + QCOMPARE(textinputObject->selectionStart(), i); + QCOMPARE(testStr.mid(i,1), textinputObject->selectedText()); + } + + for(int i= testStr.size() - 1; i>0; i--) { + textinputObject->setSelectionEnd(i); + QCOMPARE(testStr.mid(i,0), textinputObject->selectedText()); + textinputObject->setSelectionStart(i-1); + QCOMPARE(testStr.mid(i-1,1), textinputObject->selectedText()); + } + + //Test Error Ignoring behaviour + textinputObject->setCursorPosition(0); + QVERIFY(textinputObject->selectedText().isNull()); + textinputObject->setSelectionStart(-10); + QVERIFY(textinputObject->selectedText().isNull()); + textinputObject->setSelectionStart(100); + QVERIFY(textinputObject->selectedText().isNull()); + textinputObject->setSelectionEnd(-10); + QVERIFY(textinputObject->selectedText().isNull()); + textinputObject->setSelectionEnd(100); + QVERIFY(textinputObject->selectedText().isNull()); + textinputObject->setSelectionStart(0); + textinputObject->setSelectionEnd(10); + QVERIFY(textinputObject->selectedText().size() == 10); + textinputObject->setSelectionStart(-10); + QVERIFY(textinputObject->selectedText().size() == 10); + textinputObject->setSelectionStart(100); + QVERIFY(textinputObject->selectedText().size() == 10); + textinputObject->setSelectionEnd(-10); + QVERIFY(textinputObject->selectedText().size() == 10); + textinputObject->setSelectionEnd(100); + QVERIFY(textinputObject->selectedText().size() == 10); +} + +void tst_qmlgraphicstextinput::maxLength() +{ + QString componentStr = "import Qt 4.6\nTextInput { maximumLength: 10; }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + QVERIFY(textinputObject != 0); + QVERIFY(textinputObject->text().isEmpty()); + foreach(const QString &str, standard){ + QVERIFY(textinputObject->text().length() <= 10); + textinputObject->setText(str); + QVERIFY(textinputObject->text().length() <= 10); + } + //TODO: Simulated keypress input adding 11 chars at a time +} + +void tst_qmlgraphicstextinput::masks() +{ + QString componentStr = "import Qt 4.6\nTextInput { maximumLength: 10; }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + QVERIFY(textinputObject != 0); + + //TODO: Me +} + +void tst_qmlgraphicstextinput::validators() +{ + QString componentStr = "import Qt 4.6\nTextInput { maximumLength: 10; }"; + QmlComponent textinputComponent(&engine, componentStr.toLatin1(), QUrl()); + QmlGraphicsTextInput *textinputObject = qobject_cast(textinputComponent.create()); + QVERIFY(textinputObject != 0); + + //TODO: Me +} + +/* +TextInput element should only handle left/right keys until the cursor reaches +the extent of the text, then they should ignore the keys. +*/ +void tst_qmlgraphicstextinput::navigation() +{ + QmlView *canvas = createView(SRCDIR "/data/navigation.qml"); + canvas->execute(); + canvas->show(); + canvas->setFocus(); + + QVERIFY(canvas->root() != 0); + + QmlGraphicsItem *input = qobject_cast(qvariant_cast(canvas->root()->property("myInput"))); + + QVERIFY(input != 0); + QTRY_VERIFY(input->hasFocus() == true); + simulateKey(canvas, Qt::Key_Left); + QVERIFY(input->hasFocus() == false); + simulateKey(canvas, Qt::Key_Right); + QVERIFY(input->hasFocus() == true); + simulateKey(canvas, Qt::Key_Right); + QVERIFY(input->hasFocus() == false); + simulateKey(canvas, Qt::Key_Left); + QVERIFY(input->hasFocus() == true); +} + +void tst_qmlgraphicstextinput::cursorDelegate() +{ + QmlView* view = createView(SRCDIR "/data/cursorTest.qml"); + view->execute(); + view->show(); + view->setFocus(); + QmlGraphicsTextInput *textInputObject = view->root()->findChild("textInputObject"); + QVERIFY(textInputObject != 0); + QVERIFY(textInputObject->findChild("cursorInstance")); + //Test Delegate gets created + textInputObject->setFocus(true); + QmlGraphicsItem* delegateObject = textInputObject->findChild("cursorInstance"); + QVERIFY(delegateObject); + //Test Delegate gets moved + for(int i=0; i<= textInputObject->text().length(); i++){ + textInputObject->setCursorPosition(i); + //+5 is because the TextInput cursorRect is just a 10xHeight area centered on cursor position + QCOMPARE(textInputObject->cursorRect().x() + 5, qRound(delegateObject->x())); + QCOMPARE(textInputObject->cursorRect().y(), qRound(delegateObject->y())); + } + textInputObject->setCursorPosition(0); + QCOMPARE(textInputObject->cursorRect().x()+5, qRound(delegateObject->x())); + QCOMPARE(textInputObject->cursorRect().y(), qRound(delegateObject->y())); + //Test Delegate gets deleted + textInputObject->setCursorDelegate(0); + QVERIFY(!textInputObject->findChild("cursorInstance")); +} + +void tst_qmlgraphicstextinput::simulateKey(QmlView *view, int key) +{ + QKeyEvent press(QKeyEvent::KeyPress, key, 0); + QKeyEvent release(QKeyEvent::KeyRelease, key, 0); + + QApplication::sendEvent(view, &press); + QApplication::sendEvent(view, &release); +} + +QmlView *tst_qmlgraphicstextinput::createView(const QString &filename) +{ + QmlView *canvas = new QmlView(0); + + QFile file(filename); + file.open(QFile::ReadOnly); + QString xml = file.readAll(); + canvas->setQml(xml, filename); + + return canvas; +} + +QTEST_MAIN(tst_qmlgraphicstextinput) + +#include "tst_qmlgraphicstextinput.moc" -- cgit v0.12 From 9639e8f872feea7592aee5967447623ce04ff96c Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Mon, 9 Nov 2009 12:38:46 +1000 Subject: Improve particles tests Code coverage data suggests some areas are inadequately tested. --- .../tst_qmlgraphicsparticles.cpp | 3 + .../qmlgraphicsparticles/data/particles.0.png | Bin 10022 -> 10361 bytes .../qmlgraphicsparticles/data/particles.1.png | Bin 14142 -> 14447 bytes .../qmlgraphicsparticles/data/particles.2.png | Bin 14214 -> 13793 bytes .../visual/qmlgraphicsparticles/data/particles.qml | 384 ++++++++++----------- .../visual/qmlgraphicsparticles/particles.qml | 3 +- 6 files changed, 193 insertions(+), 197 deletions(-) diff --git a/tests/auto/declarative/qmlgraphicsparticles/tst_qmlgraphicsparticles.cpp b/tests/auto/declarative/qmlgraphicsparticles/tst_qmlgraphicsparticles.cpp index ed68eaf..c8d181b 100644 --- a/tests/auto/declarative/qmlgraphicsparticles/tst_qmlgraphicsparticles.cpp +++ b/tests/auto/declarative/qmlgraphicsparticles/tst_qmlgraphicsparticles.cpp @@ -96,6 +96,9 @@ void tst_QmlGraphicsParticles::properties() particles->setEmissionRate(12); QCOMPARE(particles->emissionRate(), 12); + + particles->setEmitting(false); + QCOMPARE(particles->emitting(), false); } void tst_QmlGraphicsParticles::runs() diff --git a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.0.png b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.0.png index 30bdefd..4cc937d 100644 Binary files a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.0.png and b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.0.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.1.png b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.1.png index 799e028..ea04224 100644 Binary files a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.1.png and b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.1.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.2.png b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.2.png index ed267c2..241fd20 100644 Binary files a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.2.png and b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.2.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.qml b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.qml index 3199f31..a4339f8 100644 --- a/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.qml +++ b/tests/auto/declarative/visual/qmlgraphicsparticles/data/particles.qml @@ -10,235 +10,235 @@ VisualTest { } Frame { msec: 32 - hash: "1c129b1c4a39412bed2f23d712f2bc90" + hash: "71e690f8339f1829efc113d88d1a9023" } Frame { msec: 48 - hash: "fbcc4bc3fea46a43453aa39b032264c6" + hash: "856a757f3e83e1ede00854d2dacd856a" } Frame { msec: 64 - hash: "2cb13275faca414b7c8ba9d70067fd1f" + hash: "2a7926b693b9950aabc4e3a1ebe4b2d0" } Frame { msec: 80 - hash: "b017afb05f96085ee3395d62e62e457b" + hash: "0564ce95b47a7c3314a56921855b9244" } Frame { msec: 96 - hash: "642851d10c549c8ae72c057563e99e64" + hash: "bf207596dd69e7a872a23448621100cc" } Frame { msec: 112 - hash: "494c0942f7410d455a4b113fb908e570" + hash: "a0bb920166e777ea96afb811353a3488" } Frame { msec: 128 - hash: "cb0a2f9980f27757c0c1d62ef3dcfde0" + hash: "3d6297c684562d099fdb9c413b3e93a3" } Frame { msec: 144 - hash: "2fb9cf782ea106006af8bcd66c62869c" + hash: "29139f93cbd55faa0ea18f11db364d56" } Frame { msec: 160 - hash: "bf68518323f03e4f407831e8b34f247b" + hash: "f3637e44bf1b6c3fd030898e14a15443" } Frame { msec: 176 - hash: "c99abe9c0384ae339fdfa0c75dc8047d" + hash: "d687ef38c1d0e8d12c03a2e7b462a5e5" } Frame { msec: 192 - hash: "96f2eb402633c1aca8a1a2b0d60af5fb" + hash: "0f1f227bbce76122d081759752edf47e" } Frame { msec: 208 - hash: "6cba51a856f1ba54ee702761f196b915" + hash: "1112e4f9ec18958caa4efadbf8b369bd" } Frame { msec: 224 - hash: "9188926caa6c6ba8cb3aee04de635b96" + hash: "5bb7fd7dc06d79aa5ca35fa551753a38" } Frame { msec: 240 - hash: "81132a5e8768de0630311813170f166e" + hash: "c59e159877613eb09ba353bc0ef46086" } Frame { msec: 256 - hash: "a638698d7ccb73f20f6eeba3857f417c" + hash: "b7c583f85d89c833861324b3d06a6c8b" } Frame { msec: 272 - hash: "4761ba6847f6f0769b916106c5f3245b" + hash: "147641f03d92a48f49e0cfb4972bc1c7" } Frame { msec: 288 - hash: "13bc0c681962bada7fcb3b722895ffaa" + hash: "1627827cd3733d1177f111c6c347ab49" } Frame { msec: 304 - hash: "505c5824be16d812b7c339f1f9b8a10b" + hash: "0edccffd718ef10a0ea476201fc00c39" } Frame { msec: 320 - hash: "d191d502d9c685f8497583669147ee73" + hash: "4b7f426aaa31bdabc6c065b298e59c9e" } Frame { msec: 336 - hash: "c17f55cc5d7bf541e235791a157aa8b9" + hash: "4814f77f57bbae8d3c20995e37ec95fb" } Frame { msec: 352 - hash: "3ef401f87830c53b9b277d4420a9a742" + hash: "030092297087df89ab40e894a01f0ee2" } Frame { msec: 368 - hash: "d04816400e66ebbf797f9985a53f7cfb" + hash: "30b0d547b580daee9b1c49f5069570c5" } Frame { msec: 384 - hash: "d7a7df7c2a92449f42d61c0572e7dbac" + hash: "eaee106eaa1505e7d79ed21c36f381fd" } Frame { msec: 400 - hash: "f49a3bcf3842f554136ff9bd5bb470ef" + hash: "6527d1d44a75015d7eb163a660e15b0b" } Frame { msec: 416 - hash: "27bccc5933d7bfaad6d5f6a10efd283b" + hash: "3a3a7b7b36ede4aa1261b5f28c99984c" } Frame { msec: 432 - hash: "3067ac00a4d58c67bb96d813c344871d" + hash: "d2349319b0feeceaa7ef9301ae87d348" } Frame { msec: 448 - hash: "d38d7192688feecc38fd63285d37ce49" + hash: "f483ae316491e367922f6ef7ebfa0298" } Frame { msec: 464 - hash: "4172d1b74cdd6ea89be718977775a9e0" + hash: "3d94b3e9b409a4ca2200df226a25b2d5" } Frame { msec: 480 - hash: "2761a7e58cbfa46fc6d306c8270e4f10" + hash: "ce289f478dafd295ba82ef0c9e13ff3d" } Frame { msec: 496 - hash: "58a851b9fbcb98afc7c1bc58c2f45e4a" + hash: "6d618658faa9403ff9909f6c6a677cb2" } Frame { msec: 512 - hash: "0f7789f04bf20708d9d6f1e818b6b88a" + hash: "9e12eda314483bc5ef5a14a1b1ac26d7" } Frame { msec: 528 - hash: "8d8b8d109dce4c7b05ecb603b4718859" + hash: "ed34b0d26a18145028a5ec4c99e9b569" } Frame { msec: 544 - hash: "0fc6fde589932ac41787e8ebfe3fcbe3" + hash: "ea91dc7e837fa540af260f75c0f8ba49" } Frame { msec: 560 - hash: "e08bffd5a56795488f090a475513e5db" + hash: "a5b277747454ddeda3d66f3702f45a53" } Frame { msec: 576 - hash: "e089ab7c5feefd3d745bb665e2ff49ee" + hash: "7601784afb80a79267ade99961122186" } Frame { msec: 592 - hash: "e7b787fb1b21e991c19ec88b3d985b69" + hash: "e52696c37cc3a245a555c98038b51e76" } Frame { msec: 608 - hash: "a6f4f32287bd926e0eeff68717b80512" + hash: "7d94071d225e0105c794a238eaa8117e" } Frame { msec: 624 - hash: "3344ca9c97473bd922bd8efd5d6ab212" + hash: "60ebfb611c6f7515568574aecdfdcb57" } Frame { msec: 640 - hash: "a330510a9f62acb4f2163728939d0bb5" + hash: "0ea41ef8a82e97e62ed7507606ab6bf4" } Frame { msec: 656 - hash: "1ec473936f2279f13675b6b5fe2ee392" + hash: "009a12491a5f6e4b30942062f93a3f8c" } Frame { msec: 672 - hash: "b193b7d2917ee00c4cb29bf244186bef" + hash: "2fa053880413fc76b53b26b733b2168f" } Frame { msec: 688 - hash: "75137e977941e357bad2ad9af2cbc898" + hash: "fb53a57559de18a5b6f13f21d1daf098" } Frame { msec: 704 - hash: "31773ba8979a31b1691860b7dafe28dc" + hash: "f65a62bf7d5e8fbd996f7151398109a6" } Frame { msec: 720 - hash: "d8922452edbba4f1092b83e87c0330ea" + hash: "b0802484661f6fe4606f4ff915c03f81" } Frame { msec: 736 - hash: "982c80305b54236d1259f5672098652d" + hash: "b63c61e63cb23147a8377d3428d5a4fa" } Frame { msec: 752 - hash: "d8b23fb0867fb75558960216c8d0f2aa" + hash: "a320dcfa3907c85fa983035953b79ba3" } Frame { msec: 768 - hash: "daf7833f93a216d1e025c9129b3a7caa" + hash: "6b94696073ab8e1ef6be1f0b5cb22720" } Frame { msec: 784 - hash: "bb08e8fe2ce74018fc702e5dad8927fe" + hash: "5ed4ff5011c421e40bd0e1d021974efc" } Frame { msec: 800 - hash: "22a30051c87d4de7e734d9de6ce7eed8" + hash: "b183261aca9e8f887f4d489d8c81f583" } Frame { msec: 816 - hash: "d8625628587feace367fc97c1f11aff8" + hash: "c4672d92bb4f0e8cb8e10fcef11a36e2" } Frame { msec: 832 - hash: "e9dbbf715fc094cb22ecd5c6df602f95" + hash: "beb2c18162ea197b486b217f15f784e7" } Frame { msec: 848 - hash: "ca69b2b9f8e6b16e3bc6d93598b6c75a" + hash: "9f5198e08dc16e80f500804ba8ae7afb" } Frame { msec: 864 - hash: "87e09752e39df5042aef163fe4ed0b47" + hash: "d892706fd28d55adcdacdf72a2f7ad83" } Frame { msec: 880 - hash: "80adfaf02838c8bd372e53d0483fbac5" + hash: "1ed182b5b27ed7ed59c56c450a73975d" } Frame { msec: 896 - hash: "9934a1aece14ba7369b00cf2620cd207" + hash: "74756064676c5d5c9eacaea31a7b357d" } Frame { msec: 912 - hash: "954a70a949fdcca4e4412174f30653c3" + hash: "64f79b420b38bda6e102163b90be5f4f" } Frame { msec: 928 - hash: "850fa936516f8b145465eac39c9a74a6" + hash: "0d1f92cafc507af799953771cee7c265" } Frame { msec: 944 - hash: "1d844e8a7c710ccbf31f47470cc9abf2" + hash: "887ef63951fb56fd50f4de9afe8db1a8" } Frame { msec: 960 @@ -246,239 +246,239 @@ VisualTest { } Frame { msec: 976 - hash: "33f4eee3f6e3fb715463254d727ef898" + hash: "f09fc1e1ebc8c627c89c741ac263e3f4" } Frame { msec: 992 - hash: "68648a3f75f58b34dd9770a9edc2caea" + hash: "30bb26df58c83ff70d767e01f0df5140" } Frame { msec: 1008 - hash: "ad0d431ab7e6cfbb43053050a1cf5e40" + hash: "dbd83b1749a42edd6d26097ade1c67ba" } Frame { msec: 1024 - hash: "d1ae74c9bf3826d30fb461ca2fd8e36a" + hash: "7fa50f111158dc6a3e245eb23e57a3f3" } Frame { msec: 1040 - hash: "bda9d77c68a30d491abdfbfcf854c5ea" + hash: "267ef8b555a62abb44e8b5cf88c83110" } Frame { msec: 1056 - hash: "386ea303f8102339f8cd5ae88fd5f6bc" + hash: "78b2d13be078f2e7e94d685994b6488e" } Frame { msec: 1072 - hash: "8c81d3992851ebeb3cb820bc4510af66" + hash: "1d47caf40c85bc1e23bf8d22160d333d" } Frame { msec: 1088 - hash: "566813e312ffdde4a7d3af4276bc8cdd" + hash: "abeaf0a9bedfd62e56f12fa612bf287f" } Frame { msec: 1104 - hash: "d9c8b391b12ee40aa393f4fb39c12a16" + hash: "0f66d12b082398c9f43ef868632529ab" } Frame { msec: 1120 - hash: "f2bf70bda626089437f0ab67ad62d8f6" + hash: "957340efea7ce168889c2ae1b867c6d0" } Frame { msec: 1136 - hash: "88b2d1ecd7d51d0bf8c947a3433b7013" + hash: "4d83e6160f5d9097a4b73bf4104fa11b" } Frame { msec: 1152 - hash: "e93e0553c5dcc6dcd21dad0932d1e3fa" + hash: "d2811de76d3c0cc8ebd67583e50deaae" } Frame { msec: 1168 - hash: "c1ec148772d399ea4934cdfc514f6980" + hash: "cb13f2d6985e841b2da453860d7ddd65" } Frame { msec: 1184 - hash: "14f286793de5452f4677e8b6fd5c1e7e" + hash: "1e48b355ff1e136bcd982a749ba49089" } Frame { msec: 1200 - hash: "220a7df0af53fc9a2442956128091ad8" + hash: "9f9abd7b167a834449510a02d368155b" } Frame { msec: 1216 - hash: "84c49512f5e9f138901b3833a5adbcab" + hash: "6a75c81527b3bb85f70c08f669d46139" } Frame { msec: 1232 - hash: "b05410caa120f5a4191a44b84aa17a8c" + hash: "eafd6f87fb88f6f51cf27d5dd4faa7c8" } Frame { msec: 1248 - hash: "e1f6db204f62394205c1d4d56bbf9f52" + hash: "ba43e681c7f2677b81fa4fe87a5e612c" } Frame { msec: 1264 - hash: "f45033d1350009e09f62e81aeec297a5" + hash: "f83f06320c3e7c2352dd8e8839d63063" } Frame { msec: 1280 - hash: "dfd88b1dba38ab8260e00b3810b89318" + hash: "713afe22640941e9ea4925158099c514" } Frame { msec: 1296 - hash: "17503276f68e365cde03607d66fe4c8e" + hash: "53766caa0ab92bbd2e3d69e6ab9a8fe7" } Frame { msec: 1312 - hash: "28f03c5c0fe5c4647c5b9d3b72a07c76" + hash: "af98650b68d48fd3776d0334904b9e75" } Frame { msec: 1328 - hash: "ea2082529b50543fab22497e01938102" + hash: "62439fba28fbc0d4a129ccd5edf81b8b" } Frame { msec: 1344 - hash: "a700a2f3721625b1ec68107884d1ce67" + hash: "75c67b227f23a3ef5c01aca285f3617c" } Frame { msec: 1360 - hash: "ce717f1f1d98158aeef1cc6a9485dc80" + hash: "3a5e1fe4a9454e9636fbebdfb005e3ac" } Frame { msec: 1376 - hash: "7febe7c67e1c159881de72f62800a505" + hash: "2e4cdc140a9faedc8fbc9a0ec20b1a4c" } Frame { msec: 1392 - hash: "474931cb44a8e18426b9c2cc9f6df482" + hash: "f937d5b14fb0360afb14dbcce1b0ad9a" } Frame { msec: 1408 - hash: "1085b4873b9a4934882a163be72a2710" + hash: "20cb9e30c1a89bae3081427328887361" } Frame { msec: 1424 - hash: "59e7911800e915e6f159cb111ce61a54" + hash: "67f19061f97630a35b59357dcba9c5f0" } Frame { msec: 1440 - hash: "6d0d780ffc726b04f9885c25b08d1009" + hash: "f1b4041797873b7ff9e318542186eaf8" } Frame { msec: 1456 - hash: "bf896d6403dc1ad26536cc1165e71e9e" + hash: "ecbdc77e1b58decad29a6dfc654fba20" } Frame { msec: 1472 - hash: "86397c7dcf5ed34edbbaa465ae6eab43" + hash: "6d0b821c08b024aa8fc71ec5c0e98c53" } Frame { msec: 1488 - hash: "ed1b4967bf14eead9cb4d2dcfbdb46c2" + hash: "5137c7ee6879b98478a4edb1b5a0d79c" } Frame { msec: 1504 - hash: "67b7e59c8f945d1f3bdb1944fa736ecf" + hash: "17c80c758e9d0721a3b791dbabe0d34f" } Frame { msec: 1520 - hash: "b5f95e89f39d1c4821ba38547b0f2e3b" + hash: "abc1fe8d97b87f891ac53673fe64bf0d" } Frame { msec: 1536 - hash: "5bc91c9e35afa255a2dda28db9802b1e" + hash: "fe8c8ce5f0cf676310e4ce85c1755f0f" } Frame { msec: 1552 - hash: "84fab4042e0ff891ca1998cbfbb60e5a" + hash: "40eff7ab7370e7a3de28a55e200812ca" } Frame { msec: 1568 - hash: "7c5ef5025a06e990171dac3e8fd93977" + hash: "8ff86cc730f4b7877ed7890f62dd8f17" } Frame { msec: 1584 - hash: "ab4cd0e103d71a35250668ad850a5213" + hash: "a87e34b8d9e75d03493c94a96ef97c25" } Frame { msec: 1600 - hash: "aa974c4b2290f7febb121344623de86d" + hash: "807a4b4652ed228084660bfdf98efd50" } Frame { msec: 1616 - hash: "ff6ee1b50ca356dc98038a459e318b32" + hash: "ca245fcf490c3bc17bef1a38d793f573" } Frame { msec: 1632 - hash: "022fe9c391514fdd98bc1c38bc383df2" + hash: "6662d0e4e7778f560c8956e9fe4aa079" } Frame { msec: 1648 - hash: "b1a33c9c9cbdcc1c8c9c982eef041ccd" + hash: "c47d90df3dbb1656ef425209f1b528b1" } Frame { msec: 1664 - hash: "0945e66ab5aa81beacf662eb82ec39ed" + hash: "c9dbf06207cf9b8d03cf20f4e4131979" } Frame { msec: 1680 - hash: "ae293f675dbdd88dec8f924140033cc9" + hash: "dfab00fee3cf9f0f76d66f64eed6de84" } Frame { msec: 1696 - hash: "5ace5013e3d51a8db338f65011dd10f8" + hash: "b38a29a29bf30c197e5434a942e805cf" } Frame { msec: 1712 - hash: "9466a4e96d647f2bd8845697fce89399" + hash: "589496ebac7f7ea699b869291db7ed45" } Frame { msec: 1728 - hash: "73bbbfc57e020c6a0acbd5fdfa711c30" + hash: "c7a037e3e755c1c8fecd17db7596a9cd" } Frame { msec: 1744 - hash: "d71d7182107c3d6b004a57a321caee96" + hash: "faca2e1e88556ffd1f71bbc5ceae5cb1" } Frame { msec: 1760 - hash: "0902867c89e536cffcde69bde2eb1994" + hash: "5837a888d83513fb4c0bce11a34fc3df" } Frame { msec: 1776 - hash: "39fc26943f6077272c36e93b7cbf6994" + hash: "07f8fe9ded8271396db503c3927244bb" } Frame { msec: 1792 - hash: "92931d5a6e57fb9df60785a64d3a6f78" + hash: "345fffbc210b55a4bd78cb8a4e12d025" } Frame { msec: 1808 - hash: "fffd632552f88f2979ef85de0ce585c2" + hash: "7b9aa96eb9a1fe77fbb8b607140885b7" } Frame { msec: 1824 - hash: "9f97bfcffbb5d127c5eee852b30a13c4" + hash: "d66748cc52a364231ac8a6a677d9bdc6" } Frame { msec: 1840 - hash: "ea9ee0293fbc45d3467e29c09e42adcd" + hash: "40cf9aece08870358aef6c9836013472" } Frame { msec: 1856 - hash: "b5b75c50f8fae3fb3b88efad536c911b" + hash: "2015ab3c133862222b1375c775af743b" } Frame { msec: 1872 - hash: "25dcd3fa30c057d1a42c19cee1ce444b" + hash: "41e519acb18ed9f7cda2d3cd88fddd2c" } Frame { msec: 1888 - hash: "862d42abe7abd49d4a38e38a8c33a657" + hash: "8e583b74b2b90d7f5c78357f66801358" } Frame { msec: 1904 - hash: "a335f3c8c797c1bb5537b57f952c19d1" + hash: "3a6755e25045d937743371a98792a546" } Frame { msec: 1920 @@ -486,239 +486,239 @@ VisualTest { } Frame { msec: 1936 - hash: "da1cf98fdfe5acbe30cfbe66389aa240" + hash: "f80a8f65def55d556732bfefe3debe72" } Frame { msec: 1952 - hash: "088f3209c0363c06cf0607c58d00ca2d" + hash: "308cbe6344b9aea4c6b7ad2ef606de59" } Frame { msec: 1968 - hash: "47ba3bf2604b21f331a2e00f05926aaf" + hash: "fd2d31f6f4a3b4ce1aec1e309c48ae94" } Frame { msec: 1984 - hash: "5ff0de383abdefad76380af144bd9d80" + hash: "a02ed4aa3783049ffbf7ef6dfb4e8926" } Frame { msec: 2000 - hash: "b972d1c85d3d8777f84b54dc118172fd" + hash: "dde64769b3affc776fe0e747a4d621ef" } Frame { msec: 2016 - hash: "37581c3fbef2088b7d14b6c7bbf3cdc3" + hash: "3fa830b629939520c071b3e6fe94156e" } Frame { msec: 2032 - hash: "4ad6a06ac6de9dea66e9ce873a6618c1" + hash: "ae582350cba12ce47306f2a967e396fd" } Frame { msec: 2048 - hash: "3a0379ad966235044508c144ffbc336b" + hash: "a4483eadd2bf3e3e9fae51279b50e18a" } Frame { msec: 2064 - hash: "cb5a9510400943d77c9a296066f037e2" + hash: "742fc008fab89087b1bceee33889db19" } Frame { msec: 2080 - hash: "7bd5673a1d2ad8079df2569149e5811e" + hash: "5da9546b147737dd671813725cb196f7" } Frame { msec: 2096 - hash: "bd327ff6b8a4081b3a41cb0035403037" + hash: "c979bccf2603c400b4c93d1be6f698d1" } Frame { msec: 2112 - hash: "f0f9f559251f7648cd60e66ac745962d" + hash: "b7c6391ce59e054ae53e3731788dfc05" } Frame { msec: 2128 - hash: "18827630a859b0ce497f682e33558fae" + hash: "0371e17fdaa7be7af0cff132f164d6b4" } Frame { msec: 2144 - hash: "e22d8110cbe34acddba799942872645d" + hash: "6973ce2af671f4d500da3c5a37534693" } Frame { msec: 2160 - hash: "11564e7221524cc3655c2c5f1d7e42b6" + hash: "f9128da47afa801c6b3670752847a8d1" } Frame { msec: 2176 - hash: "6468721ee38209aaf2c82a320bcd122e" + hash: "2e4a7001c3c1bb7153f631da1b273aa1" } Frame { msec: 2192 - hash: "19772d0f422fd206645ae6cf0be30b59" + hash: "65d41139c27a4a94a817e1b5c8aa765d" } Frame { msec: 2208 - hash: "48b6c7e1317b9a66238c17afceb5121f" + hash: "36652e407957b59bad2e0e9b2fa5a8fe" } Frame { msec: 2224 - hash: "82a1af78709b78cce2d9b4eed7f8477c" + hash: "c0fe78ff8fc3119b30a1d9e5b98fafbb" } Frame { msec: 2240 - hash: "36e2366eccbdd2d16c19829c34fbff87" + hash: "41b798eac11e696e5e690d13e8ce88b1" } Frame { msec: 2256 - hash: "271db39ca46c59ddc279fb41a9d191af" + hash: "20efbef05b6eed5a916e55ba25c10a59" } Frame { msec: 2272 - hash: "ee279a90e86aa89b1c3d745ab030180d" + hash: "dc897fb0d232a39215d5d004e322cb2a" } Frame { msec: 2288 - hash: "14e8c72d770644f4cec99e65aeff0d75" + hash: "33c1f9bb344a31a1a0973a527c22edac" } Frame { msec: 2304 - hash: "56fa1756eb11a30f07f8f31c22c99973" + hash: "0b54b02eedc60e8d7b147092b9bd6bca" } Frame { msec: 2320 - hash: "165af677ff3921f06b89b2c8d76a7924" + hash: "02cb9a222c9b109cbff956238a61b31b" } Frame { msec: 2336 - hash: "d64aa248d9b207b87e5ba14bdabf2f6c" + hash: "bfb067d4519861b22e20847083447a22" } Frame { msec: 2352 - hash: "33e9716eb9ca62fe5c5cb1b1ee0e9e68" + hash: "86f599f6844c2046148c682abfe6c417" } Frame { msec: 2368 - hash: "cff2316820c469b84c3bacabfcf1a551" + hash: "fa07ac104183fe94fd3a381595582d76" } Frame { msec: 2384 - hash: "9f1359c4bab95244602254ca3954e2b7" + hash: "8ee792f06fa7e877ce0b160bcf170e70" } Frame { msec: 2400 - hash: "d6246d2aaea895755eab4c839c35ca9d" + hash: "bb39f4374215e9b4eafbc3320d4144b6" } Frame { msec: 2416 - hash: "d446e1ac91fec10482b0c6d38ce86d17" + hash: "d91f778ced58466dd6b79f50cdbfe1a8" } Frame { msec: 2432 - hash: "99f443af76a9e0d2d03638bc9927fda3" + hash: "0fd47896c9d9d74e40c38d0f532aa537" } Frame { msec: 2448 - hash: "a9169e293b8154947332d9754fd23af3" + hash: "0b7ec227fc884616bd17439bf0d40ac1" } Frame { msec: 2464 - hash: "cc6851cc5864615c000fbc8d552eb593" + hash: "e88d4e76d353701c738120e169ccf2a8" } Frame { msec: 2480 - hash: "58a3a6edb5842c88cb73b79a8a187717" + hash: "1564432d4aea1826e543f41dfc9a8113" } Frame { msec: 2496 - hash: "42bcf77c98c9a80508446bd8c66e935b" + hash: "02825fa9174c0a45e19c564030ba9ad0" } Frame { msec: 2512 - hash: "0f99350ae151591fbda95158c046e072" + hash: "c7671a2bb3f0dcb2be48805ef1970dbd" } Frame { msec: 2528 - hash: "9e817e2fd8377b7117f908c4e87d4d57" + hash: "2fa407b026edbb8b9e0edc263fd9ecc5" } Frame { msec: 2544 - hash: "72c105bce75feeeb7a86f823945b4ff9" + hash: "211f3c82cff939cd1ed324180d40aab2" } Frame { msec: 2560 - hash: "653b858445bdd8afdf8abd27f5e53fb8" + hash: "0fb3de6e1865e49ac281ac12e2032f07" } Frame { msec: 2576 - hash: "18bf39154fbf4b42c4d3303e018a2f27" + hash: "a08e0127a0b6172715aa6a10d6e0799e" } Frame { msec: 2592 - hash: "5ed5d52ab7da7ae77e97f3ace09b3b8d" + hash: "57a3d1530042f0d6a6dbf84059a8d730" } Frame { msec: 2608 - hash: "1d382462e5746ee9b6df980364b1c96b" + hash: "9aae6364941f988409b8db63db72fccb" } Frame { msec: 2624 - hash: "2a0a561f38c113a0f177b1c2b99ee5e1" + hash: "9e466ce9c8b54dc95960d21b0b41fdd1" } Frame { msec: 2640 - hash: "0605d3e2dd9132d9c1d25b75a870d647" + hash: "189e0f3c60cd521a6bf52054fa6039c6" } Frame { msec: 2656 - hash: "a1def1576f386c90bb80d46e254bd384" + hash: "1020f18d41a4d83e0b5ae387b486b5ff" } Frame { msec: 2672 - hash: "cf38d4ae577047048d2bd0a4005abfe2" + hash: "26fcea12cc2de8c8cb8caf049937d7c6" } Frame { msec: 2688 - hash: "d7cb6715cd89978bbca5ce4c93b488e5" + hash: "e5b9e752dc668cd4f6803ea772bbb7b0" } Frame { msec: 2704 - hash: "9a5075ee794af14d4f17a52bdbc47f1e" + hash: "a0df9360ed11207076fc77810c1d8605" } Frame { msec: 2720 - hash: "fd3d803a1e5e9e3eeae7d5edcddd0072" + hash: "56dea4551a9532e80dfd6c79031ec08b" } Frame { msec: 2736 - hash: "445114e7d10581a475989e469323d83d" + hash: "900c62773477b2843464b75f67d50c90" } Frame { msec: 2752 - hash: "58328c1d4c0ee7fca78b684697f1922c" + hash: "177de9647549a276256a5e74d5ef7134" } Frame { msec: 2768 - hash: "433df4d872b9565b43af5afce1b42e15" + hash: "cb3eb956096de4f6b51ab249d184a6dd" } Frame { msec: 2784 - hash: "3b694f15722a087c2c9a860cad8bb6de" + hash: "6671e46d013f72bef5e3d0d95ba70301" } Frame { msec: 2800 - hash: "1986c8036bd548ca06a32aa98ab4fc83" + hash: "33910dc69eff13f9c144b7ff84187a59" } Frame { msec: 2816 - hash: "7845dbb0e38145f54a9e4e0bfbd608db" + hash: "dfa20711b0821b66cb2bdd2806e34d03" } Frame { msec: 2832 - hash: "caed393910ae7467c307a314bdf459ef" + hash: "16e2674c2449bf059aa2a0add077e040" } Frame { msec: 2848 - hash: "f3f6b41b7ed04dbc1693c169bdae3b13" + hash: "cdd2a820076cfa9529d93787de61267e" } Frame { msec: 2864 - hash: "b9a87d15d48f951b0a1d6962fb1d5995" + hash: "a851a1e017e90877d6d8027633401bcc" } Frame { msec: 2880 @@ -726,58 +726,50 @@ VisualTest { } Frame { msec: 2896 - hash: "954300274b6a5785e03a6cdae67238e9" + hash: "f159f17caa8df7ae09141462cd9b75ab" } Frame { msec: 2912 - hash: "5b7f51afad796107289369c7d3494843" + hash: "f6a8787008d24bffa6813799042a0d69" } Frame { msec: 2928 - hash: "41164f28cbb94528eda719d590d1cf75" + hash: "18e79f454a628098c41ff8882b663a53" } Frame { msec: 2944 - hash: "5953d4c9a4b4c83ba1dfd83a57ec2742" + hash: "74676f4f2d8612bc02f72e3bf855c060" } Frame { msec: 2960 - hash: "0be7c6187a26b44f12bf71587372a6c7" + hash: "8276c61e080635dd37954837998a14a6" } Frame { msec: 2976 - hash: "a7cab1faf0cdd5649c8ea3c26d2e80d0" + hash: "4cceb2274ce5584315109ac45ef8fce7" } Frame { msec: 2992 - hash: "5f91bef1865623030aea20805993319a" + hash: "c4e87037c2265f85fef3b681b840c6f9" } Frame { msec: 3008 - hash: "69d34e2a27c471ad44f8aba8d906a961" + hash: "aed160bb820dc5cdf1ee320b019436c4" } Frame { msec: 3024 - hash: "5a987879aff30d6c6712c0631bc2f43d" + hash: "593acf3e67bc3428f61b723996093d8d" } Frame { msec: 3040 - hash: "62b9132c58cd5fdcfe7f1bc5e64885cf" + hash: "694d197caff9144204a82a682d47724c" } Frame { msec: 3056 - hash: "d394ef9b504abf94c1d28a9fb7f3c28b" + hash: "12519eda928f8aef0e2a21e9fc0f8756" } Frame { msec: 3072 - hash: "a559cc25af950227fa5fdf70be7fd94c" - } - Frame { - msec: 3088 - hash: "318dde40fc72c5f8ee45b865a68922b1" - } - Frame { - msec: 3104 - hash: "3cbfd55773e52f48f01fe66c28c0b992" + hash: "ae8cba17b25e9567211f4cd20080cb09" } } diff --git a/tests/auto/declarative/visual/qmlgraphicsparticles/particles.qml b/tests/auto/declarative/visual/qmlgraphicsparticles/particles.qml index 8fb793f..a7a8143 100644 --- a/tests/auto/declarative/visual/qmlgraphicsparticles/particles.qml +++ b/tests/auto/declarative/visual/qmlgraphicsparticles/particles.qml @@ -3,11 +3,12 @@ import Qt 4.6 Rectangle { width: 640; height: 480; color: "black" + Particles { emitting: false } Particles { id:particlesA y:0; width: 260; height:30; source: "star.png"; lifeSpan:1000; count: 50; angle:70; angleDeviation:36; velocity:30; velocityDeviation:10; emissionRate: 10 - ParticleMotionWander { xvariance:30; pace:100 } + ParticleMotionWander { yvariance:5; xvariance:30; pace:100 } } Particles { id:particlesB -- cgit v0.12 From f360647095238c9106ea5ece5f3405dd77a78887 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Mon, 9 Nov 2009 12:59:19 +1000 Subject: visual test for Flipable --- .../qmlgraphicsflipable/data/test-flipable.0.png | Bin 0 -> 1092 bytes .../qmlgraphicsflipable/data/test-flipable.1.png | Bin 0 -> 1134 bytes .../qmlgraphicsflipable/data/test-flipable.2.png | Bin 0 -> 961 bytes .../qmlgraphicsflipable/data/test-flipable.3.png | Bin 0 -> 1074 bytes .../qmlgraphicsflipable/data/test-flipable.4.png | Bin 0 -> 1134 bytes .../qmlgraphicsflipable/data/test-flipable.5.png | Bin 0 -> 969 bytes .../qmlgraphicsflipable/data/test-flipable.qml | 1623 ++++++++++++++++++++ .../visual/qmlgraphicsflipable/test-flipable.qml | 83 + 8 files changed, 1706 insertions(+) create mode 100644 tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.0.png create mode 100644 tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.1.png create mode 100644 tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.2.png create mode 100644 tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.3.png create mode 100644 tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.4.png create mode 100644 tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.5.png create mode 100644 tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicsflipable/test-flipable.qml diff --git a/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.0.png b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.0.png new file mode 100644 index 0000000..3d5acbc Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.0.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.1.png b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.1.png new file mode 100644 index 0000000..bebb1aa Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.1.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.2.png b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.2.png new file mode 100644 index 0000000..d092053 Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.2.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.3.png b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.3.png new file mode 100644 index 0000000..aa79f8b Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.3.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.4.png b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.4.png new file mode 100644 index 0000000..98e8817 Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.4.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.5.png b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.5.png new file mode 100644 index 0000000..a3f9d8f Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.5.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.qml b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.qml new file mode 100644 index 0000000..5464d01 --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicsflipable/data/test-flipable.qml @@ -0,0 +1,1623 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 32 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 48 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 64 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 80 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 96 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 112 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 128 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 144 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 160 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 176 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 192 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 208 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 224 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 240 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 256 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 272 + hash: "73c06997014af4e008b546b53fe349fb" + } + Frame { + msec: 288 + hash: "73c06997014af4e008b546b53fe349fb" + } + Frame { + msec: 304 + hash: "73c06997014af4e008b546b53fe349fb" + } + Frame { + msec: 320 + hash: "451a9408b04826ab35749d9120efd6bb" + } + Frame { + msec: 336 + hash: "451a9408b04826ab35749d9120efd6bb" + } + Frame { + msec: 352 + hash: "1c25b3d65e8590f8c213afa76b722e97" + } + Frame { + msec: 368 + hash: "1c25b3d65e8590f8c213afa76b722e97" + } + Frame { + msec: 384 + hash: "1c25b3d65e8590f8c213afa76b722e97" + } + Frame { + msec: 400 + hash: "e64fa5eba05f81e6f263dc8543f21b1a" + } + Frame { + msec: 416 + hash: "e64fa5eba05f81e6f263dc8543f21b1a" + } + Frame { + msec: 432 + hash: "845581f8d03f4fe9323fc282e84f919b" + } + Frame { + msec: 448 + hash: "845581f8d03f4fe9323fc282e84f919b" + } + Frame { + msec: 464 + hash: "136fb272f4d806927b46a1269b18f63d" + } + Frame { + msec: 480 + hash: "8532ee7ce3488f9e038643e4fa48751d" + } + Frame { + msec: 496 + hash: "8532ee7ce3488f9e038643e4fa48751d" + } + Frame { + msec: 512 + hash: "af5f794f73e16a5c3b9e437418c873ee" + } + Frame { + msec: 528 + hash: "af5f794f73e16a5c3b9e437418c873ee" + } + Frame { + msec: 544 + hash: "d75e53f2cea8e9b61a5e50f95060552e" + } + Frame { + msec: 560 + hash: "0374aae76f8cfd75f119ff4b86dba817" + } + Frame { + msec: 576 + hash: "d36e1a56078d7cfa246b57f886c230b4" + } + Frame { + msec: 592 + hash: "d36e1a56078d7cfa246b57f886c230b4" + } + Frame { + msec: 608 + hash: "30692e6658ac730670a489c880fd4485" + } + Frame { + msec: 624 + hash: "3aace4dc5bc503ed0df1b00b444780f0" + } + Frame { + msec: 640 + hash: "b6936d72cbaff0c6bb64fc08152e8680" + } + Frame { + msec: 656 + hash: "b6936d72cbaff0c6bb64fc08152e8680" + } + Frame { + msec: 672 + hash: "8beee45f26f9f7b94b84a807a0c42217" + } + Frame { + msec: 688 + hash: "80529f6b8d12838b58c4af73c1985792" + } + Frame { + msec: 704 + hash: "967f7e4f58a8e29b5d76eac011af643d" + } + Frame { + msec: 720 + hash: "395863cffd5440b0a4805975b766a3cf" + } + Frame { + msec: 736 + hash: "f9c919f45316d93d2c8693b62930850f" + } + Frame { + msec: 752 + hash: "cf8ffc1132935b5df49da90953009fa0" + } + Frame { + msec: 768 + hash: "8e44d6cf4c29313352ad0118db003958" + } + Frame { + msec: 784 + hash: "31ca6f5b62fd8c08fa17b1008c4e6a22" + } + Frame { + msec: 800 + hash: "96773abcace99ba692a5be096df85a54" + } + Frame { + msec: 816 + hash: "e92daff761c739f231ba2c05785c44fb" + } + Frame { + msec: 832 + hash: "c1b1056ef06a0454680f2146bb87a56b" + } + Frame { + msec: 848 + hash: "dc02f4f6b0ff1572a64fd133819fd794" + } + Frame { + msec: 864 + hash: "9f87d4d33942d32a4048ca2b785a1fed" + } + Frame { + msec: 880 + hash: "57d989f52d8bee06694166bf8bdffef0" + } + Frame { + msec: 896 + hash: "09c3602a08d6d3e2afb654c328606871" + } + Frame { + msec: 912 + hash: "b075ae21dbd3acef5c4d0f11cadce3c9" + } + Frame { + msec: 928 + hash: "d54b5b295a9ca2bc65131a0775d8d009" + } + Frame { + msec: 944 + hash: "599b244ff9b4ddceb682a059338f6f97" + } + Frame { + msec: 960 + image: "test-flipable.0.png" + } + Frame { + msec: 976 + hash: "9fd5a0f023f89511bdd4b7e429f940ab" + } + Frame { + msec: 992 + hash: "ad18f401dc07032ffc52b90fd5581319" + } + Frame { + msec: 1008 + hash: "b12cbf8e97bc48e12d9543ffc1c578a2" + } + Frame { + msec: 1024 + hash: "7c9895dae776c2a4a6d5e1dd50d86336" + } + Frame { + msec: 1040 + hash: "ebd8018990ce867c3308121dccbfc1bc" + } + Frame { + msec: 1056 + hash: "4818f99e2f71c0ec7636aa777f4df875" + } + Frame { + msec: 1072 + hash: "09371a634d7801742075aadc131b5fb6" + } + Frame { + msec: 1088 + hash: "e03e96eaa2640cf6d820d9992c0c51f4" + } + Frame { + msec: 1104 + hash: "daf19227a7e51e437d0a13fdf8b1a26f" + } + Frame { + msec: 1120 + hash: "539ccebf96da504f0c5dfe5496ed95ce" + } + Frame { + msec: 1136 + hash: "63d851b3a8758e4cd95624b44cf9e7c9" + } + Frame { + msec: 1152 + hash: "8ee67f06977858444a775ca8c5109411" + } + Frame { + msec: 1168 + hash: "44849e7b8cc8d187da234daba784bc6e" + } + Frame { + msec: 1184 + hash: "ec9892a5602892ba5a2075b61672d91b" + } + Frame { + msec: 1200 + hash: "b12aec87daa7c09276ae5d4b619276a1" + } + Frame { + msec: 1216 + hash: "816d9d278fecde0867efadae2c4b5839" + } + Frame { + msec: 1232 + hash: "65daf0b21f860cb87c28a11c3d947f3b" + } + Frame { + msec: 1248 + hash: "f3bc5c605ac0cb287e8c1d1cb58d85ca" + } + Frame { + msec: 1264 + hash: "2988cc8030891abd7493294fc2c6964c" + } + Frame { + msec: 1280 + hash: "cbfc98561559f3aa8bdec7c40da559c0" + } + Frame { + msec: 1296 + hash: "636335822b15f32861696439773e1794" + } + Frame { + msec: 1312 + hash: "3fbb7a8920ff95fce7bfefcb540c6de8" + } + Frame { + msec: 1328 + hash: "4036080b6aafa72e5310ce33615ff8f8" + } + Frame { + msec: 1344 + hash: "48fb5685e63e81f1790f5481bc06dac4" + } + Frame { + msec: 1360 + hash: "f1f58f0eebbffc3b389c6669c5419081" + } + Frame { + msec: 1376 + hash: "5481248e889fb4fe9f4cf54f69d9f614" + } + Frame { + msec: 1392 + hash: "efbf81fc1db57a6020fcfe97077233b7" + } + Frame { + msec: 1408 + hash: "67ff11e6143718c95418f4851265081e" + } + Frame { + msec: 1424 + hash: "a403ec3d25e73b557ba08aa903cb9006" + } + Frame { + msec: 1440 + hash: "293b9f1cc31af93f22b4c1369567c4ba" + } + Frame { + msec: 1456 + hash: "8ff7cee41c6f19eeda417052c1b071d6" + } + Frame { + msec: 1472 + hash: "cd8d4484158d7dcdc7662ea8c8daea07" + } + Frame { + msec: 1488 + hash: "b991e62a7d6751bdd3e2d690e690821c" + } + Frame { + msec: 1504 + hash: "c60aca5007dadc628f242db9d593cf1f" + } + Frame { + msec: 1520 + hash: "e78af45d2042130a9d34b654157a9ada" + } + Frame { + msec: 1536 + hash: "cc35b2fcc585191d3f46840fdcacc94f" + } + Frame { + msec: 1552 + hash: "9e33a9f73e1019e7d694d108fd95f2ad" + } + Frame { + msec: 1568 + hash: "f08adfe4286703702c9393a905ec01d2" + } + Frame { + msec: 1584 + hash: "56bdfcb8fbb776b3799676ba7934a354" + } + Frame { + msec: 1600 + hash: "da3b8e41b9639bb71cf95b671d8a2c63" + } + Frame { + msec: 1616 + hash: "92855bf2208369f361b677bc66e9c79d" + } + Frame { + msec: 1632 + hash: "e5403ff384dca3c10b091e166160624f" + } + Frame { + msec: 1648 + hash: "932b5ebeaa4576575179b04a4c131ef5" + } + Frame { + msec: 1664 + hash: "37a23d4a895fa83226f66736caa87281" + } + Frame { + msec: 1680 + hash: "f6926e493dfd7deee613cf9bb7529f5e" + } + Frame { + msec: 1696 + hash: "338e40ae3e047cf7731377fc1b4d3cb7" + } + Frame { + msec: 1712 + hash: "0dfdd9a1d83a706a09318c83fd08b6fe" + } + Frame { + msec: 1728 + hash: "4487366ee7ec1e0fdafc88cfa82e7977" + } + Frame { + msec: 1744 + hash: "28f0b7824b5bb311d46c94afa7d7bb66" + } + Frame { + msec: 1760 + hash: "34b15e5a3602fd7bf2f217c308fa5d09" + } + Frame { + msec: 1776 + hash: "667b9286f32fe43a0cb5d65cdfa965cd" + } + Frame { + msec: 1792 + hash: "629888aae80ea85db07a383df352214a" + } + Frame { + msec: 1808 + hash: "9afbd09687efa09eb3b03570bf8be531" + } + Frame { + msec: 1824 + hash: "0e1dac5b9d2a0acab1516d01a286a0ec" + } + Frame { + msec: 1840 + hash: "dd058795bd3957d02dc296419c17819c" + } + Frame { + msec: 1856 + hash: "158618e8529cba8531183b2f72e90340" + } + Frame { + msec: 1872 + hash: "c9062e6405b3b7fd0b2a794119220b1d" + } + Frame { + msec: 1888 + hash: "8dadb6da9f12dac689406a43e7e61bea" + } + Frame { + msec: 1904 + hash: "fd66704ce98410a7b1dd69f7cd6ddd26" + } + Frame { + msec: 1920 + image: "test-flipable.1.png" + } + Frame { + msec: 1936 + hash: "d4a21104b4f8044486fbe6516e4ae7b5" + } + Frame { + msec: 1952 + hash: "20fd373c13d4d06b9105c80ed6f4edb7" + } + Frame { + msec: 1968 + hash: "ff9bc1aa538b69e72ed1a501ea0d56de" + } + Frame { + msec: 1984 + hash: "3f3d5f3ca770b84e86fea3188e082493" + } + Frame { + msec: 2000 + hash: "fe7de3d2083208993e527b13ae7edadd" + } + Frame { + msec: 2016 + hash: "b5f7c630f6e61c7ddac8493e17a1f53e" + } + Frame { + msec: 2032 + hash: "c80d37b370a4ada6217c81f5e82ecd6f" + } + Frame { + msec: 2048 + hash: "84051de621753e12e3e11316d14dfe73" + } + Frame { + msec: 2064 + hash: "fd238f83a26ed8c2cee3e3d042af903b" + } + Frame { + msec: 2080 + hash: "949d2ed3e1d1c674e77ef3c8a6b779ba" + } + Frame { + msec: 2096 + hash: "42f602bcd7b517cf16554a88998d16a8" + } + Frame { + msec: 2112 + hash: "318bd97d726826398887ff218e61df32" + } + Frame { + msec: 2128 + hash: "5a0699f422475f0d3f17cddb606b4715" + } + Frame { + msec: 2144 + hash: "3eb8e765ff9f38fd56a69a8bc2d534c3" + } + Frame { + msec: 2160 + hash: "dd548f565a0787789ec13e141f808b11" + } + Frame { + msec: 2176 + hash: "a78a6a9f014b8c2e7a202b80e6c2e09f" + } + Frame { + msec: 2192 + hash: "3d0ff083b6f1f994caa660016245876d" + } + Frame { + msec: 2208 + hash: "ce6a7491571ce3d5799791579428b615" + } + Frame { + msec: 2224 + hash: "67e700035648fd5354ec0806a412be89" + } + Frame { + msec: 2240 + hash: "b03f1bfe2bdbf52aae0dff6ae4821914" + } + Frame { + msec: 2256 + hash: "4d75ac3064288c3a56e9fd6ed6022fc6" + } + Frame { + msec: 2272 + hash: "dc6677725f6bf0bdcab25287a096a0e6" + } + Frame { + msec: 2288 + hash: "827e5e274fb331c6f9997172894b1f4d" + } + Frame { + msec: 2304 + hash: "c3cf3b3968441b735684fc6e55ebb1ce" + } + Frame { + msec: 2320 + hash: "01eebde46aff9d7484cffb0b0d27c415" + } + Frame { + msec: 2336 + hash: "614ad3481a993b5ff5ec008aa3d4751f" + } + Frame { + msec: 2352 + hash: "614ad3481a993b5ff5ec008aa3d4751f" + } + Frame { + msec: 2368 + hash: "2f253dcdbe2fabc768cdd5bfa8004a36" + } + Frame { + msec: 2384 + hash: "90b130853f8e28a01c90825c412f98b9" + } + Frame { + msec: 2400 + hash: "567bf7684e4b2f76715bcc588a2b7dfb" + } + Frame { + msec: 2416 + hash: "63412cfccdd8646530ebdb37eba16ee9" + } + Frame { + msec: 2432 + hash: "63412cfccdd8646530ebdb37eba16ee9" + } + Frame { + msec: 2448 + hash: "e1c5381a621dfe50e4b04d881ce2c4b7" + } + Frame { + msec: 2464 + hash: "553bff0aa031ed1279170c19bf024539" + } + Frame { + msec: 2480 + hash: "2b8c079d8526ce4d0640014cca38c6b8" + } + Frame { + msec: 2496 + hash: "2b8c079d8526ce4d0640014cca38c6b8" + } + Frame { + msec: 2512 + hash: "ac356478635b5d34001a50997eb3c82c" + } + Frame { + msec: 2528 + hash: "ac356478635b5d34001a50997eb3c82c" + } + Frame { + msec: 2544 + hash: "93d64e7bec7d9e254066d79c0db41f28" + } + Frame { + msec: 2560 + hash: "010ec13762826006a1dbf60b8c4660c9" + } + Frame { + msec: 2576 + hash: "010ec13762826006a1dbf60b8c4660c9" + } + Frame { + msec: 2592 + hash: "2f882016d4e3e29ec6689cfa1189e00e" + } + Frame { + msec: 2608 + hash: "2f882016d4e3e29ec6689cfa1189e00e" + } + Frame { + msec: 2624 + hash: "676f8aba3379c9935b9bd269bd140cf2" + } + Frame { + msec: 2640 + hash: "676f8aba3379c9935b9bd269bd140cf2" + } + Frame { + msec: 2656 + hash: "78e0dca60c04d3defbd90457685dbab3" + } + Frame { + msec: 2672 + hash: "78e0dca60c04d3defbd90457685dbab3" + } + Frame { + msec: 2688 + hash: "0ff9fd6b09fc14abacb794353b9500f6" + } + Frame { + msec: 2704 + hash: "0ff9fd6b09fc14abacb794353b9500f6" + } + Frame { + msec: 2720 + hash: "0ff9fd6b09fc14abacb794353b9500f6" + } + Frame { + msec: 2736 + hash: "6d813ee777a5900c65aca5939c004d0c" + } + Frame { + msec: 2752 + hash: "6d813ee777a5900c65aca5939c004d0c" + } + Frame { + msec: 2768 + hash: "0acaa3ece071ad4461cf4a79d65a0f03" + } + Frame { + msec: 2784 + hash: "0acaa3ece071ad4461cf4a79d65a0f03" + } + Frame { + msec: 2800 + hash: "0acaa3ece071ad4461cf4a79d65a0f03" + } + Frame { + msec: 2816 + hash: "0acaa3ece071ad4461cf4a79d65a0f03" + } + Frame { + msec: 2832 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 2848 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 2864 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 2880 + image: "test-flipable.2.png" + } + Frame { + msec: 2896 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 2912 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 2928 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 2944 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 2960 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 2976 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 2992 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 3008 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 3024 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 3040 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 3056 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 3072 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 3088 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 3104 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 3120 + hash: "1daeebce8e7eef80b135d2e4f83f780b" + } + Frame { + msec: 3136 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 3152 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 3168 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 3184 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 3200 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 3216 + hash: "b2ef52b66896649413b3852bcf642e1c" + } + Frame { + msec: 3232 + hash: "0acaa3ece071ad4461cf4a79d65a0f03" + } + Frame { + msec: 3248 + hash: "0acaa3ece071ad4461cf4a79d65a0f03" + } + Frame { + msec: 3264 + hash: "0acaa3ece071ad4461cf4a79d65a0f03" + } + Frame { + msec: 3280 + hash: "6d813ee777a5900c65aca5939c004d0c" + } + Frame { + msec: 3296 + hash: "6d813ee777a5900c65aca5939c004d0c" + } + Frame { + msec: 3312 + hash: "6d813ee777a5900c65aca5939c004d0c" + } + Frame { + msec: 3328 + hash: "0ff9fd6b09fc14abacb794353b9500f6" + } + Frame { + msec: 3344 + hash: "0ff9fd6b09fc14abacb794353b9500f6" + } + Frame { + msec: 3360 + hash: "78e0dca60c04d3defbd90457685dbab3" + } + Frame { + msec: 3376 + hash: "78e0dca60c04d3defbd90457685dbab3" + } + Frame { + msec: 3392 + hash: "78e0dca60c04d3defbd90457685dbab3" + } + Frame { + msec: 3408 + hash: "676f8aba3379c9935b9bd269bd140cf2" + } + Frame { + msec: 3424 + hash: "676f8aba3379c9935b9bd269bd140cf2" + } + Frame { + msec: 3440 + hash: "2f882016d4e3e29ec6689cfa1189e00e" + } + Frame { + msec: 3456 + hash: "2f882016d4e3e29ec6689cfa1189e00e" + } + Frame { + msec: 3472 + hash: "010ec13762826006a1dbf60b8c4660c9" + } + Frame { + msec: 3488 + hash: "93d64e7bec7d9e254066d79c0db41f28" + } + Frame { + msec: 3504 + hash: "93d64e7bec7d9e254066d79c0db41f28" + } + Frame { + msec: 3520 + hash: "ac356478635b5d34001a50997eb3c82c" + } + Frame { + msec: 3536 + hash: "ac356478635b5d34001a50997eb3c82c" + } + Frame { + msec: 3552 + hash: "2b8c079d8526ce4d0640014cca38c6b8" + } + Frame { + msec: 3568 + hash: "553bff0aa031ed1279170c19bf024539" + } + Frame { + msec: 3584 + hash: "e1c5381a621dfe50e4b04d881ce2c4b7" + } + Frame { + msec: 3600 + hash: "e1c5381a621dfe50e4b04d881ce2c4b7" + } + Frame { + msec: 3616 + hash: "63412cfccdd8646530ebdb37eba16ee9" + } + Frame { + msec: 3632 + hash: "567bf7684e4b2f76715bcc588a2b7dfb" + } + Frame { + msec: 3648 + hash: "90b130853f8e28a01c90825c412f98b9" + } + Frame { + msec: 3664 + hash: "90b130853f8e28a01c90825c412f98b9" + } + Frame { + msec: 3680 + hash: "2f253dcdbe2fabc768cdd5bfa8004a36" + } + Frame { + msec: 3696 + hash: "614ad3481a993b5ff5ec008aa3d4751f" + } + Frame { + msec: 3712 + hash: "01eebde46aff9d7484cffb0b0d27c415" + } + Frame { + msec: 3728 + hash: "c3cf3b3968441b735684fc6e55ebb1ce" + } + Frame { + msec: 3744 + hash: "827e5e274fb331c6f9997172894b1f4d" + } + Frame { + msec: 3760 + hash: "dc6677725f6bf0bdcab25287a096a0e6" + } + Frame { + msec: 3776 + hash: "4d75ac3064288c3a56e9fd6ed6022fc6" + } + Frame { + msec: 3792 + hash: "b03f1bfe2bdbf52aae0dff6ae4821914" + } + Frame { + msec: 3808 + hash: "67e700035648fd5354ec0806a412be89" + } + Frame { + msec: 3824 + hash: "ce6a7491571ce3d5799791579428b615" + } + Frame { + msec: 3840 + image: "test-flipable.3.png" + } + Frame { + msec: 3856 + hash: "a78a6a9f014b8c2e7a202b80e6c2e09f" + } + Frame { + msec: 3872 + hash: "dd548f565a0787789ec13e141f808b11" + } + Frame { + msec: 3888 + hash: "3eb8e765ff9f38fd56a69a8bc2d534c3" + } + Frame { + msec: 3904 + hash: "9729b36fe9dbabf0c46e78b723885530" + } + Frame { + msec: 3920 + hash: "5a0699f422475f0d3f17cddb606b4715" + } + Frame { + msec: 3936 + hash: "318bd97d726826398887ff218e61df32" + } + Frame { + msec: 3952 + hash: "42f602bcd7b517cf16554a88998d16a8" + } + Frame { + msec: 3968 + hash: "fd238f83a26ed8c2cee3e3d042af903b" + } + Frame { + msec: 3984 + hash: "84051de621753e12e3e11316d14dfe73" + } + Frame { + msec: 4000 + hash: "0c6d27488abbfd4f1ee4570a33a2c89e" + } + Frame { + msec: 4016 + hash: "c80d37b370a4ada6217c81f5e82ecd6f" + } + Frame { + msec: 4032 + hash: "fe7de3d2083208993e527b13ae7edadd" + } + Frame { + msec: 4048 + hash: "e5b616cefec125e8ad714d0c739ff902" + } + Frame { + msec: 4064 + hash: "3f3d5f3ca770b84e86fea3188e082493" + } + Frame { + msec: 4080 + hash: "20fd373c13d4d06b9105c80ed6f4edb7" + } + Frame { + msec: 4096 + hash: "2d6f6cf66bbd50a6546bc54e5aa91fb8" + } + Frame { + msec: 4112 + hash: "d4a21104b4f8044486fbe6516e4ae7b5" + } + Frame { + msec: 4128 + hash: "fd66704ce98410a7b1dd69f7cd6ddd26" + } + Frame { + msec: 4144 + hash: "33dcba73c46fa6513d4241e9cc75c417" + } + Frame { + msec: 4160 + hash: "c9062e6405b3b7fd0b2a794119220b1d" + } + Frame { + msec: 4176 + hash: "c1663c9ad895d67981a170f6b67a5331" + } + Frame { + msec: 4192 + hash: "dd058795bd3957d02dc296419c17819c" + } + Frame { + msec: 4208 + hash: "7cf357d1eb96e65f30a0cb4b7315b2f7" + } + Frame { + msec: 4224 + hash: "9afbd09687efa09eb3b03570bf8be531" + } + Frame { + msec: 4240 + hash: "321d29c57276959e095c5cb9366daf03" + } + Frame { + msec: 4256 + hash: "238c029a6be60ca4e1909d4f1de5633b" + } + Frame { + msec: 4272 + hash: "667b9286f32fe43a0cb5d65cdfa965cd" + } + Frame { + msec: 4288 + hash: "51bcca29caecbd92264f271818c400b8" + } + Frame { + msec: 4304 + hash: "4487366ee7ec1e0fdafc88cfa82e7977" + } + Frame { + msec: 4320 + hash: "f3cafcdab8b47c44dcc2222b9021f253" + } + Frame { + msec: 4336 + hash: "e8d25d1b5ea3f580cb46be911ea73556" + } + Frame { + msec: 4352 + hash: "f6926e493dfd7deee613cf9bb7529f5e" + } + Frame { + msec: 4368 + hash: "44e2f675f37feb23b53e58fc356a17aa" + } + Frame { + msec: 4384 + hash: "384478653302b604590c137d1e7289fe" + } + Frame { + msec: 4400 + hash: "fccc582ba920db36e797bdd7c4c329e5" + } + Frame { + msec: 4416 + hash: "92855bf2208369f361b677bc66e9c79d" + } + Frame { + msec: 4432 + hash: "9fc85a4e179b73bb5e92ed982ee13ee7" + } + Frame { + msec: 4448 + hash: "46e199e3311bf5643e4da28c1f1c687a" + } + Frame { + msec: 4464 + hash: "9d8a56893bf62535654fadd8b8a04977" + } + Frame { + msec: 4480 + hash: "b97e5629f4e9e2617e69361a0ca7f84a" + } + Frame { + msec: 4496 + hash: "eea82c42aa4eb22b2a3c5f1eb5a78d53" + } + Frame { + msec: 4512 + hash: "49d9c74894e3f1a5b03c126963296ecb" + } + Frame { + msec: 4528 + hash: "e78af45d2042130a9d34b654157a9ada" + } + Frame { + msec: 4544 + hash: "831fbf842a9107100ed7c91d664edaff" + } + Frame { + msec: 4560 + hash: "d1af7a53eef0b7dcb3da095bba7cdc12" + } + Frame { + msec: 4576 + hash: "8a02f7d3d53e98384d1f05dc7fc5fd37" + } + Frame { + msec: 4592 + hash: "6af3a8305b25a9a769b8cf00479c6ab3" + } + Frame { + msec: 4608 + hash: "f91c42910b17cb19be33a277b03e1cd2" + } + Frame { + msec: 4624 + hash: "67ff11e6143718c95418f4851265081e" + } + Frame { + msec: 4640 + hash: "e8dc4593c974902337ea7d58f26bae4c" + } + Frame { + msec: 4656 + hash: "9176a3f857d73d626bfba01878c5f213" + } + Frame { + msec: 4672 + hash: "08c7f417093c9e9da70c027ee12b0840" + } + Frame { + msec: 4688 + hash: "48fb5685e63e81f1790f5481bc06dac4" + } + Frame { + msec: 4704 + hash: "71e51c2b97140eb7810e489e6d809437" + } + Frame { + msec: 4720 + hash: "e8de71d4a2a253e366b2edf5d475824d" + } + Frame { + msec: 4736 + hash: "636335822b15f32861696439773e1794" + } + Frame { + msec: 4752 + hash: "ebd6d5f535f5356201aae297839777a6" + } + Frame { + msec: 4768 + hash: "ebc8a639c3ef849d47d79b6a91d940fd" + } + Frame { + msec: 4784 + hash: "2988cc8030891abd7493294fc2c6964c" + } + Frame { + msec: 4800 + image: "test-flipable.4.png" + } + Frame { + msec: 4816 + hash: "816d9d278fecde0867efadae2c4b5839" + } + Frame { + msec: 4832 + hash: "b40795c967d37d8cb6b73049a30f40cc" + } + Frame { + msec: 4848 + hash: "ec9892a5602892ba5a2075b61672d91b" + } + Frame { + msec: 4864 + hash: "38bd188beb6633cfe979f6881820c15d" + } + Frame { + msec: 4880 + hash: "8ee67f06977858444a775ca8c5109411" + } + Frame { + msec: 4896 + hash: "d3603c86488b02dc0136cc2588d00d7b" + } + Frame { + msec: 4912 + hash: "539ccebf96da504f0c5dfe5496ed95ce" + } + Frame { + msec: 4928 + hash: "b60450e46a2566d1feaf9749e897fa8b" + } + Frame { + msec: 4944 + hash: "daf19227a7e51e437d0a13fdf8b1a26f" + } + Frame { + msec: 4960 + hash: "09371a634d7801742075aadc131b5fb6" + } + Frame { + msec: 4976 + hash: "40b2a59c83f1223025eca6e2e19a87d8" + } + Frame { + msec: 4992 + hash: "4818f99e2f71c0ec7636aa777f4df875" + } + Frame { + msec: 5008 + hash: "7c9895dae776c2a4a6d5e1dd50d86336" + } + Frame { + msec: 5024 + hash: "b69f034a71b53c885cd177da422d5fc7" + } + Frame { + msec: 5040 + hash: "b12cbf8e97bc48e12d9543ffc1c578a2" + } + Frame { + msec: 5056 + hash: "9fd5a0f023f89511bdd4b7e429f940ab" + } + Frame { + msec: 5072 + hash: "39ed52571b12a9cea5409d5efc80c283" + } + Frame { + msec: 5088 + hash: "2dc05cabc6eb3e73e9946ebafed99fd4" + } + Frame { + msec: 5104 + hash: "599b244ff9b4ddceb682a059338f6f97" + } + Frame { + msec: 5120 + hash: "d54b5b295a9ca2bc65131a0775d8d009" + } + Frame { + msec: 5136 + hash: "b075ae21dbd3acef5c4d0f11cadce3c9" + } + Frame { + msec: 5152 + hash: "57d989f52d8bee06694166bf8bdffef0" + } + Frame { + msec: 5168 + hash: "9f87d4d33942d32a4048ca2b785a1fed" + } + Frame { + msec: 5184 + hash: "dc02f4f6b0ff1572a64fd133819fd794" + } + Frame { + msec: 5200 + hash: "c1b1056ef06a0454680f2146bb87a56b" + } + Frame { + msec: 5216 + hash: "e92daff761c739f231ba2c05785c44fb" + } + Frame { + msec: 5232 + hash: "96773abcace99ba692a5be096df85a54" + } + Frame { + msec: 5248 + hash: "31ca6f5b62fd8c08fa17b1008c4e6a22" + } + Frame { + msec: 5264 + hash: "8e44d6cf4c29313352ad0118db003958" + } + Frame { + msec: 5280 + hash: "cf8ffc1132935b5df49da90953009fa0" + } + Frame { + msec: 5296 + hash: "f9c919f45316d93d2c8693b62930850f" + } + Frame { + msec: 5312 + hash: "395863cffd5440b0a4805975b766a3cf" + } + Frame { + msec: 5328 + hash: "967f7e4f58a8e29b5d76eac011af643d" + } + Frame { + msec: 5344 + hash: "80529f6b8d12838b58c4af73c1985792" + } + Frame { + msec: 5360 + hash: "80529f6b8d12838b58c4af73c1985792" + } + Frame { + msec: 5376 + hash: "8beee45f26f9f7b94b84a807a0c42217" + } + Frame { + msec: 5392 + hash: "b6936d72cbaff0c6bb64fc08152e8680" + } + Frame { + msec: 5408 + hash: "3aace4dc5bc503ed0df1b00b444780f0" + } + Frame { + msec: 5424 + hash: "30692e6658ac730670a489c880fd4485" + } + Frame { + msec: 5440 + hash: "30692e6658ac730670a489c880fd4485" + } + Frame { + msec: 5456 + hash: "d36e1a56078d7cfa246b57f886c230b4" + } + Frame { + msec: 5472 + hash: "0374aae76f8cfd75f119ff4b86dba817" + } + Frame { + msec: 5488 + hash: "d75e53f2cea8e9b61a5e50f95060552e" + } + Frame { + msec: 5504 + hash: "d75e53f2cea8e9b61a5e50f95060552e" + } + Frame { + msec: 5520 + hash: "af5f794f73e16a5c3b9e437418c873ee" + } + Frame { + msec: 5536 + hash: "af5f794f73e16a5c3b9e437418c873ee" + } + Frame { + msec: 5552 + hash: "8532ee7ce3488f9e038643e4fa48751d" + } + Frame { + msec: 5568 + hash: "136fb272f4d806927b46a1269b18f63d" + } + Frame { + msec: 5584 + hash: "136fb272f4d806927b46a1269b18f63d" + } + Frame { + msec: 5600 + hash: "845581f8d03f4fe9323fc282e84f919b" + } + Frame { + msec: 5616 + hash: "845581f8d03f4fe9323fc282e84f919b" + } + Frame { + msec: 5632 + hash: "e64fa5eba05f81e6f263dc8543f21b1a" + } + Frame { + msec: 5648 + hash: "e64fa5eba05f81e6f263dc8543f21b1a" + } + Frame { + msec: 5664 + hash: "1c25b3d65e8590f8c213afa76b722e97" + } + Frame { + msec: 5680 + hash: "1c25b3d65e8590f8c213afa76b722e97" + } + Frame { + msec: 5696 + hash: "451a9408b04826ab35749d9120efd6bb" + } + Frame { + msec: 5712 + hash: "451a9408b04826ab35749d9120efd6bb" + } + Frame { + msec: 5728 + hash: "451a9408b04826ab35749d9120efd6bb" + } + Frame { + msec: 5744 + hash: "73c06997014af4e008b546b53fe349fb" + } + Frame { + msec: 5760 + image: "test-flipable.5.png" + } + Frame { + msec: 5776 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 5792 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 5808 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 5824 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 5840 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 5856 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 5872 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 5888 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 5904 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 5920 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 5936 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 5952 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 5968 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 5984 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 6000 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 6016 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 6032 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 6048 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 6064 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 6080 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 6096 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 6112 + hash: "7e16e6360fc2e9db67dbf11d58042745" + } + Frame { + msec: 6128 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 6144 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 6160 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 6176 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 6192 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Frame { + msec: 6208 + hash: "9becb90d9f8a61f5afacdc53d137ebcb" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 6224 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 6240 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 6256 + hash: "90fb4e4ba04ac32b52c10b3258431c04" + } + Frame { + msec: 6272 + hash: "73c06997014af4e008b546b53fe349fb" + } + Frame { + msec: 6288 + hash: "73c06997014af4e008b546b53fe349fb" + } + Frame { + msec: 6304 + hash: "73c06997014af4e008b546b53fe349fb" + } + Frame { + msec: 6320 + hash: "451a9408b04826ab35749d9120efd6bb" + } + Frame { + msec: 6336 + hash: "451a9408b04826ab35749d9120efd6bb" + } + Frame { + msec: 6352 + hash: "1c25b3d65e8590f8c213afa76b722e97" + } + Frame { + msec: 6368 + hash: "1c25b3d65e8590f8c213afa76b722e97" + } + Frame { + msec: 6384 + hash: "1c25b3d65e8590f8c213afa76b722e97" + } + Frame { + msec: 6400 + hash: "e64fa5eba05f81e6f263dc8543f21b1a" + } + Frame { + msec: 6416 + hash: "e64fa5eba05f81e6f263dc8543f21b1a" + } + Frame { + msec: 6432 + hash: "845581f8d03f4fe9323fc282e84f919b" + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicsflipable/test-flipable.qml b/tests/auto/declarative/visual/qmlgraphicsflipable/test-flipable.qml new file mode 100644 index 0000000..ba2e93f --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicsflipable/test-flipable.qml @@ -0,0 +1,83 @@ +import Qt 4.6 + +Rectangle { + width: 400; height: 240 + color: "white" + + Timer { + interval: 3000; running: true; repeat: true; triggeredOnStart: true + onTriggered: { + if (flipable.state == '') flipable.state = 'back'; else flipable.state = '' + if (flipable2.state == '') flipable2.state = 'back'; else flipable2.state = '' + } + } + + Flipable { + id: flipable + width: 200; height: 200 + + property int angle: 0 + + transform: Rotation { + origin.x: 100; origin.y: 100 + axis.x: 0; axis.y: 1; axis.z: 0 + angle: flipable.angle + } + + front: Rectangle { + color: "steelblue"; width: 200; height: 200 + } + + back: Rectangle { + color: "deeppink"; width: 200; height: 200 + } + + states: State { + name: "back" + PropertyChanges { target: flipable; angle: 180 } + } + + transitions: Transition { + NumberAnimation { easing: "easeInOutQuad"; matchProperties: "angle"; duration: 3000 } + } + } + + Flipable { + id: flipable2 + x: 200; width: 200; height: 200 + + property int angle: 0 + + transform: Rotation { + origin.x: 100; origin.y: 100 + axis.x: 1; axis.z: 0 + angle: flipable2.angle + } + + front: Rectangle { + color: "deeppink"; width: 200; height: 200 + } + + back: Rectangle { + color: "steelblue"; width: 200; height: 200 + } + + states: State { + name: "back" + PropertyChanges { target: flipable2; angle: 180 } + } + + transitions: Transition { + NumberAnimation { easing: "easeInOutQuad"; matchProperties: "angle"; duration: 3000 } + } + } + + Rectangle { + x: 25; width: 150; y: 210; height: 20; color: "black" + visible: flipable.side == Flipable.Front + } + Rectangle { + x: 225; width: 150; y: 210; height: 20; color: "black" + visible: flipable2.side == Flipable.Back + } +} -- cgit v0.12