diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-11-18 03:04:13 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-11-18 03:04:13 (GMT) |
commit | 9614a2775df27602b1d1bb0946feb4bb593cbf39 (patch) | |
tree | a917125de320ed2ea6a0b52bd0041edc256ee2ba /tests | |
parent | 178d8c9cb87c5578e5175b5a405d470919644c4d (diff) | |
parent | 26bbfd3c1afd34cd10f4d111b05b13e2f052cd6a (diff) | |
download | Qt-9614a2775df27602b1d1bb0946feb4bb593cbf39.zip Qt-9614a2775df27602b1d1bb0946feb4bb593cbf39.tar.gz Qt-9614a2775df27602b1d1bb0946feb4bb593cbf39.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'tests')
51 files changed, 4235 insertions, 179 deletions
diff --git a/tests/auto/declarative/anchors/data/anchors.qml b/tests/auto/declarative/anchors/data/anchors.qml index b880762..b64d0b0 100644 --- a/tests/auto/declarative/anchors/data/anchors.qml +++ b/tests/auto/declarative/anchors/data/anchors.qml @@ -130,6 +130,24 @@ Rectangle { anchors.bottom: masterRect.bottom anchors.bottomMargin: 5 } + Rectangle { + id: rect24; objectName: "rect24" + width: 10; height: 10 + anchors.horizontalCenter: masterRect.left + anchors.horizontalCenterOffset: width/2 + } + Rectangle { + id: rect25; objectName: "rect25" + width: 10; height: 10 + anchors.verticalCenter: rect12.top + anchors.verticalCenterOffset: height/2 + } + Rectangle { + id: rect26; objectName: "rect26" + width: 10; height: 10 + anchors.baseline: masterRect.top + anchors.baselineOffset: height/2 + } Text { id: text1; objectName: "text1" y: 200; diff --git a/tests/auto/declarative/anchors/data/illegal1.qml b/tests/auto/declarative/anchors/data/illegal1.qml deleted file mode 100644 index 53af443..0000000 --- a/tests/auto/declarative/anchors/data/illegal1.qml +++ /dev/null @@ -1,12 +0,0 @@ -import Qt 4.6 - -Rectangle { - id: rect - width: 120; height: 200; color: "white" - Rectangle { id: theRect; width: 100; height: 100 } - Rectangle { - anchors.left: theRect.left - anchors.right: theRect.right - anchors.horizontalCenter: theRect.horizontalCenter - } -} diff --git a/tests/auto/declarative/anchors/data/illegal2.qml b/tests/auto/declarative/anchors/data/illegal2.qml deleted file mode 100644 index 978be52..0000000 --- a/tests/auto/declarative/anchors/data/illegal2.qml +++ /dev/null @@ -1,13 +0,0 @@ -import Qt 4.6 - -Rectangle { - id: rect - width: 120; height: 200; color: "white" - Text { id: text1; text: "Hello" } - Text { - id: text2; - anchors.baseline: text1.baseline; - anchors.top: text1.top; - text: "World" - } -} diff --git a/tests/auto/declarative/anchors/data/illegal3.qml b/tests/auto/declarative/anchors/data/illegal3.qml deleted file mode 100644 index 065ceb5..0000000 --- a/tests/auto/declarative/anchors/data/illegal3.qml +++ /dev/null @@ -1,12 +0,0 @@ -import Qt 4.6 - -Rectangle { - id: rect - width: 120; height: 200; color: "white" - Item { - Rectangle { id: theRect; width: 100; height: 100 } - } - Rectangle { - anchors.left: theRect.left - } -} diff --git a/tests/auto/declarative/anchors/tst_anchors.cpp b/tests/auto/declarative/anchors/tst_anchors.cpp index 34c1e01..d340a7d 100644 --- a/tests/auto/declarative/anchors/tst_anchors.cpp +++ b/tests/auto/declarative/anchors/tst_anchors.cpp @@ -46,6 +46,9 @@ #include <private/qmlgraphicstext_p.h> #include <QtDeclarative/private/qmlgraphicsanchors_p_p.h> +Q_DECLARE_METATYPE(QmlGraphicsAnchors::UsedAnchor) +Q_DECLARE_METATYPE(QmlGraphicsAnchorLine::AnchorLine) + class tst_anchors : public QObject { @@ -60,8 +63,11 @@ private slots: void basicAnchors(); void loops(); void illegalSets(); + void illegalSets_data(); void reset(); + void reset_data(); void nullItem(); + void nullItem_data(); void crash1(); }; @@ -143,6 +149,11 @@ void tst_anchors::basicAnchors() QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("rect23"))->width(), 86.0); QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("rect23"))->height(), 10.0); + // offsets + QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("rect24"))->x(), 26.0); + QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("rect25"))->y(), 60.0); + QCOMPARE(findItem<QmlGraphicsRectangle>(view->root(), QLatin1String("rect26"))->y(), 5.0); + //baseline QmlGraphicsText *text1 = findItem<QmlGraphicsText>(view->root(), QLatin1String("text1")); QmlGraphicsText *text2 = findItem<QmlGraphicsText>(view->root(), QLatin1String("text2")); @@ -185,68 +196,149 @@ void tst_anchors::loops() void tst_anchors::illegalSets() { - { - QmlView *view = new QmlView; + QFETCH(QString, qml); + QFETCH(QString, warning); + + QTest::ignoreMessage(QtWarningMsg, warning.toLatin1()); + + QmlEngine engine; + QmlComponent component(&engine, QByteArray("import Qt 4.6\n" + qml.toUtf8()), QUrl("file://")); + if (!component.isReady()) + qWarning() << "Test errors:" << component.errors(); + QVERIFY(component.isReady()); + QObject *o = component.create(); + delete o; +} - view->setUrl(QUrl("file://" SRCDIR "/data/illegal1.qml")); +void tst_anchors::illegalSets_data() +{ + QTest::addColumn<QString>("qml"); + QTest::addColumn<QString>("warning"); - QString expect = "QML QmlGraphicsRectangle (" + view->url().toString() + ":7:5" + ") Can't specify left, right, and hcenter anchors."; - QTest::ignoreMessage(QtWarningMsg, expect.toLatin1()); - view->execute(); - qApp->processEvents(); + QTest::newRow("H - too many anchors") + << "Rectangle { id: rect; Rectangle { anchors.left: rect.left; anchors.right: rect.right; anchors.horizontalCenter: rect.horizontalCenter } }" + << "QML QmlGraphicsRectangle (file::2:23) Can't specify left, right, and hcenter anchors."; - delete view; + foreach (const QString &side, QStringList() << "left" << "right") { + QTest::newRow("H - anchor to V") + << QString("Rectangle { Rectangle { anchors.%1: parent.top } }").arg(side) + << "QML QmlGraphicsRectangle (file::2:13) Can't anchor a horizontal edge to a vertical edge."; + + QTest::newRow("H - anchor to non parent/sibling") + << QString("Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.%1: rect.%1 } }").arg(side) + << "QML QmlGraphicsRectangle (file::2:45) Can't anchor to an item that isn't a parent or sibling."; + + QTest::newRow("H - anchor to self") + << QString("Rectangle { id: rect; anchors.%1: rect.%1 }").arg(side) + << "QML QmlGraphicsRectangle (file::2:1) Can't anchor item to self."; } - { - QmlView *view = new QmlView; - view->setUrl(QUrl("file://" SRCDIR "/data/illegal2.qml")); + QTest::newRow("V - too many anchors") + << "Rectangle { id: rect; Rectangle { anchors.top: rect.top; anchors.bottom: rect.bottom; anchors.verticalCenter: rect.verticalCenter } }" + << "QML QmlGraphicsRectangle (file::2:23) Can't specify top, bottom, and vcenter anchors."; - QString expect = "QML QmlGraphicsText (" + view->url().toString() + ":7:5" + ") Baseline anchor can't be used in conjunction with top, bottom, or vcenter anchors."; - QTest::ignoreMessage(QtWarningMsg, expect.toLatin1()); - view->execute(); - //qApp->processEvents(); + QTest::newRow("V - too many anchors with baseline") + << "Rectangle { Text { id: text1; text: \"Hello\" } Text { anchors.baseline: text1.baseline; anchors.top: text1.top; } }" + << "QML QmlGraphicsText (file::2:47) Baseline anchor can't be used in conjunction with top, bottom, or vcenter anchors."; - delete view; + foreach (const QString &side, QStringList() << "top" << "bottom" << "baseline") { + + QTest::newRow("V - anchor to H") + << QString("Rectangle { Rectangle { anchors.%1: parent.left } }").arg(side) + << "QML QmlGraphicsRectangle (file::2:13) Can't anchor a vertical edge to a horizontal edge."; + + QTest::newRow("V - anchor to non parent/sibling") + << QString("Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.%1: rect.%1 } }").arg(side) + << "QML QmlGraphicsRectangle (file::2:45) Can't anchor to an item that isn't a parent or sibling."; + + QTest::newRow("V - anchor to self") + << QString("Rectangle { id: rect; anchors.%1: rect.%1 }").arg(side) + << "QML QmlGraphicsRectangle (file::2:1) Can't anchor item to self."; } - { - QmlView *view = new QmlView; - view->setUrl(QUrl("file://" SRCDIR "/data/illegal3.qml")); + QTest::newRow("centerIn - anchor to non parent/sibling") + << "Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.centerIn: rect} }" + << "QML QmlGraphicsRectangle (file::2:45) Can't anchor to an item that isn't a parent or sibling."; - QString expect = "QML QmlGraphicsRectangle (" + view->url().toString() + ":9:5" + ") Can't anchor to an item that isn't a parent or sibling."; - QTest::ignoreMessage(QtWarningMsg, expect.toLatin1()); - view->execute(); - //qApp->processEvents(); - delete view; - } + QTest::newRow("fill - anchor to non parent/sibling") + << "Rectangle { Item { Rectangle { id: rect } } Rectangle { anchors.fill: rect} }" + << "QML QmlGraphicsRectangle (file::2:45) Can't anchor to an item that isn't a parent or sibling."; } void tst_anchors::reset() { - QmlGraphicsItem *aItem = new QmlGraphicsItem; + QFETCH(QString, side); + QFETCH(QmlGraphicsAnchorLine::AnchorLine, anchorLine); + QFETCH(QmlGraphicsAnchors::UsedAnchor, usedAnchor); + + QmlGraphicsItem *baseItem = new QmlGraphicsItem; + QmlGraphicsAnchorLine anchor; - anchor.item = aItem; - anchor.anchorLine = QmlGraphicsAnchorLine::Top; + anchor.item = baseItem; + anchor.anchorLine = anchorLine; QmlGraphicsItem *item = new QmlGraphicsItem; - item->anchors()->setBottom(anchor); - QCOMPARE(item->anchors()->usedAnchors().testFlag(QmlGraphicsAnchors::HasBottomAnchor), true); - item->anchors()->resetBottom(); - QCOMPARE(item->anchors()->usedAnchors().testFlag(QmlGraphicsAnchors::HasBottomAnchor), false); + const QMetaObject *meta = item->anchors()->metaObject(); + QMetaProperty p = meta->property(meta->indexOfProperty(side.toUtf8().constData())); + + QVERIFY(p.write(item->anchors(), qVariantFromValue(anchor))); + QCOMPARE(item->anchors()->usedAnchors().testFlag(usedAnchor), true); + + QVERIFY(p.reset(item->anchors())); + QCOMPARE(item->anchors()->usedAnchors().testFlag(usedAnchor), false); + + delete item; + delete baseItem; +} + +void tst_anchors::reset_data() +{ + QTest::addColumn<QString>("side"); + QTest::addColumn<QmlGraphicsAnchorLine::AnchorLine>("anchorLine"); + QTest::addColumn<QmlGraphicsAnchors::UsedAnchor>("usedAnchor"); + + QTest::newRow("left") << "left" << QmlGraphicsAnchorLine::Left << QmlGraphicsAnchors::HasLeftAnchor; + QTest::newRow("top") << "top" << QmlGraphicsAnchorLine::Top << QmlGraphicsAnchors::HasTopAnchor; + QTest::newRow("right") << "right" << QmlGraphicsAnchorLine::Right << QmlGraphicsAnchors::HasRightAnchor; + QTest::newRow("bottom") << "bottom" << QmlGraphicsAnchorLine::Bottom << QmlGraphicsAnchors::HasBottomAnchor; + + QTest::newRow("hcenter") << "horizontalCenter" << QmlGraphicsAnchorLine::HCenter << QmlGraphicsAnchors::HasHCenterAnchor; + QTest::newRow("vcenter") << "verticalCenter" << QmlGraphicsAnchorLine::VCenter << QmlGraphicsAnchors::HasVCenterAnchor; + QTest::newRow("baseline") << "baseline" << QmlGraphicsAnchorLine::Baseline << QmlGraphicsAnchors::HasBaselineAnchor; } void tst_anchors::nullItem() { + QFETCH(QString, side); + QmlGraphicsAnchorLine anchor; + QmlGraphicsItem *item = new QmlGraphicsItem; + + const QMetaObject *meta = item->anchors()->metaObject(); + QMetaProperty p = meta->property(meta->indexOfProperty(side.toUtf8().constData())); QTest::ignoreMessage(QtWarningMsg, "QML QmlGraphicsItem (unknown location) Can't anchor to a null item."); - QmlGraphicsItem *item = new QmlGraphicsItem; - item->anchors()->setBottom(anchor); + QVERIFY(p.write(item->anchors(), qVariantFromValue(anchor))); + + delete item; +} + +void tst_anchors::nullItem_data() +{ + QTest::addColumn<QString>("side"); + + QTest::newRow("left") << "left"; + QTest::newRow("top") << "top"; + QTest::newRow("right") << "right"; + QTest::newRow("bottom") << "bottom"; + + QTest::newRow("hcenter") << "horizontalCenter"; + QTest::newRow("vcenter") << "verticalCenter"; + QTest::newRow("baseline") << "baseline"; } void tst_anchors::crash1() diff --git a/tests/auto/declarative/debugger/debugger.pro b/tests/auto/declarative/debugger/debugger.pro deleted file mode 100644 index a341ca9..0000000 --- a/tests/auto/declarative/debugger/debugger.pro +++ /dev/null @@ -1,5 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS += qmldebug \ - qmldebugclient \ - qmldebugservice \ - qpacketprotocol diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index ec2c7d0..e1817d6 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -5,8 +5,8 @@ SUBDIRS += \ animations \ # Cover behaviors \ # Cover datetimeformatter \ # Cover - debugger \ # Cover examples \ + graphicswidgets \ # Cover layouts \ # Cover numberformatter \ # Cover parserstress \ # Cover @@ -15,6 +15,9 @@ SUBDIRS += \ qmlbinding \ # Cover qmlconnection \ # Cover qmlcontext \ # Cover + qmldebug \ # Cover + qmldebugclient \ # Cover + qmldebugservice \ # Cover qmldom \ # Cover qmleasefollow \ # Cover qmlecmascript \ # Cover @@ -36,6 +39,7 @@ SUBDIRS += \ qmlgraphicstextinput \ # Cover qmlgraphicswebview \ # Cover qmlinfo \ # Cover + qmlinstruction \ # Cover qmllanguage \ # Cover qmllist \ # Cover qmllistaccessor \ # Cover @@ -49,6 +53,7 @@ SUBDIRS += \ qmlsystempalette \ # Cover qmltimer \ # Cover qmlxmllistmodel \ # Cover + qpacketprotocol \ # Cover repeater \ # Cover sql \ # Cover states \ # Cover diff --git a/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml b/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml new file mode 100644 index 0000000..70fafd6 --- /dev/null +++ b/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml @@ -0,0 +1,57 @@ +import Qt 4.6 + +QGraphicsView { + objectName: "GView" + size: "800x600" + + QGraphicsScene { + objectName: "GScene" + sceneRect: "0,0,500x300" + + QGraphicsWidget { + layout: QGraphicsLinearLayout { + orientation: Qt.Horizontal + QGraphicsWidget { + layout: QGraphicsLinearLayout { + spacing: 10; orientation: Qt.Vertical + LayoutItem { + QGraphicsLinearLayout.stretchFactor: 1 + objectName: "left" + minimumSize: "100x100" + maximumSize: "300x300" + preferredSize: "100x100" + Rectangle { objectName: "yellowRect"; color: "yellow"; anchors.fill: parent } + } + LayoutItem { + QGraphicsLinearLayout.stretchFactor: 10 + objectName: "left" + minimumSize: "100x100" + maximumSize: "300x300" + preferredSize: "100x100" + Rectangle { objectName: "yellowRect"; color: "blue"; anchors.fill: parent } + } + } + } + QGraphicsWidget { + layout: QGraphicsLinearLayout { + spacing: 10; orientation: Qt.Vertical + LayoutItem { + objectName: "left" + minimumSize: "100x100" + maximumSize: "300x300" + preferredSize: "100x100" + Rectangle { objectName: "yellowRect"; color: "red"; anchors.fill: parent } + } + LayoutItem { + objectName: "left" + minimumSize: "100x100" + maximumSize: "300x300" + preferredSize: "100x100" + Rectangle { objectName: "yellowRect"; color: "green"; anchors.fill: parent } + } + } + } + } + } + } +} diff --git a/tests/auto/declarative/graphicswidgets/graphicswidgets.pro b/tests/auto/declarative/graphicswidgets/graphicswidgets.pro new file mode 100644 index 0000000..712c34c --- /dev/null +++ b/tests/auto/declarative/graphicswidgets/graphicswidgets.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative gui +macx:CONFIG -= app_bundle + +SOURCES += tst_graphicswidgets.cpp + +# Define SRCDIR equal to test's source directory +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/graphicswidgets/tst_graphicswidgets.cpp b/tests/auto/declarative/graphicswidgets/tst_graphicswidgets.cpp new file mode 100644 index 0000000..783094b --- /dev/null +++ b/tests/auto/declarative/graphicswidgets/tst_graphicswidgets.cpp @@ -0,0 +1,77 @@ +/**************************************************************************** +** +** 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 <qtest.h> +#include <QFile> +#include <QtDeclarative/qmlengine.h> +#include <QtDeclarative/qmlcomponent.h> +#include <private/graphicswidgets_p.h> + +class tst_graphicswidgets : public QObject + +{ + Q_OBJECT +public: + tst_graphicswidgets(); + +private slots: + void widgets(); +}; + +tst_graphicswidgets::tst_graphicswidgets() +{ +} + +void tst_graphicswidgets::widgets() +{ + QmlEngine engine; + QmlComponent c(&engine, QUrl("file://" SRCDIR "/data/graphicswidgets.qml")); + QGraphicsView *obj = qobject_cast<QGraphicsView*>(c.create()); + + QVERIFY(obj != 0); + QVERIFY(obj->scene() != 0); + QList<QObject*> list; + QVERIFY(obj->scene()->children() != list); + delete obj; +} + +QTEST_MAIN(tst_graphicswidgets) + +#include "tst_graphicswidgets.moc" diff --git a/tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp b/tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp index 9beec17..71eefdd 100644 --- a/tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp +++ b/tests/auto/declarative/qmetaobjectbuilder/tst_qmetaobjectbuilder.cpp @@ -25,6 +25,7 @@ private slots: void create(); void className(); void superClass(); + void flags(); void method(); void slot(); void signal(); @@ -37,6 +38,7 @@ private slots: void staticMetacall(); void copyMetaObject(); void serialize(); + void removeNotifySignal(); private: static bool checkForSideEffects @@ -46,6 +48,61 @@ private: (const QMetaObject *meta1, const QMetaObject *meta2); }; +// Dummy class that has something of every type of thing moc can generate. +class SomethingOfEverything : public QObject +{ + Q_OBJECT + Q_CLASSINFO("ci_foo", "ABC") + Q_CLASSINFO("ci_bar", "DEF") + Q_PROPERTY(QString prop READ prop WRITE setProp NOTIFY propChanged) + Q_PROPERTY(QString prop2 READ prop WRITE setProp) + Q_PROPERTY(SomethingEnum eprop READ eprop) + Q_PROPERTY(SomethingFlagEnum fprop READ fprop) + Q_PROPERTY(QLocale::Language language READ language) + Q_ENUMS(SomethingEnum) + Q_FLAGS(SomethingFlagEnum) +public: + Q_INVOKABLE SomethingOfEverything() {} + ~SomethingOfEverything() {} + + enum SomethingEnum + { + GHI, + JKL = 10 + }; + + enum SomethingFlagEnum + { + XYZ = 1, + UVW = 8 + }; + + Q_INVOKABLE Q_SCRIPTABLE void method1() {} + + QString prop() const { return QString(); } + void setProp(const QString& v) { Q_UNUSED(v); } + + SomethingOfEverything::SomethingEnum eprop() const { return GHI; } + SomethingOfEverything::SomethingFlagEnum fprop() const { return XYZ; } + QLocale::Language language() const { return QLocale::English; } + +public slots: + void slot1(const QString&) {} + void slot2(int, const QString&) {} + +private slots: + void slot3() {} + +protected slots: + Q_SCRIPTABLE void slot4(int) {} + void slot5(int a, const QString& b) { Q_UNUSED(a); Q_UNUSED(b); } + +signals: + void sig1(); + void sig2(int x, const QString& y); + void propChanged(const QString&); +}; + void tst_QMetaObjectBuilder::mocVersionCheck() { // This test will fail when the moc version number is changed. @@ -112,10 +169,33 @@ void tst_QMetaObjectBuilder::superClass() QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::SuperClass)); } +void tst_QMetaObjectBuilder::flags() +{ + QMetaObjectBuilder builder; + + // Check default + QVERIFY(builder.flags() == 0); + + // Set flags + builder.setFlags(QMetaObjectBuilder::DynamicMetaObject); + QVERIFY(builder.flags() == QMetaObjectBuilder::DynamicMetaObject); +} + void tst_QMetaObjectBuilder::method() { QMetaObjectBuilder builder; + // Check null method + QMetaMethodBuilder nullMethod; + QCOMPARE(nullMethod.signature(), QByteArray()); + QVERIFY(nullMethod.methodType() == QMetaMethod::Method); + QVERIFY(nullMethod.returnType().isEmpty()); + QVERIFY(nullMethod.parameterNames().isEmpty()); + QVERIFY(nullMethod.tag().isEmpty()); + QVERIFY(nullMethod.access() == QMetaMethod::Public); + QCOMPARE(nullMethod.attributes(), 0); + QCOMPARE(nullMethod.index(), 0); + // Add a method and check its attributes. QMetaMethodBuilder method1 = builder.addMethod("foo(const QString&, int)"); QCOMPARE(method1.signature(), QByteArray("foo(QString,int)")); @@ -129,10 +209,10 @@ void tst_QMetaObjectBuilder::method() QCOMPARE(builder.methodCount(), 1); // Add another method and check again. - QMetaMethodBuilder method2 = builder.addMethod("bar(QString)"); + QMetaMethodBuilder method2 = builder.addMethod("bar(QString)", "int"); QCOMPARE(method2.signature(), QByteArray("bar(QString)")); QVERIFY(method2.methodType() == QMetaMethod::Method); - QVERIFY(method2.returnType().isEmpty()); + QCOMPARE(method2.returnType(), QByteArray("int")); QVERIFY(method2.parameterNames().isEmpty()); QVERIFY(method2.tag().isEmpty()); QVERIFY(method2.access() == QMetaMethod::Public); @@ -163,7 +243,7 @@ void tst_QMetaObjectBuilder::method() QCOMPARE(method1.index(), 0); QCOMPARE(method2.signature(), QByteArray("bar(QString)")); QVERIFY(method2.methodType() == QMetaMethod::Method); - QVERIFY(method2.returnType().isEmpty()); + QCOMPARE(method2.returnType(), QByteArray("int")); QVERIFY(method2.parameterNames().isEmpty()); QVERIFY(method2.tag().isEmpty()); QVERIFY(method2.access() == QMetaMethod::Public); @@ -214,6 +294,8 @@ void tst_QMetaObjectBuilder::method() QCOMPARE(builder.indexOfMethod("foo(const QString&, int)"), -1); QCOMPARE(builder.indexOfMethod("bar(QString)"), 0); QCOMPARE(builder.indexOfMethod("baz()"), -1); + QCOMPARE(builder.method(0).signature(), QByteArray("bar(QString)")); + QCOMPARE(builder.method(9).signature(), QByteArray()); // Check that nothing else changed. QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::Methods)); @@ -247,6 +329,11 @@ void tst_QMetaObjectBuilder::slot() QCOMPARE(method2.index(), 1); QCOMPARE(builder.methodCount(), 2); + // Perform index-based lookup + QCOMPARE(builder.indexOfSlot("foo(const QString &, int)"), 0); + QCOMPARE(builder.indexOfSlot("bar(QString)"), 1); + QCOMPARE(builder.indexOfSlot("baz()"), -1); + // Check that nothing else changed. QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::Methods)); } @@ -279,6 +366,11 @@ void tst_QMetaObjectBuilder::signal() QCOMPARE(method2.index(), 1); QCOMPARE(builder.methodCount(), 2); + // Perform index-based lookup + QCOMPARE(builder.indexOfSignal("foo(const QString &, int)"), 0); + QCOMPARE(builder.indexOfSignal("bar(QString)"), 1); + QCOMPARE(builder.indexOfSignal("baz()"), -1); + // Check that nothing else changed. QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::Methods)); } @@ -315,6 +407,8 @@ void tst_QMetaObjectBuilder::constructor() QCOMPARE(builder.indexOfConstructor("foo(const QString&, int)"), 0); QCOMPARE(builder.indexOfConstructor("bar(QString)"), 1); QCOMPARE(builder.indexOfConstructor("baz()"), -1); + QCOMPARE(builder.constructor(1).signature(), QByteArray("bar(QString)")); + QCOMPARE(builder.constructor(9).signature(), QByteArray()); // Modify the attributes on ctor1. ctor1.setReturnType("int"); @@ -386,6 +480,17 @@ void tst_QMetaObjectBuilder::constructor() QCOMPARE(builder.indexOfConstructor("bar(QString)"), 0); QCOMPARE(builder.indexOfConstructor("baz()"), -1); + // Add constructor from prototype + QMetaMethod prototype = SomethingOfEverything::staticMetaObject.constructor(0); + QMetaMethodBuilder prototypeConstructor = builder.addMethod(prototype); + QCOMPARE(builder.constructorCount(), 2); + + QCOMPARE(prototypeConstructor.signature(), QByteArray("SomethingOfEverything()")); + QVERIFY(prototypeConstructor.methodType() == QMetaMethod::Constructor); + QCOMPARE(prototypeConstructor.returnType(), QByteArray()); + QVERIFY(prototypeConstructor.access() == QMetaMethod::Public); + QCOMPARE(prototypeConstructor.index(), 1); + // Check that nothing else changed. QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::Constructors)); } @@ -394,6 +499,24 @@ void tst_QMetaObjectBuilder::property() { QMetaObjectBuilder builder; + // Null property builder + QMetaPropertyBuilder nullProp; + QCOMPARE(nullProp.name(), QByteArray()); + QCOMPARE(nullProp.type(), QByteArray()); + QVERIFY(!nullProp.hasNotifySignal()); + QVERIFY(!nullProp.isReadable()); + QVERIFY(!nullProp.isWritable()); + QVERIFY(!nullProp.isResettable()); + QVERIFY(!nullProp.isDesignable()); + QVERIFY(!nullProp.isScriptable()); + QVERIFY(!nullProp.isStored()); + QVERIFY(!nullProp.isEditable()); + QVERIFY(!nullProp.isUser()); + QVERIFY(!nullProp.hasStdCppSet()); + QVERIFY(!nullProp.isEnumOrFlag()); + QVERIFY(!nullProp.isDynamic()); + QCOMPARE(nullProp.index(), 0); + // Add a property and check its attributes. QMetaPropertyBuilder prop1 = builder.addProperty("foo", "const QString &"); QCOMPARE(prop1.name(), QByteArray("foo")); @@ -409,6 +532,7 @@ void tst_QMetaObjectBuilder::property() QVERIFY(!prop1.isUser()); QVERIFY(!prop1.hasStdCppSet()); QVERIFY(!prop1.isEnumOrFlag()); + QVERIFY(!prop1.isDynamic()); QCOMPARE(prop1.index(), 0); QCOMPARE(builder.propertyCount(), 1); @@ -427,6 +551,7 @@ void tst_QMetaObjectBuilder::property() QVERIFY(!prop2.isUser()); QVERIFY(!prop2.hasStdCppSet()); QVERIFY(!prop2.isEnumOrFlag()); + QVERIFY(!prop2.isDynamic()); QCOMPARE(prop2.index(), 1); QCOMPARE(builder.propertyCount(), 2); @@ -434,6 +559,8 @@ void tst_QMetaObjectBuilder::property() QCOMPARE(builder.indexOfProperty("foo"), 0); QCOMPARE(builder.indexOfProperty("bar"), 1); QCOMPARE(builder.indexOfProperty("baz"), -1); + QCOMPARE(builder.property(1).name(), QByteArray("bar")); + QCOMPARE(builder.property(9).name(), QByteArray()); // Modify the attributes on prop1. prop1.setReadable(false); @@ -446,6 +573,7 @@ void tst_QMetaObjectBuilder::property() prop1.setUser(true); prop1.setStdCppSet(true); prop1.setEnumOrFlag(true); + prop1.setDynamic(true); // Check that prop1 is changed, but prop2 is not. QCOMPARE(prop1.name(), QByteArray("foo")); @@ -460,6 +588,7 @@ void tst_QMetaObjectBuilder::property() QVERIFY(prop1.isUser()); QVERIFY(prop1.hasStdCppSet()); QVERIFY(prop1.isEnumOrFlag()); + QVERIFY(prop1.isDynamic()); QVERIFY(prop2.isReadable()); QVERIFY(prop2.isWritable()); QCOMPARE(prop2.name(), QByteArray("bar")); @@ -472,6 +601,7 @@ void tst_QMetaObjectBuilder::property() QVERIFY(!prop2.isUser()); QVERIFY(!prop2.hasStdCppSet()); QVERIFY(!prop2.isEnumOrFlag()); + QVERIFY(!prop2.isDynamic()); // Remove prop1 and check that prop2 becomes index 0. builder.removeProperty(0); @@ -487,6 +617,7 @@ void tst_QMetaObjectBuilder::property() QVERIFY(!prop2.isUser()); QVERIFY(!prop2.hasStdCppSet()); QVERIFY(!prop2.isEnumOrFlag()); + QVERIFY(!prop2.isDynamic()); QCOMPARE(prop2.index(), 0); // Perform index-based lookup again. @@ -510,6 +641,7 @@ void tst_QMetaObjectBuilder::property() prop2.setUser(false); \ prop2.setStdCppSet(false); \ prop2.setEnumOrFlag(false); \ + prop2.setDynamic(false); \ } while (0) #define COUNT_FLAGS() \ ((prop2.isReadable() ? 1 : 0) + \ @@ -521,7 +653,8 @@ void tst_QMetaObjectBuilder::property() (prop2.isEditable() ? 1 : 0) + \ (prop2.isUser() ? 1 : 0) + \ (prop2.hasStdCppSet() ? 1 : 0) + \ - (prop2.isEnumOrFlag() ? 1 : 0)) + (prop2.isEnumOrFlag() ? 1 : 0) + \ + (prop2.isDynamic() ? 1 : 0)) #define CHECK_FLAG(setFunc,isFunc) \ do { \ CLEAR_FLAGS(); \ @@ -540,9 +673,20 @@ void tst_QMetaObjectBuilder::property() CHECK_FLAG(setUser, isUser); CHECK_FLAG(setStdCppSet, hasStdCppSet); CHECK_FLAG(setEnumOrFlag, isEnumOrFlag); + CHECK_FLAG(setDynamic, isDynamic); // Check that nothing else changed. QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::Properties)); + + // Add property from prototype + QMetaProperty prototype = SomethingOfEverything::staticMetaObject.property(1); + QVERIFY(prototype.name() == QByteArray("prop")); + QMetaPropertyBuilder prototypeProp = builder.addProperty(prototype); + QCOMPARE(prototypeProp.name(), QByteArray("prop")); + QVERIFY(prototypeProp.hasNotifySignal()); + QCOMPARE(prototypeProp.notifySignal().signature(), QByteArray("propChanged(QString)")); + QCOMPARE(builder.methodCount(), 1); + QCOMPARE(builder.method(0).signature(), QByteArray("propChanged(QString)")); } void tst_QMetaObjectBuilder::notifySignal() @@ -601,6 +745,8 @@ void tst_QMetaObjectBuilder::enumerator() QCOMPARE(builder.indexOfEnumerator("foo"), 0); QCOMPARE(builder.indexOfEnumerator("bar"), 1); QCOMPARE(builder.indexOfEnumerator("baz"), -1); + QCOMPARE(builder.enumerator(1).name(), QByteArray("bar")); + QCOMPARE(builder.enumerator(9).name(), QByteArray()); // Modify the attributes on enum1. enum1.setIsFlag(true); @@ -616,6 +762,7 @@ void tst_QMetaObjectBuilder::enumerator() QCOMPARE(enum1.key(0), QByteArray("ABC")); QCOMPARE(enum1.key(1), QByteArray("DEF")); QCOMPARE(enum1.key(2), QByteArray("GHI")); + QCOMPARE(enum1.key(3), QByteArray()); QCOMPARE(enum1.value(0), 0); QCOMPARE(enum1.value(1), 1); QCOMPARE(enum1.value(2), -1); @@ -637,6 +784,7 @@ void tst_QMetaObjectBuilder::enumerator() QCOMPARE(enum1.key(0), QByteArray("ABC")); QCOMPARE(enum1.key(1), QByteArray("DEF")); QCOMPARE(enum1.key(2), QByteArray("GHI")); + QCOMPARE(enum1.key(3), QByteArray()); QCOMPARE(enum1.value(0), 0); QCOMPARE(enum1.value(1), 1); QCOMPARE(enum1.value(2), -1); @@ -646,6 +794,29 @@ void tst_QMetaObjectBuilder::enumerator() QCOMPARE(enum2.index(), 1); QCOMPARE(enum2.key(0), QByteArray("XYZ")); QCOMPARE(enum2.key(1), QByteArray("UVW")); + QCOMPARE(enum2.key(2), QByteArray()); + QCOMPARE(enum2.value(0), 10); + QCOMPARE(enum2.value(1), 19); + + // Remove enum1 key + enum1.removeKey(2); + QCOMPARE(enum1.name(), QByteArray("foo")); + QVERIFY(enum1.isFlag()); + QCOMPARE(enum1.keyCount(), 2); + QCOMPARE(enum1.index(), 0); + QCOMPARE(enum1.key(0), QByteArray("ABC")); + QCOMPARE(enum1.key(1), QByteArray("DEF")); + QCOMPARE(enum1.key(2), QByteArray()); + QCOMPARE(enum1.value(0), 0); + QCOMPARE(enum1.value(1), 1); + QCOMPARE(enum1.value(2), -1); + QCOMPARE(enum2.name(), QByteArray("bar")); + QVERIFY(enum2.isFlag()); + QCOMPARE(enum2.keyCount(), 2); + QCOMPARE(enum2.index(), 1); + QCOMPARE(enum2.key(0), QByteArray("XYZ")); + QCOMPARE(enum2.key(1), QByteArray("UVW")); + QCOMPARE(enum2.key(2), QByteArray()); QCOMPARE(enum2.value(0), 10); QCOMPARE(enum2.value(1), 19); @@ -659,6 +830,7 @@ void tst_QMetaObjectBuilder::enumerator() QCOMPARE(enum2.index(), 0); QCOMPARE(enum2.key(0), QByteArray("XYZ")); QCOMPARE(enum2.key(1), QByteArray("UVW")); + QCOMPARE(enum2.key(2), QByteArray()); QCOMPARE(enum2.value(0), 10); QCOMPARE(enum2.value(1), 19); @@ -682,6 +854,8 @@ void tst_QMetaObjectBuilder::classInfo() QCOMPARE(builder.classInfoValue(0), QByteArray("value1")); QCOMPARE(builder.classInfoName(1), QByteArray("bar")); QCOMPARE(builder.classInfoValue(1), QByteArray("value2")); + QCOMPARE(builder.classInfoName(9), QByteArray()); + QCOMPARE(builder.classInfoValue(9), QByteArray()); QCOMPARE(builder.classInfoCount(), 2); // Perform index-based lookup. @@ -738,61 +912,6 @@ void tst_QMetaObjectBuilder::staticMetacall() QVERIFY(checkForSideEffects(builder, QMetaObjectBuilder::StaticMetacall)); } -// Dummy class that has something of every type of thing moc can generate. -class SomethingOfEverything : public QObject -{ - Q_OBJECT - Q_CLASSINFO("ci_foo", "ABC") - Q_CLASSINFO("ci_bar", "DEF") - Q_PROPERTY(QString prop READ prop WRITE setProp NOTIFY propChanged) - Q_PROPERTY(QString prop2 READ prop WRITE setProp) - Q_PROPERTY(SomethingEnum eprop READ eprop) - Q_PROPERTY(SomethingFlagEnum fprop READ fprop) - Q_PROPERTY(QLocale::Language language READ language) - Q_ENUMS(SomethingEnum) - Q_FLAGS(SomethingFlagEnum) -public: - Q_INVOKABLE SomethingOfEverything() {} - ~SomethingOfEverything() {} - - enum SomethingEnum - { - GHI, - JKL = 10 - }; - - enum SomethingFlagEnum - { - XYZ = 1, - UVW = 8 - }; - - Q_INVOKABLE Q_SCRIPTABLE void method1() {} - - QString prop() const { return QString(); } - void setProp(const QString& v) { Q_UNUSED(v); } - - SomethingOfEverything::SomethingEnum eprop() const { return GHI; } - SomethingOfEverything::SomethingFlagEnum fprop() const { return XYZ; } - QLocale::Language language() const { return QLocale::English; } - -public slots: - void slot1(const QString&) {} - void slot2(int, const QString&) {} - -private slots: - void slot3() {} - -protected slots: - Q_SCRIPTABLE void slot4(int) {} - void slot5(int a, const QString& b) { Q_UNUSED(a); Q_UNUSED(b); } - -signals: - void sig1(); - void sig2(int x, const QString& y); - void propChanged(const QString&); -}; - // Copy the entire contents of a static QMetaObject and then check // that QMetaObjectBuilder will produce an exact copy as output. void tst_QMetaObjectBuilder::copyMetaObject() @@ -817,6 +936,8 @@ void tst_QMetaObjectBuilder::copyMetaObject() // it round-trips to the exact same value. void tst_QMetaObjectBuilder::serialize() { + // Full QMetaObjectBuilder + { QMetaObjectBuilder builder(&SomethingOfEverything::staticMetaObject); QMetaObject *meta = builder.toMetaObject(); @@ -835,6 +956,53 @@ void tst_QMetaObjectBuilder::serialize() QVERIFY(sameMetaObject(meta, meta2)); qFree(meta); qFree(meta2); + } + + // Partial QMetaObjectBuilder + { + QMetaObjectBuilder builder; + builder.setClassName("Test"); + builder.addProperty("foo", "int"); + builder.setSuperClass(0); + + QByteArray data; + QDataStream stream(&data, QIODevice::WriteOnly | QIODevice::Append); + builder.serialize(stream); + + QMetaObjectBuilder builder2; + QDataStream stream2(data); + builder2.deserialize(stream2, QMap<QByteArray, const QMetaObject *>()); + + QCOMPARE(builder.superClass(), builder2.superClass()); + QCOMPARE(builder.className(), builder2.className()); + QCOMPARE(builder.propertyCount(), builder2.propertyCount()); + QCOMPARE(builder.property(0).name(), builder2.property(0).name()); + QCOMPARE(builder.property(0).type(), builder2.property(0).type()); + } +} + +// Check that removing a method updates notify signals appropriately +void tst_QMetaObjectBuilder::removeNotifySignal() +{ + QMetaObjectBuilder builder; + + QMetaMethodBuilder method1 = builder.addSignal("foo(const QString&, int)"); + QMetaMethodBuilder method2 = builder.addSignal("bar(QString)"); + + // Setup property + QMetaPropertyBuilder prop = builder.addProperty("prop", "const QString &"); + prop.setNotifySignal(method2); + QVERIFY(prop.hasNotifySignal()); + QCOMPARE(prop.notifySignal().index(), 1); + + // Remove non-notify signal + builder.removeMethod(0); + QVERIFY(prop.hasNotifySignal()); + QCOMPARE(prop.notifySignal().index(), 0); + + // Remove notify signal + builder.removeMethod(0); + QVERIFY(!prop.hasNotifySignal()); } // Check that the only changes to a "builder" relative to the default diff --git a/tests/auto/declarative/debugger/qmldebug/qmldebug.pro b/tests/auto/declarative/qmldebug/qmldebug.pro index 0af30e1..f79829d 100644 --- a/tests/auto/declarative/debugger/qmldebug/qmldebug.pro +++ b/tests/auto/declarative/qmldebug/qmldebug.pro @@ -2,6 +2,6 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += network declarative macx:CONFIG -= app_bundle -HEADERS += ../debugutil_p.h +HEADERS += ../shared/debugutil_p.h SOURCES += tst_qmldebug.cpp \ - ../debugutil.cpp + ../shared/debugutil.cpp diff --git a/tests/auto/declarative/debugger/qmldebug/tst_qmldebug.cpp b/tests/auto/declarative/qmldebug/tst_qmldebug.cpp index 70404f6..6916cc9 100644 --- a/tests/auto/declarative/debugger/qmldebug/tst_qmldebug.cpp +++ b/tests/auto/declarative/qmldebug/tst_qmldebug.cpp @@ -59,7 +59,7 @@ #include <private/qmldebugservice_p.h> #include <private/qmlgraphicsrectangle_p.h> -#include "../debugutil_p.h" +#include "../shared/debugutil_p.h" Q_DECLARE_METATYPE(QmlDebugWatch::State) diff --git a/tests/auto/declarative/debugger/qmldebugclient/qmldebugclient.pro b/tests/auto/declarative/qmldebugclient/qmldebugclient.pro index c0aa7b2..36aa818 100644 --- a/tests/auto/declarative/debugger/qmldebugclient/qmldebugclient.pro +++ b/tests/auto/declarative/qmldebugclient/qmldebugclient.pro @@ -2,6 +2,6 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += network declarative macx:CONFIG -= app_bundle -HEADERS += ../debugutil_p.h +HEADERS += ../shared/debugutil_p.h SOURCES += tst_qmldebugclient.cpp \ - ../debugutil.cpp + ../shared/debugutil.cpp diff --git a/tests/auto/declarative/debugger/qmldebugclient/tst_qmldebugclient.cpp b/tests/auto/declarative/qmldebugclient/tst_qmldebugclient.cpp index 6c4a1a3..8325731 100644 --- a/tests/auto/declarative/debugger/qmldebugclient/tst_qmldebugclient.cpp +++ b/tests/auto/declarative/qmldebugclient/tst_qmldebugclient.cpp @@ -52,7 +52,7 @@ #include <private/qmldebugclient_p.h> #include <private/qmldebugservice_p.h> -#include "../debugutil_p.h" +#include "../shared/debugutil_p.h" class tst_QmlDebugClient : public QObject { diff --git a/tests/auto/declarative/debugger/qmldebugservice/qmldebugservice.pro b/tests/auto/declarative/qmldebugservice/qmldebugservice.pro index cce277a..9995f1f 100644 --- a/tests/auto/declarative/debugger/qmldebugservice/qmldebugservice.pro +++ b/tests/auto/declarative/qmldebugservice/qmldebugservice.pro @@ -2,6 +2,6 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += network declarative macx:CONFIG -= app_bundle -HEADERS += ../debugutil_p.h +HEADERS += ../shared/debugutil_p.h SOURCES += tst_qmldebugservice.cpp \ - ../debugutil.cpp + ../shared/debugutil.cpp diff --git a/tests/auto/declarative/debugger/qmldebugservice/tst_qmldebugservice.cpp b/tests/auto/declarative/qmldebugservice/tst_qmldebugservice.cpp index 0c02929..625d1f5 100644 --- a/tests/auto/declarative/debugger/qmldebugservice/tst_qmldebugservice.cpp +++ b/tests/auto/declarative/qmldebugservice/tst_qmldebugservice.cpp @@ -52,7 +52,7 @@ #include <private/qmldebugclient_p.h> #include <private/qmldebugservice_p.h> -#include "../debugutil_p.h" +#include "../shared/debugutil_p.h" class tst_QmlDebugService : public QObject { diff --git a/tests/auto/declarative/qmlinstruction/qmlinstruction.pro b/tests/auto/declarative/qmlinstruction/qmlinstruction.pro new file mode 100644 index 0000000..41be488 --- /dev/null +++ b/tests/auto/declarative/qmlinstruction/qmlinstruction.pro @@ -0,0 +1,6 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative script +SOURCES += tst_qmlinstruction.cpp +macx:CONFIG -= app_bundle + +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp b/tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp new file mode 100644 index 0000000..f493e0e --- /dev/null +++ b/tests/auto/declarative/qmlinstruction/tst_qmlinstruction.cpp @@ -0,0 +1,609 @@ +/**************************************************************************** +** +** 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 <qtest.h> +#include <private/qmlcompiler_p.h> + +class tst_qmlinstruction : public QObject +{ + Q_OBJECT +public: + tst_qmlinstruction() {} + +private slots: + void dump(); +}; + +static QStringList messages; +static void msgHandler(QtMsgType, const char *msg) +{ + messages << QLatin1String(msg); +} + +void tst_qmlinstruction::dump() +{ + QmlCompiledData *data = new QmlCompiledData; + { + QmlInstruction i; + i.line = 0; + i.type = QmlInstruction::Init; + data->bytecode << i; + } + + { + QmlCompiledData::TypeReference ref; + ref.className = "Test"; + data->types << ref; + + QmlInstruction i; + i.line = 1; + i.type = QmlInstruction::CreateObject; + i.create.type = 0; + i.create.data = -1; + i.create.bindingBits = -1; + i.create.column = 10; + data->bytecode << i; + } + + { + data->primitives << "testId"; + + QmlInstruction i; + i.line = 2; + i.type = QmlInstruction::SetId; + i.setId.value = 0; + i.setId.index = 0; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 3; + i.type = QmlInstruction::SetDefault; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 4; + i.type = QmlInstruction::CreateComponent; + i.createComponent.count = 3; + i.createComponent.column = 4; + i.createComponent.endLine = 14; + i.createComponent.metaObject = 0; + + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 5; + i.type = QmlInstruction::StoreMetaObject; + i.storeMeta.data = 3; + i.storeMeta.aliasData = 6; + i.storeMeta.propertyCache = 7; + + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 6; + i.type = QmlInstruction::StoreFloat; + i.storeFloat.propertyIndex = 3; + i.storeFloat.value = 11.3; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 7; + i.type = QmlInstruction::StoreDouble; + i.storeDouble.propertyIndex = 4; + i.storeDouble.value = 14.8; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 8; + i.type = QmlInstruction::StoreInteger; + i.storeInteger.propertyIndex = 5; + i.storeInteger.value = 9; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 9; + i.type = QmlInstruction::StoreBool; + i.storeBool.propertyIndex = 6; + i.storeBool.value = true; + + data->bytecode << i; + } + + { + data->primitives << "Test String"; + QmlInstruction i; + i.line = 10; + i.type = QmlInstruction::StoreString; + i.storeString.propertyIndex = 7; + i.storeString.value = 1; + data->bytecode << i; + } + + { + data->primitives << "http://www.nokia.com"; + QmlInstruction i; + i.line = 11; + i.type = QmlInstruction::StoreUrl; + i.storeUrl.propertyIndex = 8; + i.storeUrl.value = 2; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 12; + i.type = QmlInstruction::StoreColor; + i.storeColor.propertyIndex = 9; + i.storeColor.value = 0xFF00FF00; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 13; + i.type = QmlInstruction::StoreDate; + i.storeDate.propertyIndex = 10; + i.storeDate.value = 9; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 14; + i.type = QmlInstruction::StoreTime; + i.storeTime.propertyIndex = 11; + i.storeTime.valueIndex = 33; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 15; + i.type = QmlInstruction::StoreDateTime; + i.storeDateTime.propertyIndex = 12; + i.storeDateTime.valueIndex = 44; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 16; + i.type = QmlInstruction::StorePoint; + i.storeRealPair.propertyIndex = 13; + i.storeRealPair.valueIndex = 3; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 17; + i.type = QmlInstruction::StorePointF; + i.storeRealPair.propertyIndex = 14; + i.storeRealPair.valueIndex = 9; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 18; + i.type = QmlInstruction::StoreSize; + i.storeRealPair.propertyIndex = 15; + i.storeRealPair.valueIndex = 8; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 19; + i.type = QmlInstruction::StoreSizeF; + i.storeRealPair.propertyIndex = 16; + i.storeRealPair.valueIndex = 99; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 20; + i.type = QmlInstruction::StoreRect; + i.storeRect.propertyIndex = 17; + i.storeRect.valueIndex = 2; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 21; + i.type = QmlInstruction::StoreRectF; + i.storeRect.propertyIndex = 18; + i.storeRect.valueIndex = 19; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 22; + i.type = QmlInstruction::StoreVector3D; + i.storeVector3D.propertyIndex = 19; + i.storeVector3D.valueIndex = 9; + data->bytecode << i; + } + + { + data->primitives << "color(1, 1, 1, 1)"; + QmlInstruction i; + i.line = 23; + i.type = QmlInstruction::StoreVariant; + i.storeString.propertyIndex = 20; + i.storeString.value = 3; + + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 24; + i.type = QmlInstruction::StoreObject; + i.storeObject.propertyIndex = 21; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 25; + i.type = QmlInstruction::StoreVariantObject; + i.storeObject.propertyIndex = 22; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 26; + i.type = QmlInstruction::StoreInterface; + i.storeObject.propertyIndex = 23; + data->bytecode << i; + } + + { + data->primitives << "print(1921)"; + + QmlInstruction i; + i.line = 27; + i.type = QmlInstruction::StoreSignal; + i.storeSignal.signalIndex = 2; + i.storeSignal.value = 4; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 28; + i.type = QmlInstruction::StoreScript; + i.storeScript.value = 2; + i.storeScript.fileName = 18; + i.storeScript.lineNumber = 28; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 29; + i.type = QmlInstruction::StoreScriptString; + i.storeScriptString.propertyIndex = 24; + i.storeScriptString.value = 3; + i.storeScriptString.scope = 1; + data->bytecode << i; + } + + { + data->datas << "mySignal"; + + QmlInstruction i; + i.line = 30; + i.type = QmlInstruction::AssignSignalObject; + i.assignSignalObject.signal = 0; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 31; + i.type = QmlInstruction::AssignCustomType; + i.assignCustomType.propertyIndex = 25; + i.assignCustomType.valueIndex = 4; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 32; + i.type = QmlInstruction::StoreBinding; + i.assignBinding.property = 26; + i.assignBinding.value = 3; + i.assignBinding.context = 2; + i.assignBinding.owner = 0; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 33; + i.type = QmlInstruction::StoreIdOptBinding; + i.assignIdOptBinding.property = 27; + i.assignIdOptBinding.id = 2; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 34; + i.type = QmlInstruction::StoreObjPropBinding; + i.assignObjPropBinding.property = 28; + i.assignObjPropBinding.contextIdx = 3; + i.assignObjPropBinding.context = 7; + i.assignObjPropBinding.notifyIdx = 4; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 35; + i.type = QmlInstruction::StoreValueSource; + i.assignValueSource.property = 29; + i.assignValueSource.owner = 1; + i.assignValueSource.castValue = 4; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 36; + i.type = QmlInstruction::StoreValueInterceptor; + i.assignValueInterceptor.property = 30; + i.assignValueInterceptor.owner = 2; + i.assignValueInterceptor.castValue = -4; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 37; + i.type = QmlInstruction::BeginObject; + i.begin.castValue = 4; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 38; + i.type = QmlInstruction::StoreObjectQmlList; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 39; + i.type = QmlInstruction::StoreObjectQList; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 40; + i.type = QmlInstruction::AssignObjectList; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 41; + i.type = QmlInstruction::FetchAttached; + i.fetchAttached.id = 23; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 42; + i.type = QmlInstruction::FetchQmlList; + i.fetchQmlList.property = 31; + i.fetchQmlList.type = 3; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 43; + i.type = QmlInstruction::FetchQList; + i.fetch.property = 32; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 44; + i.type = QmlInstruction::FetchObject; + i.fetch.property = 33; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 45; + i.type = QmlInstruction::FetchValueType; + i.fetchValue.property = 34; + i.fetchValue.type = 6; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 46; + i.type = QmlInstruction::PopFetchedObject; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 47; + i.type = QmlInstruction::PopQList; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 48; + i.type = QmlInstruction::PopValueType; + i.fetchValue.property = 35; + i.fetchValue.type = 8; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 49; + i.type = QmlInstruction::Defer; + i.defer.deferCount = 7; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = -1; + i.type = QmlInstruction::Defer; + i.defer.deferCount = 7; + data->bytecode << i; + } + + { + QmlInstruction i; + i.line = 50; + i.type = (QmlInstruction::Type)(QmlInstruction::Defer + 1); // Non-existant + data->bytecode << i; + } + + QStringList expect; + expect + << "Index\tLine\tOperation\t\tData1\tData2\tData3\tComments" + << "-------------------------------------------------------------------------------" + << "0\t\t0\tINIT" + << "1\t\t1\tCREATE\t\t\t0\t\t\t\"Test\"" + << "2\t\t2\tSETID\t\t\t0\t\t\t\"testId\"" + << "3\t\t3\tSET_DEFAULT" + << "4\t\t4\tCREATE_COMPONENT\t3" + << "5\t\t5\tSTORE_META\t\t3" + << "6\t\t6\tSTORE_FLOAT\t\t3\t11.3" + << "7\t\t7\tSTORE_DOUBLE\t\t4\t14.8" + << "8\t\t8\tSTORE_INTEGER\t\t5\t9" + << "9\t\t9\tSTORE_BOOL\t\t6\ttrue" + << "10\t\t10\tSTORE_STRING\t\t7\t1\t\t\"Test String\"" + << "11\t\t11\tSTORE_URL\t\t8\t2\t\t\"http://www.nokia.com\"" + << "12\t\t12\tSTORE_COLOR\t\t9\t\t\t\"ff00ff00\"" + << "13\t\t13\tSTORE_DATE\t\t10\t9" + << "14\t\t14\tSTORE_TIME\t\t11\t33" + << "15\t\t15\tSTORE_DATETIME\t\t12\t44" + << "16\t\t16\tSTORE_POINT\t\t13\t3" + << "17\t\t17\tSTORE_POINTF\t\t14\t9" + << "18\t\t18\tSTORE_SIZE\t\t15\t8" + << "19\t\t19\tSTORE_SIZEF\t\t16\t99" + << "20\t\t20\tSTORE_RECT\t\t17\t2" + << "21\t\t21\tSTORE_RECTF\t\t18\t19" + << "22\t\t22\tSTORE_VECTOR3D\t\t19\t9" + << "23\t\t23\tSTORE_VARIANT\t\t20\t3\t\t\"color(1, 1, 1, 1)\"" + << "24\t\t24\tSTORE_OBJECT\t\t21" + << "25\t\t25\tSTORE_VARIANT_OBJECT\t22" + << "26\t\t26\tSTORE_INTERFACE\t\t23" + << "27\t\t27\tSTORE_SIGNAL\t\t2\t4\t\t\"print(1921)\"" + << "28\t\t28\tSTORE_SCRIPT\t\t2\t18\t28" + << "29\t\t29\tSTORE_SCRIPT_STRING\t24\t3\t1" + << "30\t\t30\tASSIGN_SIGNAL_OBJECT\t0\t\t\t\"mySignal\"" + << "31\t\t31\tASSIGN_CUSTOMTYPE\t25\t4" + << "32\t\t32\tSTORE_COMPILED_BINDING\t26\t3\t2" + << "33\t\t33\tSTORE_ID_OPT_BINDING\t27\t2" + << "34\t\t34\tSTORE_OBJ_PROP_BINDING\t28\t3\t7\t4" + << "35\t\t35\tSTORE_VALUE_SOURCE\t29\t4" + << "36\t\t36\tSTORE_VALUE_INTERCEPTOR\t30\t-4" + << "37\t\t37\tBEGIN\t\t\t4" + << "38\t\t38\tSTORE_OBJECT_QMLLIST" + << "39\t\t39\tSTORE_OBJECT_QLIST" + << "40\t\t40\tASSIGN_OBJECT_LIST" + << "41\t\t41\tFETCH_ATTACHED\t\t23" + << "42\t\t42\tFETCH_QMLLIST\t\t31\t3" + << "43\t\t43\tFETCH_QLIST\t\t32" + << "44\t\t44\tFETCH\t\t\t33" + << "45\t\t45\tFETCH_VALUE\t\t34\t6" + << "46\t\t46\tPOP" + << "47\t\t47\tPOP_QLIST" + << "48\t\t48\tPOP_VALUE\t\t35\t8" + << "49\t\t49\tDEFER\t\t\t7" + << "50\t\tNA\tDEFER\t\t\t7" + << "51\t\t50\tXXX UNKOWN INSTRUCTION\t50" + << "-------------------------------------------------------------------------------"; + + messages = QStringList(); + QtMsgHandler old = qInstallMsgHandler(msgHandler); + data->dumpInstructions(); + qInstallMsgHandler(old); + + QCOMPARE(messages.count(), expect.count()); + for (int ii = 0; ii < messages.count(); ++ii) { + QCOMPARE(messages.at(ii), expect.at(ii)); + } + + data->release(); +} + +QTEST_MAIN(tst_qmlinstruction) + +#include "tst_qmlinstruction.moc" diff --git a/tests/auto/declarative/qmllanguage/data/DynamicPropertiesNestedType.qml b/tests/auto/declarative/qmllanguage/data/DynamicPropertiesNestedType.qml new file mode 100644 index 0000000..5c2edb4 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/DynamicPropertiesNestedType.qml @@ -0,0 +1,6 @@ +import Qt 4.6 + +Object { + property int super_a: 10 + property int super_c: 14 +} diff --git a/tests/auto/declarative/qmllanguage/data/dynamicProperties.qml b/tests/auto/declarative/qmllanguage/data/dynamicProperties.qml index f93e446..17fa974 100644 --- a/tests/auto/declarative/qmllanguage/data/dynamicProperties.qml +++ b/tests/auto/declarative/qmllanguage/data/dynamicProperties.qml @@ -7,6 +7,7 @@ Object { property real realProperty: -19.9 property string stringProperty: "Hello World!" property color colorProperty: "red" + property url urlProperty: "main.qml" property date dateProperty: "1945-09-02" property var varProperty: "Hello World!" property variant variantProperty: 12 diff --git a/tests/auto/declarative/qmllanguage/data/dynamicPropertiesNested.qml b/tests/auto/declarative/qmllanguage/data/dynamicPropertiesNested.qml new file mode 100644 index 0000000..7bfab67 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/dynamicPropertiesNested.qml @@ -0,0 +1,9 @@ +import Qt 4.6 + +DynamicPropertiesNestedType { + property int a: 13 + property int b: 12 + + super_a: 11 +} + diff --git a/tests/auto/declarative/qmllanguage/data/dynamicSignalsAndSlots.qml b/tests/auto/declarative/qmllanguage/data/dynamicSignalsAndSlots.qml index b0ca970..72ec218 100644 --- a/tests/auto/declarative/qmllanguage/data/dynamicSignalsAndSlots.qml +++ b/tests/auto/declarative/qmllanguage/data/dynamicSignalsAndSlots.qml @@ -4,4 +4,7 @@ Object { function slot1() {} signal signal2 function slot2() {} + + property int test: 0 + function slot3(a) { print(1921); test = a; } } diff --git a/tests/auto/declarative/qmllanguage/data/listProperties.qml b/tests/auto/declarative/qmllanguage/data/listProperties.qml new file mode 100644 index 0000000..c39ceae --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/listProperties.qml @@ -0,0 +1,9 @@ +import Qt 4.6 + +Object { + property list<Object> listProperty + property int test: listProperty.length + + listProperty: [ Object{}, Object {} ] +} + diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp index d5c5c4d..892d2eb 100644 --- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp +++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp @@ -91,6 +91,8 @@ private slots: void idProperty(); void assignSignal(); void dynamicProperties(); + void dynamicPropertiesNested(); + void listProperties(); void dynamicObjectProperties(); void dynamicSignalsAndSlots(); void simpleBindings(); @@ -554,12 +556,40 @@ void tst_qmllanguage::dynamicProperties() QCOMPARE(object->property("doubleProperty"), QVariant(-10.1)); QCOMPARE(object->property("realProperty"), QVariant((qreal)-19.9)); QCOMPARE(object->property("stringProperty"), QVariant("Hello World!")); + QCOMPARE(object->property("urlProperty"), QVariant(TEST_FILE("main.qml"))); QCOMPARE(object->property("colorProperty"), QVariant(QColor("red"))); QCOMPARE(object->property("dateProperty"), QVariant(QDate(1945, 9, 2))); QCOMPARE(object->property("varProperty"), QVariant("Hello World!")); QCOMPARE(object->property("variantProperty"), QVariant(12)); } +// Test that nested types can use dynamic properties +void tst_qmllanguage::dynamicPropertiesNested() +{ + QmlComponent component(&engine, TEST_FILE("dynamicPropertiesNested.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); + + QCOMPARE(object->property("super_a").toInt(), 11); // Overridden + QCOMPARE(object->property("super_c").toInt(), 14); // Inherited + QCOMPARE(object->property("a").toInt(), 13); // New + QCOMPARE(object->property("b").toInt(), 12); // New + + delete object; +} + +// Tests the creation and assignment to dynamic list properties +void tst_qmllanguage::listProperties() +{ + QmlComponent component(&engine, TEST_FILE("listProperties.qml")); + VERIFY_ERRORS(0); + QObject *object = component.create(); + QVERIFY(object != 0); + + QCOMPARE(object->property("test").toInt(), 2); +} + // Tests the creation and assignment of dynamic object properties // ### Not complete void tst_qmllanguage::dynamicObjectProperties() @@ -584,6 +614,10 @@ void tst_qmllanguage::dynamicSignalsAndSlots() QVERIFY(object->metaObject()->indexOfMethod("signal2()") != -1); QVERIFY(object->metaObject()->indexOfMethod("slot1()") != -1); QVERIFY(object->metaObject()->indexOfMethod("slot2()") != -1); + + QCOMPARE(object->property("test").toInt(), 0); + QMetaObject::invokeMethod(object, "slot3", Qt::DirectConnection, Q_ARG(QVariant, QVariant(10))); + QCOMPARE(object->property("test").toInt(), 10); } void tst_qmllanguage::simpleBindings() diff --git a/tests/auto/declarative/debugger/qpacketprotocol/qpacketprotocol.pro b/tests/auto/declarative/qpacketprotocol/qpacketprotocol.pro index 800e5e0..f42cecc 100644 --- a/tests/auto/declarative/debugger/qpacketprotocol/qpacketprotocol.pro +++ b/tests/auto/declarative/qpacketprotocol/qpacketprotocol.pro @@ -2,6 +2,6 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += network declarative macx:CONFIG -= app_bundle -HEADERS += ../debugutil_p.h +HEADERS += ../shared/debugutil_p.h SOURCES += tst_qpacketprotocol.cpp \ - ../debugutil.cpp + ../shared/debugutil.cpp diff --git a/tests/auto/declarative/debugger/qpacketprotocol/tst_qpacketprotocol.cpp b/tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp index 36b6317..b54f133 100644 --- a/tests/auto/declarative/debugger/qpacketprotocol/tst_qpacketprotocol.cpp +++ b/tests/auto/declarative/qpacketprotocol/tst_qpacketprotocol.cpp @@ -48,7 +48,7 @@ #include <private/qpacketprotocol_p.h> -#include "../debugutil_p.h" +#include "../shared/debugutil_p.h" class tst_QPacketProtocol : public QObject { diff --git a/tests/auto/declarative/repeater/data/intmodel.qml b/tests/auto/declarative/repeater/data/intmodel.qml index a779079..2d6eae8 100644 --- a/tests/auto/declarative/repeater/data/intmodel.qml +++ b/tests/auto/declarative/repeater/data/intmodel.qml @@ -6,12 +6,24 @@ Rectangle { width: 240 height: 320 color: "white" + + function checkProperties() { + testObject.error = false; + if (repeater.delegate != comp) { + print("delegate property incorrect"); + testObject.error = true; + } + } + + Component { + id: comp + Item{} + } + Repeater { id: repeater objectName: "repeater" model: testData - Component { - Item{} - } + delegate: comp } } diff --git a/tests/auto/declarative/repeater/data/itemlist.qml b/tests/auto/declarative/repeater/data/itemlist.qml new file mode 100644 index 0000000..8d28bf8 --- /dev/null +++ b/tests/auto/declarative/repeater/data/itemlist.qml @@ -0,0 +1,49 @@ +// This example demonstrates placing items in a view using +// a VisualItemModel + +import Qt 4.6 + +Rectangle { + color: "lightgray" + width: 240 + height: 320 + + function checkProperties() { + testObject.error = false; + if (testObject.useModel && view.model != itemModel) { + print("model property incorrect"); + testObject.error = true; + } + } + + VisualItemModel { + id: itemModel + objectName: "itemModel" + Rectangle { + objectName: "item1" + height: view.height; width: view.width; color: "#FFFEF0" + Text { objectName: "text1"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent } + } + Rectangle { + objectName: "item2" + height: view.height; width: view.width; color: "#F0FFF7" + Text { objectName: "text2"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent } + } + Rectangle { + objectName: "item3" + height: view.height; width: view.width; color: "#F4F0FF" + Text { objectName: "text3"; text: "index: " + parent.VisualItemModel.index; font.bold: true; anchors.centerIn: parent } + } + } + + Column { + objectName: "container" + Repeater { + id: view + objectName: "repeater" + anchors.fill: parent + anchors.bottomMargin: 30 + model: testObject.useModel ? itemModel : 0 + } + } +} diff --git a/tests/auto/declarative/repeater/data/repeater2.qml b/tests/auto/declarative/repeater/data/repeater2.qml new file mode 100644 index 0000000..c3c3260 --- /dev/null +++ b/tests/auto/declarative/repeater/data/repeater2.qml @@ -0,0 +1,35 @@ +import Qt 4.6 + +Rectangle { + width: 240 + height: 320 + color: "white" + Component { + id: myDelegate + Item { + objectName: "myDelegate" + height: 20 + Text { + y: index*20 + text: name + } + Text { + y: index*20 + x: 100 + text: number + } + } + } + Column { + id: container + objectName: "container" + Repeater { + id: repeater + objectName: "repeater" + width: 240 + height: 320 + delegate: myDelegate + model: testData + } + } +} diff --git a/tests/auto/declarative/repeater/tst_repeater.cpp b/tests/auto/declarative/repeater/tst_repeater.cpp index e002ee1..c0fa645 100644 --- a/tests/auto/declarative/repeater/tst_repeater.cpp +++ b/tests/auto/declarative/repeater/tst_repeater.cpp @@ -55,6 +55,8 @@ private slots: void numberModel(); void objectList(); void stringList(); + void dataModel(); + void itemModel(); private: QmlView *createView(const QString &filename); @@ -62,6 +64,91 @@ private: T *findItem(QObject *parent, const QString &id); }; +class TestObject : public QObject +{ + Q_OBJECT + + Q_PROPERTY(bool error READ error WRITE setError) + Q_PROPERTY(bool useModel READ useModel NOTIFY useModelChanged) + +public: + TestObject() : QObject(), mError(true), mUseModel(false) {} + + bool error() const { return mError; } + void setError(bool err) { mError = err; } + + bool useModel() const { return mUseModel; } + void setUseModel(bool use) { mUseModel = use; emit useModelChanged(); } + +signals: + void useModelChanged(); + +private: + bool mError; + bool mUseModel; +}; + +class TestModel : public QAbstractListModel +{ +public: + enum Roles { Name = Qt::UserRole+1, Number = Qt::UserRole+2 }; + + TestModel(QObject *parent=0) : QAbstractListModel(parent) { + QHash<int, QByteArray> 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<QString,QString>(name, number)); + emit endInsertRows(); + } + + void insertItem(int index, const QString &name, const QString &number) { + emit beginInsertRows(QModelIndex(), index, index); + list.insert(index, QPair<QString,QString>(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<QString,QString>(name, number); + emit dataChanged(index(idx,0), index(idx,0)); + } + +private: + QList<QPair<QString,QString> > list; +}; + + tst_QmlGraphicsRepeater::tst_QmlGraphicsRepeater() { } @@ -69,15 +156,23 @@ tst_QmlGraphicsRepeater::tst_QmlGraphicsRepeater() void tst_QmlGraphicsRepeater::numberModel() { QmlView *canvas = createView(SRCDIR "/data/intmodel.qml"); - canvas->execute(); - qApp->processEvents(); QmlContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testData", 5); + TestObject *testObject = new TestObject; + ctxt->setContextProperty("testObject", testObject); + + canvas->execute(); + qApp->processEvents(); QmlGraphicsRepeater *repeater = findItem<QmlGraphicsRepeater>(canvas->root(), "repeater"); QVERIFY(repeater != 0); QCOMPARE(repeater->parentItem()->childItems().count(), 5+1); + + QMetaObject::invokeMethod(canvas->root(), "checkProperties"); + QVERIFY(testObject->error() == false); + + delete canvas; } void tst_QmlGraphicsRepeater::objectList() @@ -159,6 +254,67 @@ void tst_QmlGraphicsRepeater::stringList() delete canvas; } +void tst_QmlGraphicsRepeater::dataModel() +{ + QmlView *canvas = createView(SRCDIR "/data/repeater2.qml"); + QmlContext *ctxt = canvas->rootContext(); + TestObject *testObject = new TestObject; + ctxt->setContextProperty("testObject", testObject); + + TestModel testModel; + testModel.addItem("one", "1"); + testModel.addItem("two", "2"); + testModel.addItem("three", "3"); + + ctxt->setContextProperty("testData", &testModel); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsRepeater *repeater = findItem<QmlGraphicsRepeater>(canvas->root(), "repeater"); + QVERIFY(repeater != 0); + + QmlGraphicsItem *container = findItem<QmlGraphicsItem>(canvas->root(), "container"); + QVERIFY(container != 0); + + QCOMPARE(container->childItems().count(), 4); + + testModel.addItem("four", "4"); + + QCOMPARE(container->childItems().count(), 5); +} + +void tst_QmlGraphicsRepeater::itemModel() +{ + QmlView *canvas = createView(SRCDIR "/data/itemlist.qml"); + QmlContext *ctxt = canvas->rootContext(); + TestObject *testObject = new TestObject; + ctxt->setContextProperty("testObject", testObject); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsRepeater *repeater = findItem<QmlGraphicsRepeater>(canvas->root(), "repeater"); + QVERIFY(repeater != 0); + + QmlGraphicsItem *container = findItem<QmlGraphicsItem>(canvas->root(), "container"); + QVERIFY(container != 0); + + QCOMPARE(container->childItems().count(), 1); + + testObject->setUseModel(true); + QMetaObject::invokeMethod(canvas->root(), "checkProperties"); + QVERIFY(testObject->error() == false); + + QCOMPARE(container->childItems().count(), 4); + QVERIFY(qobject_cast<QObject*>(container->childItems().at(0))->objectName() == "item1"); + QVERIFY(qobject_cast<QObject*>(container->childItems().at(1))->objectName() == "item2"); + QVERIFY(qobject_cast<QObject*>(container->childItems().at(2))->objectName() == "item3"); + QVERIFY(container->childItems().at(3) == repeater); + + delete canvas; +} + QmlView *tst_QmlGraphicsRepeater::createView(const QString &filename) { diff --git a/tests/auto/declarative/debugger/debugutil.cpp b/tests/auto/declarative/shared/debugutil.cpp index 7008529..7008529 100644 --- a/tests/auto/declarative/debugger/debugutil.cpp +++ b/tests/auto/declarative/shared/debugutil.cpp diff --git a/tests/auto/declarative/debugger/debugutil_p.h b/tests/auto/declarative/shared/debugutil_p.h index 665aeda..665aeda 100644 --- a/tests/auto/declarative/debugger/debugutil_p.h +++ b/tests/auto/declarative/shared/debugutil_p.h diff --git a/tests/auto/declarative/states/data/anchorChanges.qml b/tests/auto/declarative/states/data/anchorChanges.qml index bb17840..3d94f36 100644 --- a/tests/auto/declarative/states/data/anchorChanges.qml +++ b/tests/auto/declarative/states/data/anchorChanges.qml @@ -1,7 +1,7 @@ import Qt 4.6 Rectangle { - id: container + id: Container width: 200; height: 200 Rectangle { id: myRect @@ -14,9 +14,10 @@ Rectangle { states: State { name: "right" AnchorChanges { + id: AncCh target: myRect; reset: "left" - right: container.right + right: Container.right } } } diff --git a/tests/auto/declarative/states/data/anchorChanges2.qml b/tests/auto/declarative/states/data/anchorChanges2.qml index 545345e..2e13628 100644 --- a/tests/auto/declarative/states/data/anchorChanges2.qml +++ b/tests/auto/declarative/states/data/anchorChanges2.qml @@ -3,7 +3,7 @@ import Qt 4.6 Rectangle { width: 200; height: 200 Rectangle { - id: myRect + id: MyRect objectName: "MyRect" width: 50; height: 50 color: "green"; @@ -13,7 +13,7 @@ Rectangle { states: State { name: "right" AnchorChanges { - target: myRect; + target: MyRect; reset: "left" right: parent.right } diff --git a/tests/auto/declarative/states/data/anchorChanges3.qml b/tests/auto/declarative/states/data/anchorChanges3.qml new file mode 100644 index 0000000..cf85472 --- /dev/null +++ b/tests/auto/declarative/states/data/anchorChanges3.qml @@ -0,0 +1,29 @@ +import Qt 4.6 + +Rectangle { + id: Container + width: 200; height: 200 + Rectangle { + id: MyRect + objectName: "MyRect" + color: "green"; + anchors.left: parent.left + anchors.right: RightGuideline.left + anchors.top: TopGuideline.top + anchors.bottom: Container.bottom + } + Item { objectName: "LeftGuideline"; id: LeftGuideline; x: 10 } + Item { id: RightGuideline; x: 150 } + Item { id: TopGuideline; y: 10 } + Item { objectName: "BottomGuideline"; id: BottomGuideline; y: 150 } + states: State { + name: "reanchored" + AnchorChanges { + target: MyRect; + left: LeftGuideline.left + right: Container.right + top: Container.top + bottom: BottomGuideline.bottom + } + } +} diff --git a/tests/auto/declarative/states/data/anchorChanges4.qml b/tests/auto/declarative/states/data/anchorChanges4.qml new file mode 100644 index 0000000..717f506 --- /dev/null +++ b/tests/auto/declarative/states/data/anchorChanges4.qml @@ -0,0 +1,22 @@ +import Qt 4.6 + +Rectangle { + width: 200; height: 200 + Rectangle { + id: MyRect + objectName: "MyRect" + color: "green"; + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + } + Item { objectName: "LeftGuideline"; id: LeftGuideline; x: 10 } + Item { objectName: "BottomGuideline"; id: BottomGuideline; y: 150 } + states: State { + name: "reanchored" + AnchorChanges { + target: MyRect; + horizontalCenter: BottomGuideline.horizontalCenter + verticalCenter: LeftGuideline.verticalCenter + } + } +} diff --git a/tests/auto/declarative/states/data/anchorChanges5.qml b/tests/auto/declarative/states/data/anchorChanges5.qml new file mode 100644 index 0000000..ef5f041 --- /dev/null +++ b/tests/auto/declarative/states/data/anchorChanges5.qml @@ -0,0 +1,22 @@ +import Qt 4.6 + +Rectangle { + width: 200; height: 200 + Rectangle { + id: MyRect + objectName: "MyRect" + color: "green"; + anchors.horizontalCenter: parent.horizontalCenter + anchors.baseline: parent.baseline + } + Item { objectName: "LeftGuideline"; id: LeftGuideline; x: 10 } + Item { objectName: "BottomGuideline"; id: BottomGuideline; y: 150 } + states: State { + name: "reanchored" + AnchorChanges { + target: MyRect; + horizontalCenter: BottomGuideline.horizontalCenter + baseline: LeftGuideline.baseline + } + } +} diff --git a/tests/auto/declarative/states/data/parentChange.qml b/tests/auto/declarative/states/data/parentChange.qml index 94fbd69..29596a8 100644 --- a/tests/auto/declarative/states/data/parentChange.qml +++ b/tests/auto/declarative/states/data/parentChange.qml @@ -21,6 +21,7 @@ Rectangle { x: -100; y: -50 Item { id: newParent + objectName: "NewParent" x: 248; y: 360 } } diff --git a/tests/auto/declarative/states/tst_states.cpp b/tests/auto/declarative/states/tst_states.cpp index fe90191..92d278a 100644 --- a/tests/auto/declarative/states/tst_states.cpp +++ b/tests/auto/declarative/states/tst_states.cpp @@ -41,6 +41,7 @@ #include <qtest.h> #include <QtDeclarative/qmlengine.h> #include <QtDeclarative/qmlcomponent.h> +#include <private/qmlgraphicsanchors_p_p.h> #include <private/qmlgraphicsrectangle_p.h> #include <private/qmlpropertychanges_p.h> @@ -59,6 +60,10 @@ private slots: void parentChange(); void parentChangeErrors(); void anchorChanges(); + void anchorChanges2(); + void anchorChanges3(); + void anchorChanges4(); + void anchorChanges5(); void script(); void restoreEntryValues(); void explicitChanges(); @@ -386,6 +391,13 @@ void tst_states::parentChange() QmlGraphicsRectangle *innerRect = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect")); QVERIFY(innerRect != 0); + QmlParentChange *pChange = qobject_cast<QmlParentChange*>(rect->states()->at(0)->changes()->at(0)); + QVERIFY(pChange != 0); + QmlGraphicsItem *nParent = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("NewParent")); + QVERIFY(nParent != 0); + + QCOMPARE(pChange->parent(), nParent); + rect->setState("reparented"); QCOMPARE(innerRect->rotation(), qreal(0)); QCOMPARE(innerRect->scale(), qreal(1)); @@ -471,35 +483,153 @@ void tst_states::anchorChanges() { QmlEngine engine; - { - QmlComponent rectComponent(&engine, SRCDIR "/data/anchorChanges.qml"); - QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(rectComponent.create()); - QVERIFY(rect != 0); + QmlComponent rectComponent(&engine, SRCDIR "/data/anchorChanges.qml"); + QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(rectComponent.create()); + QVERIFY(rect != 0); - QmlGraphicsRectangle *innerRect = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect")); - QVERIFY(innerRect != 0); + QmlGraphicsRectangle *innerRect = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect")); + QVERIFY(innerRect != 0); - rect->setState("right"); - QCOMPARE(innerRect->x(), qreal(150)); + QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(rect->states()->at(0)->changes()->at(0)); + QVERIFY(aChanges != 0); - rect->setState(""); - QCOMPARE(innerRect->x(), qreal(5)); - } + rect->setState("right"); + QCOMPARE(innerRect->x(), qreal(150)); + QCOMPARE(aChanges->reset(), QString("left")); + QCOMPARE(aChanges->object(), innerRect); + QCOMPARE(aChanges->right().item, rect->right().item); + QCOMPARE(aChanges->right().anchorLine, rect->right().anchorLine); - { - QmlComponent rectComponent(&engine, SRCDIR "/data/anchorChanges2.qml"); - QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(rectComponent.create()); - QVERIFY(rect != 0); + rect->setState(""); + QCOMPARE(innerRect->x(), qreal(5)); - QmlGraphicsRectangle *innerRect = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect")); - QVERIFY(innerRect != 0); + delete rect; +} - rect->setState("right"); - QCOMPARE(innerRect->x(), qreal(150)); +void tst_states::anchorChanges2() +{ + QmlEngine engine; - rect->setState(""); - QCOMPARE(innerRect->x(), qreal(5)); - } + QmlComponent rectComponent(&engine, SRCDIR "/data/anchorChanges2.qml"); + QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(rectComponent.create()); + QVERIFY(rect != 0); + + QmlGraphicsRectangle *innerRect = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect")); + QVERIFY(innerRect != 0); + + rect->setState("right"); + QEXPECT_FAIL("", "QTBUG-5338", Continue); + QCOMPARE(innerRect->x(), qreal(150)); + + rect->setState(""); + QCOMPARE(innerRect->x(), qreal(5)); + + delete rect; +} + +void tst_states::anchorChanges3() +{ + QmlEngine engine; + + QmlComponent rectComponent(&engine, SRCDIR "/data/anchorChanges3.qml"); + QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(rectComponent.create()); + QVERIFY(rect != 0); + + QmlGraphicsRectangle *innerRect = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect")); + QVERIFY(innerRect != 0); + + QmlGraphicsItem *leftGuideline = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("LeftGuideline")); + QVERIFY(leftGuideline != 0); + + QmlGraphicsItem *bottomGuideline = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("BottomGuideline")); + QVERIFY(bottomGuideline != 0); + + QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(rect->states()->at(0)->changes()->at(0)); + QVERIFY(aChanges != 0); + + rect->setState("reanchored"); + QCOMPARE(aChanges->object(), innerRect); + QCOMPARE(aChanges->left().item, leftGuideline->left().item); + QCOMPARE(aChanges->left().anchorLine, leftGuideline->left().anchorLine); + QCOMPARE(aChanges->right().item, rect->right().item); + QCOMPARE(aChanges->right().anchorLine, rect->right().anchorLine); + QCOMPARE(aChanges->top().item, rect->top().item); + QCOMPARE(aChanges->top().anchorLine, rect->top().anchorLine); + QCOMPARE(aChanges->bottom().item, bottomGuideline->bottom().item); + QCOMPARE(aChanges->bottom().anchorLine, bottomGuideline->bottom().anchorLine); + + QCOMPARE(innerRect->x(), qreal(10)); + QCOMPARE(innerRect->y(), qreal(0)); + QCOMPARE(innerRect->width(), qreal(190)); + QCOMPARE(innerRect->height(), qreal(150)); + + rect->setState(""); + QCOMPARE(innerRect->x(), qreal(0)); + QCOMPARE(innerRect->y(), qreal(10)); + QCOMPARE(innerRect->width(), qreal(150)); + QCOMPARE(innerRect->height(), qreal(190)); + + delete rect; +} + +void tst_states::anchorChanges4() +{ + QmlEngine engine; + + QmlComponent rectComponent(&engine, SRCDIR "/data/anchorChanges4.qml"); + QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(rectComponent.create()); + QVERIFY(rect != 0); + + QmlGraphicsRectangle *innerRect = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect")); + QVERIFY(innerRect != 0); + + QmlGraphicsItem *leftGuideline = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("LeftGuideline")); + QVERIFY(leftGuideline != 0); + + QmlGraphicsItem *bottomGuideline = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("BottomGuideline")); + QVERIFY(bottomGuideline != 0); + + QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(rect->states()->at(0)->changes()->at(0)); + QVERIFY(aChanges != 0); + + rect->setState("reanchored"); + QCOMPARE(aChanges->object(), innerRect); + QCOMPARE(aChanges->horizontalCenter().item, bottomGuideline->horizontalCenter().item); + QCOMPARE(aChanges->horizontalCenter().anchorLine, bottomGuideline->horizontalCenter().anchorLine); + QCOMPARE(aChanges->verticalCenter().item, leftGuideline->verticalCenter().item); + QCOMPARE(aChanges->verticalCenter().anchorLine, leftGuideline->verticalCenter().anchorLine); + + delete rect; +} + +void tst_states::anchorChanges5() +{ + QmlEngine engine; + + QmlComponent rectComponent(&engine, SRCDIR "/data/anchorChanges5.qml"); + QmlGraphicsRectangle *rect = qobject_cast<QmlGraphicsRectangle*>(rectComponent.create()); + QVERIFY(rect != 0); + + QmlGraphicsRectangle *innerRect = qobject_cast<QmlGraphicsRectangle*>(rect->findChild<QmlGraphicsRectangle*>("MyRect")); + QVERIFY(innerRect != 0); + + QmlGraphicsItem *leftGuideline = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("LeftGuideline")); + QVERIFY(leftGuideline != 0); + + QmlGraphicsItem *bottomGuideline = qobject_cast<QmlGraphicsItem*>(rect->findChild<QmlGraphicsItem*>("BottomGuideline")); + QVERIFY(bottomGuideline != 0); + + QmlAnchorChanges *aChanges = qobject_cast<QmlAnchorChanges*>(rect->states()->at(0)->changes()->at(0)); + QVERIFY(aChanges != 0); + + rect->setState("reanchored"); + QCOMPARE(aChanges->object(), innerRect); + QCOMPARE(aChanges->horizontalCenter().item, bottomGuideline->horizontalCenter().item); + QCOMPARE(aChanges->horizontalCenter().anchorLine, bottomGuideline->horizontalCenter().anchorLine); + QCOMPARE(aChanges->baseline().item, leftGuideline->baseline().item); + QCOMPARE(aChanges->baseline().anchorLine, leftGuideline->baseline().anchorLine); + + delete rect; } void tst_states::script() diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.0.png b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.0.png Binary files differnew file mode 100644 index 0000000..c7bbf38 --- /dev/null +++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.0.png diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.1.png b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.1.png Binary files differnew file mode 100644 index 0000000..612500b --- /dev/null +++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.1.png diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.2.png b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.2.png Binary files differnew file mode 100644 index 0000000..c7bbf38 --- /dev/null +++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.2.png diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.3.png b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.3.png Binary files differnew file mode 100644 index 0000000..c7bbf38 --- /dev/null +++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.3.png diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.4.png b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.4.png Binary files differnew file mode 100644 index 0000000..1910eb4 --- /dev/null +++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.4.png diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.5.png b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.5.png Binary files differnew file mode 100644 index 0000000..3b8eebd --- /dev/null +++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.5.png diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.6.png b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.6.png Binary files differnew file mode 100644 index 0000000..c7bbf38 --- /dev/null +++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.6.png diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.7.png b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.7.png Binary files differnew file mode 100644 index 0000000..c7bbf38 --- /dev/null +++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.7.png diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.8.png b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.8.png Binary files differnew file mode 100644 index 0000000..960be31 --- /dev/null +++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.8.png diff --git a/tests/auto/declarative/visual/animation/reanchor/data/reanchor.qml b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.qml new file mode 100644 index 0000000..0f58de5 --- /dev/null +++ b/tests/auto/declarative/visual/animation/reanchor/data/reanchor.qml @@ -0,0 +1,2471 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 32 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 48 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 64 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 80 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 96 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 112 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 128 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 144 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 160 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 176 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 192 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 208 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 224 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 240 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 256 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 272 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 288 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 304 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 320 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 336 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 352 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 368 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 384 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 400 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 416 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 432 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 448 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 464 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 480 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 496 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 512 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 528 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 544 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 560 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 576 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 592 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 608 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 624 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 640 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 656 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 672 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 688 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 704 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 720 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 736 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 752 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 768 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 784 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 800 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 816 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 832 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 848 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 864 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 880 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 896 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 912 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 928 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 944 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 960 + image: "reanchor.0.png" + } + Frame { + msec: 976 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 992 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1008 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1024 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1040 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1056 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1072 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1088 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1104 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1120 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1136 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1152 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1168 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1184 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1200 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1216 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1232 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1248 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1264 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1280 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1296 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1312 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1328 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1344 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1360 + hash: "213811853dbefdc418099721e3bf8651" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 88; y: 115 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1376 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1392 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1408 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1424 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1440 + hash: "213811853dbefdc418099721e3bf8651" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 88; y: 115 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 1456 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 1472 + hash: "c2d6dd91f3e9cdcacbadcb449c8a9896" + } + Frame { + msec: 1488 + hash: "1098ea19aecebd71208e101d522c1981" + } + Frame { + msec: 1504 + hash: "8cc59c20d796c073038518d2855fb6f0" + } + Frame { + msec: 1520 + hash: "914a89d0cfdc68145024ce2305a5e76e" + } + Frame { + msec: 1536 + hash: "7a2e3ca2660df24d9a6ec49a7422ebe1" + } + Frame { + msec: 1552 + hash: "b71496d986d5f0aa76b4f1663627f1f7" + } + Frame { + msec: 1568 + hash: "41b29a523db919bc0a4e0a9a88bfc873" + } + Frame { + msec: 1584 + hash: "97632a0de766b9ffbf71f21eeb0ff9a2" + } + Frame { + msec: 1600 + hash: "94cc196e62c150008461ff9996b4cae8" + } + Frame { + msec: 1616 + hash: "32e96ad2d15fa2386d365ab249ddf4f4" + } + Frame { + msec: 1632 + hash: "209394314f971b12fbc61ca45010cc62" + } + Frame { + msec: 1648 + hash: "b917c2684dda8af00278b34ababdcf5c" + } + Frame { + msec: 1664 + hash: "92b506860c1c5dc52f87c24c89921b05" + } + Frame { + msec: 1680 + hash: "7b7e96113fa9359954be9b3ac87943c3" + } + Frame { + msec: 1696 + hash: "42bc69db42c5df902038cec414246ec5" + } + Frame { + msec: 1712 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 1728 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 1744 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 1760 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 1776 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 1792 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 1808 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 1824 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 1840 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 1856 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 1872 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 1888 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 1904 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 1920 + image: "reanchor.1.png" + } + Frame { + msec: 1936 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 1952 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 1968 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 1984 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 2000 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 2016 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 2032 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 2048 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 2064 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 2080 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 2096 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 87; y: 114 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2112 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 2128 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 2144 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 2160 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 2176 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 2192 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 2208 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 87; y: 114 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2224 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 2240 + hash: "2d1aa011f2008a6147ba593e3cf272d7" + } + Frame { + msec: 2256 + hash: "206699ea84ce9fd60c1603b7a48a5134" + } + Frame { + msec: 2272 + hash: "68eb6df93a2b6db7023f7c3cc71d5b5f" + } + Frame { + msec: 2288 + hash: "5a4cd0620959dde92eeeaaa4dcd13091" + } + Frame { + msec: 2304 + hash: "17b763187a777253b25b22f5dd7253ae" + } + Frame { + msec: 2320 + hash: "1de9dcf4d385266f4482e2d0967d9119" + } + Frame { + msec: 2336 + hash: "833496add6dbc3103a28a47e453a738b" + } + Frame { + msec: 2352 + hash: "b3bab2e9c56db60cd54e68369e6b790d" + } + Frame { + msec: 2368 + hash: "ee91c6cd909bec401a1a7eebd10b8b02" + } + Frame { + msec: 2384 + hash: "0ed679ad0ab7bd3544947bccda88647b" + } + Frame { + msec: 2400 + hash: "d7dfcdc8a4233821919f1732d8c39712" + } + Frame { + msec: 2416 + hash: "c52829ee689e4c312a9dff8dbd4a79f9" + } + Frame { + msec: 2432 + hash: "7962badda0e80a61b67943d3b31f892d" + } + Frame { + msec: 2448 + hash: "fc5f2c24e3d8743ab5b20aaa122bacc2" + } + Frame { + msec: 2464 + hash: "201b9ee6c9ac6208ef812fe2e95020ef" + } + Frame { + msec: 2480 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2496 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2512 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2528 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2544 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2560 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2576 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2592 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2608 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2624 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2640 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2656 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2672 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2688 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2704 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2720 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2736 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2752 + hash: "213811853dbefdc418099721e3bf8651" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 87; y: 114 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2768 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2784 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2800 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2816 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2832 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2848 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 2864 + hash: "213811853dbefdc418099721e3bf8651" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 87; y: 114 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 2880 + image: "reanchor.2.png" + } + Frame { + msec: 2896 + hash: "c2d6dd91f3e9cdcacbadcb449c8a9896" + } + Frame { + msec: 2912 + hash: "1098ea19aecebd71208e101d522c1981" + } + Frame { + msec: 2928 + hash: "8cc59c20d796c073038518d2855fb6f0" + } + Frame { + msec: 2944 + hash: "914a89d0cfdc68145024ce2305a5e76e" + } + Frame { + msec: 2960 + hash: "7a2e3ca2660df24d9a6ec49a7422ebe1" + } + Frame { + msec: 2976 + hash: "b71496d986d5f0aa76b4f1663627f1f7" + } + Frame { + msec: 2992 + hash: "41b29a523db919bc0a4e0a9a88bfc873" + } + Frame { + msec: 3008 + hash: "97632a0de766b9ffbf71f21eeb0ff9a2" + } + Frame { + msec: 3024 + hash: "94cc196e62c150008461ff9996b4cae8" + } + Frame { + msec: 3040 + hash: "32e96ad2d15fa2386d365ab249ddf4f4" + } + Frame { + msec: 3056 + hash: "209394314f971b12fbc61ca45010cc62" + } + Frame { + msec: 3072 + hash: "b917c2684dda8af00278b34ababdcf5c" + } + Frame { + msec: 3088 + hash: "92b506860c1c5dc52f87c24c89921b05" + } + Frame { + msec: 3104 + hash: "7b7e96113fa9359954be9b3ac87943c3" + } + Frame { + msec: 3120 + hash: "42bc69db42c5df902038cec414246ec5" + } + Frame { + msec: 3136 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3152 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3168 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3184 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3200 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3216 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3232 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3248 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3264 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3280 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3296 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3312 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3328 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3344 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3360 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 87; y: 114 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3376 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3392 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3408 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3424 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3440 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3456 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3472 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 87; y: 114 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 3488 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 3504 + hash: "2d1aa011f2008a6147ba593e3cf272d7" + } + Frame { + msec: 3520 + hash: "206699ea84ce9fd60c1603b7a48a5134" + } + Frame { + msec: 3536 + hash: "68eb6df93a2b6db7023f7c3cc71d5b5f" + } + Frame { + msec: 3552 + hash: "5a4cd0620959dde92eeeaaa4dcd13091" + } + Frame { + msec: 3568 + hash: "17b763187a777253b25b22f5dd7253ae" + } + Frame { + msec: 3584 + hash: "1de9dcf4d385266f4482e2d0967d9119" + } + Frame { + msec: 3600 + hash: "833496add6dbc3103a28a47e453a738b" + } + Frame { + msec: 3616 + hash: "b3bab2e9c56db60cd54e68369e6b790d" + } + Frame { + msec: 3632 + hash: "ee91c6cd909bec401a1a7eebd10b8b02" + } + Frame { + msec: 3648 + hash: "0ed679ad0ab7bd3544947bccda88647b" + } + Frame { + msec: 3664 + hash: "d7dfcdc8a4233821919f1732d8c39712" + } + Frame { + msec: 3680 + hash: "c52829ee689e4c312a9dff8dbd4a79f9" + } + Frame { + msec: 3696 + hash: "7962badda0e80a61b67943d3b31f892d" + } + Frame { + msec: 3712 + hash: "fc5f2c24e3d8743ab5b20aaa122bacc2" + } + Frame { + msec: 3728 + hash: "201b9ee6c9ac6208ef812fe2e95020ef" + } + Frame { + msec: 3744 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 3760 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 3776 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 3792 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 3808 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 3824 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 3840 + image: "reanchor.3.png" + } + Frame { + msec: 3856 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 3872 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 3888 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 3904 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 3920 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 3936 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 3952 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 3968 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 3984 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4000 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4016 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4032 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4048 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4064 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4080 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4096 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4112 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4128 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4144 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4160 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4176 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4192 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4208 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4224 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4240 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4256 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4272 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4288 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4304 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4320 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4336 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4352 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4368 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4384 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4400 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4416 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4432 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4448 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4464 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4480 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4496 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4512 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4528 + hash: "213811853dbefdc418099721e3bf8651" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 174; y: 174 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4544 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4560 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4576 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4592 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4608 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4624 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4640 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4656 + hash: "213811853dbefdc418099721e3bf8651" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 174; y: 174 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 4672 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 4688 + hash: "5d38bf4a033de31985ae9989107908af" + } + Frame { + msec: 4704 + hash: "ed1bd2abd42848ecd07f0f0654c2b80f" + } + Frame { + msec: 4720 + hash: "588de6662123733303d93f62c6481f6a" + } + Frame { + msec: 4736 + hash: "aae79c2fbb2fd1ac7efa9802bff40f95" + } + Frame { + msec: 4752 + hash: "f17512798136f67f25aaa0aeb60678e1" + } + Frame { + msec: 4768 + hash: "79578a1e0e3e9cd45c210d0c5d3e75d6" + } + Frame { + msec: 4784 + hash: "5dad4ff201744cda6ff41f89414c8d11" + } + Frame { + msec: 4800 + image: "reanchor.4.png" + } + Frame { + msec: 4816 + hash: "c4559982aa3f3d291364deed4bd96d65" + } + Frame { + msec: 4832 + hash: "0dff03ea9154bdb2a813358b04cfbde9" + } + Frame { + msec: 4848 + hash: "09bdf2869dee1c0cbe3c8c2e9254580b" + } + Frame { + msec: 4864 + hash: "ba7762978bbd63d624029910fe16fb6d" + } + Frame { + msec: 4880 + hash: "f00d198ab8f4f625b60e9e2071d8adfd" + } + Frame { + msec: 4896 + hash: "adcec9c9a5b0d60cf45b2915365ea09c" + } + Frame { + msec: 4912 + hash: "a65cd6fbb26d618692ef23148015a4f2" + } + Frame { + msec: 4928 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 4944 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 4960 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 4976 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 4992 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5008 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5024 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5040 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5056 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5072 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5088 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5104 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5120 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5136 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5152 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5168 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5184 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5200 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5216 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5232 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5248 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5264 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5280 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5296 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5312 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5328 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5344 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5360 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5376 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5392 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5408 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5424 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5440 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5456 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5472 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5488 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5504 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5520 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5536 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5552 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5568 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5584 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5600 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5616 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5632 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5648 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5664 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5680 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5696 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5712 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5728 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5744 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5760 + image: "reanchor.5.png" + } + Frame { + msec: 5776 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5792 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5808 + hash: "1137e22c68e043950811dee295e19b04" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 95; y: 78 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5824 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5840 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5856 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5872 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5888 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5904 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5920 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5936 + hash: "1137e22c68e043950811dee295e19b04" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 95; y: 78 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 5952 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 5968 + hash: "103bbc9ce594851f5243b103f8fef1c1" + } + Frame { + msec: 5984 + hash: "c381148b052be2e6244f24c2292b89cf" + } + Frame { + msec: 6000 + hash: "2fda1d635fa47bff7de867df3dadfb4f" + } + Frame { + msec: 6016 + hash: "4d35e00af33ad5dc84998cda2d066b4e" + } + Frame { + msec: 6032 + hash: "14005d52d372acf6d3495f69bbf00b7d" + } + Frame { + msec: 6048 + hash: "29728f64d12e858d960c4e197824ef43" + } + Frame { + msec: 6064 + hash: "798822f0c20ef87cb01fe1dcd76c7585" + } + Frame { + msec: 6080 + hash: "4cdeea0f91587ef32a2c2e282f6d00e6" + } + Frame { + msec: 6096 + hash: "08ca5d16771e58da6cdd20b86dc65f03" + } + Frame { + msec: 6112 + hash: "e9aeb432709d275048ad9d84fb21db1a" + } + Frame { + msec: 6128 + hash: "3b642f27d356fd1815dc50f8e750623d" + } + Frame { + msec: 6144 + hash: "7c1db0ec278849ec044ea0aa3383075b" + } + Frame { + msec: 6160 + hash: "da902850879c95d4ddffbb1ba0060f25" + } + Frame { + msec: 6176 + hash: "e4053bd0db7752e7a47e096da645b69b" + } + Frame { + msec: 6192 + hash: "aabbb6d34399818347db265151a547b7" + } + Frame { + msec: 6208 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6224 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6240 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6256 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6272 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6288 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6304 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6320 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6336 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6352 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6368 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6384 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6400 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6416 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6432 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6448 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6464 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6480 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6496 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6512 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6528 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6544 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6560 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6576 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6592 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6608 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6624 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6640 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6656 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6672 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6688 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6704 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6720 + image: "reanchor.6.png" + } + Frame { + msec: 6736 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6752 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6768 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6784 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6800 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6816 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6832 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6848 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6864 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6880 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6896 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6912 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6928 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6944 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6960 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6976 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 6992 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7008 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7024 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7040 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7056 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7072 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7088 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7104 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7120 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7136 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7152 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7168 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7184 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7200 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7216 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7232 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7248 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7264 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7280 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7296 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7312 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7328 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7344 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7360 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7376 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7392 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7408 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7424 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7440 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7456 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7472 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7488 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7504 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7520 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7536 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7552 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7568 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7584 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7600 + hash: "213811853dbefdc418099721e3bf8651" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 86; y: 136 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7616 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7632 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7648 + hash: "213811853dbefdc418099721e3bf8651" + } + Frame { + msec: 7664 + hash: "213811853dbefdc418099721e3bf8651" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 86; y: 136 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 7680 + image: "reanchor.7.png" + } + Frame { + msec: 7696 + hash: "c2d6dd91f3e9cdcacbadcb449c8a9896" + } + Frame { + msec: 7712 + hash: "1098ea19aecebd71208e101d522c1981" + } + Frame { + msec: 7728 + hash: "8cc59c20d796c073038518d2855fb6f0" + } + Frame { + msec: 7744 + hash: "914a89d0cfdc68145024ce2305a5e76e" + } + Frame { + msec: 7760 + hash: "7a2e3ca2660df24d9a6ec49a7422ebe1" + } + Frame { + msec: 7776 + hash: "b71496d986d5f0aa76b4f1663627f1f7" + } + Frame { + msec: 7792 + hash: "41b29a523db919bc0a4e0a9a88bfc873" + } + Frame { + msec: 7808 + hash: "97632a0de766b9ffbf71f21eeb0ff9a2" + } + Frame { + msec: 7824 + hash: "94cc196e62c150008461ff9996b4cae8" + } + Frame { + msec: 7840 + hash: "32e96ad2d15fa2386d365ab249ddf4f4" + } + Frame { + msec: 7856 + hash: "209394314f971b12fbc61ca45010cc62" + } + Frame { + msec: 7872 + hash: "b917c2684dda8af00278b34ababdcf5c" + } + Frame { + msec: 7888 + hash: "92b506860c1c5dc52f87c24c89921b05" + } + Frame { + msec: 7904 + hash: "7b7e96113fa9359954be9b3ac87943c3" + } + Frame { + msec: 7920 + hash: "42bc69db42c5df902038cec414246ec5" + } + Frame { + msec: 7936 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 7952 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 7968 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 7984 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8000 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8016 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8032 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8048 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8064 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8080 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8096 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8112 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8128 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8144 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8160 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8176 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8192 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8208 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8224 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8240 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8256 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8272 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8288 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8304 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8320 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8336 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8352 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8368 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8384 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8400 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Mouse { + type: 2 + button: 1 + buttons: 1 + x: 177; y: 173 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8416 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8432 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8448 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8464 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8480 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8496 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8512 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Mouse { + type: 3 + button: 1 + buttons: 0 + x: 177; y: 173 + modifiers: 0 + sendToViewport: true + } + Frame { + msec: 8528 + hash: "7eb4027421fd6aa7d668a704e40a6e61" + } + Frame { + msec: 8544 + hash: "b4f30663a9b21e42375645e970f57d0b" + } + Frame { + msec: 8560 + hash: "6c12dbf4af8801573515b61123d4b1d7" + } + Frame { + msec: 8576 + hash: "facc61397c734bb4409d5664dc059a14" + } + Frame { + msec: 8592 + hash: "897e15e37276454d11fac6a528e967a6" + } + Frame { + msec: 8608 + hash: "cf8173519f1e042c227ff61c62308640" + } + Frame { + msec: 8624 + hash: "d0fcda14ea4bcfebf04ccf99e292ac6a" + } + Frame { + msec: 8640 + image: "reanchor.8.png" + } + Frame { + msec: 8656 + hash: "74b4ababa97def538f5340e88a4419a4" + } + Frame { + msec: 8672 + hash: "b96b5b64505b1814ddd42a52569d7fd9" + } + Frame { + msec: 8688 + hash: "0e3e07aad030b2075c4bc61b02ebe49e" + } + Frame { + msec: 8704 + hash: "c5eebc652c58e3a44d5ed481100ef242" + } + Frame { + msec: 8720 + hash: "d4a74185304c126739af728ddda40e0c" + } + Frame { + msec: 8736 + hash: "448572d3c1060b8311952429a7f9430d" + } + Frame { + msec: 8752 + hash: "00f64c09657a8afd6caa186efb6ad860" + } + Frame { + msec: 8768 + hash: "2a360e6feaaf303e9ee63145085796e6" + } + Frame { + msec: 8784 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 8800 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 8816 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 8832 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 8848 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 8864 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 8880 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 8896 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 8912 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 8928 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 8944 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 8960 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 8976 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 8992 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 9008 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 9024 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 9040 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 9056 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 9072 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 9088 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 9104 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 9120 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 9136 + hash: "1137e22c68e043950811dee295e19b04" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 9152 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 9168 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 9184 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 9200 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 9216 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 9232 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 9248 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 9264 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 9280 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 9296 + hash: "1137e22c68e043950811dee295e19b04" + } + Frame { + msec: 9312 + hash: "1137e22c68e043950811dee295e19b04" + } +} diff --git a/tests/auto/declarative/visual/animation/reanchor/reanchor.qml b/tests/auto/declarative/visual/animation/reanchor/reanchor.qml new file mode 100644 index 0000000..1cc68a9 --- /dev/null +++ b/tests/auto/declarative/visual/animation/reanchor/reanchor.qml @@ -0,0 +1,68 @@ +import Qt 4.6 + +Rectangle { + id: container + width: 200; height: 200 + Rectangle { + id: myRect + objectName: "MyRect" + color: "green"; + anchors.left: parent.left + anchors.right: rightGuideline.left + anchors.top: topGuideline.top + anchors.bottom: container.bottom + } + Item { id: leftGuideline; x: 10 } + Item { id: rightGuideline; x: 150 } + Item { id: topGuideline; y: 10 } + Item { id: bottomGuideline; y: 150 } + Item { id: topGuideline2; y: 50 } + Item { id: bottomGuideline2; y: 175 } + + MouseRegion { + id: wholeArea + anchors.fill: parent + onClicked: { + if (container.state == "") { + container.state = "reanchored"; + } else if (container.state == "reanchored") { + container.state = "reanchored2"; + } else if (container.state == "reanchored2") + container.state = "reanchored"; + } + } + + states: [ State { + name: "reanchored" + AnchorChanges { + target: myRect; + left: leftGuideline.left + right: container.right + top: container.top + bottom: bottomGuideline.bottom + } + }, State { + name: "reanchored2" + AnchorChanges { + target: myRect; + reset: "left, right" + top: topGuideline2.top + bottom: bottomGuideline2.bottom + } + }] + + transitions: Transition { + NumberAnimation { matchProperties: "x,y,width,height" } + } + + MouseRegion { + width: 50; height: 50 + anchors.right: parent.right + anchors.bottom: parent.bottom + onClicked: { + container.state = ""; + } + } + + state: "reanchored" +} |