From b2f9f3f2157629eae2544cf6fa2215b26e4e5a84 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 6 Nov 2009 13:49:08 +1000 Subject: Test more anchors. --- tests/auto/declarative/anchors/data/anchors.qml | 27 +++++++++++++++++++++++++ tests/auto/declarative/anchors/tst_anchors.cpp | 16 +++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/tests/auto/declarative/anchors/data/anchors.qml b/tests/auto/declarative/anchors/data/anchors.qml index 377dd2d..765e5b6 100644 --- a/tests/auto/declarative/anchors/data/anchors.qml +++ b/tests/auto/declarative/anchors/data/anchors.qml @@ -114,4 +114,31 @@ Rectangle { y: 70; width: 10; height: 10 anchors.horizontalCenter: parent.left } + Rectangle { + id: Rect22; objectName: "Rect22" + width: 10; height: 10 + anchors.centerIn: MasterRect + } + Rectangle { + id: Rect23; objectName: "Rect23" + anchors.left: MasterRect.left + anchors.leftMargin: 5 + anchors.right: MasterRect.right + anchors.rightMargin: 5 + anchors.top: MasterRect.top + anchors.topMargin: 5 + anchors.bottom: MasterRect.bottom + anchors.bottomMargin: 5 + } + Text { + id: text1; objectName: "text1" + y: 200; + text: "Hello" + } + Text { + id: text2; objectName: "text2" + anchors.baseline: text1.baseline + anchors.left: text1.right + text: "World" + } } diff --git a/tests/auto/declarative/anchors/tst_anchors.cpp b/tests/auto/declarative/anchors/tst_anchors.cpp index 8abf04f..c3a857c 100644 --- a/tests/auto/declarative/anchors/tst_anchors.cpp +++ b/tests/auto/declarative/anchors/tst_anchors.cpp @@ -43,6 +43,7 @@ #include #include #include +#include #include @@ -131,6 +132,21 @@ void tst_anchors::basicAnchors() QCOMPARE(findItem(view->root(), QLatin1String("Rect20"))->x(), 235.0); QCOMPARE(findItem(view->root(), QLatin1String("Rect21"))->x(), -5.0); + //centerIn + QCOMPARE(findItem(view->root(), QLatin1String("Rect22"))->x(), 69.0); + QCOMPARE(findItem(view->root(), QLatin1String("Rect22"))->y(), 5.0); + + //margins + QCOMPARE(findItem(view->root(), QLatin1String("Rect23"))->x(), 31.0); + QCOMPARE(findItem(view->root(), QLatin1String("Rect23"))->y(), 5.0); + QCOMPARE(findItem(view->root(), QLatin1String("Rect23"))->width(), 86.0); + QCOMPARE(findItem(view->root(), QLatin1String("Rect23"))->height(), 10.0); + + //baseline + QmlGraphicsText *text1 = findItem(view->root(), QLatin1String("text1")); + QmlGraphicsText *text2 = findItem(view->root(), QLatin1String("text2")); + QCOMPARE(text1->y(), text2->y()); + delete view; } -- cgit v0.12 From 74d768ec05d5acfa8ef5b65535c908f2935f2783 Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 6 Nov 2009 14:04:45 +1000 Subject: move ListView state to correct directory --- tests/auto/declarative/declarative.pro | 2 +- .../listview/data/listview-enforcerange.qml | 55 -- .../listview/data/listview-sections.qml | 59 -- tests/auto/declarative/listview/data/listview.qml | 46 -- tests/auto/declarative/listview/listview.pro | 8 - tests/auto/declarative/listview/tst_listview.cpp | 853 --------------------- .../data/listview-enforcerange.qml | 55 ++ .../qmlgraphicslistview/data/listview-sections.qml | 59 ++ .../qmlgraphicslistview/data/listview.qml | 46 ++ .../qmlgraphicslistview/qmlgraphicslistview.pro | 8 + .../tst_qmlgraphicslistview.cpp | 853 +++++++++++++++++++++ 11 files changed, 1022 insertions(+), 1022 deletions(-) delete mode 100644 tests/auto/declarative/listview/data/listview-enforcerange.qml delete mode 100644 tests/auto/declarative/listview/data/listview-sections.qml delete mode 100644 tests/auto/declarative/listview/data/listview.qml delete mode 100644 tests/auto/declarative/listview/listview.pro delete mode 100644 tests/auto/declarative/listview/tst_listview.cpp create mode 100644 tests/auto/declarative/qmlgraphicslistview/data/listview-enforcerange.qml create mode 100644 tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml create mode 100644 tests/auto/declarative/qmlgraphicslistview/data/listview.qml create mode 100644 tests/auto/declarative/qmlgraphicslistview/qmlgraphicslistview.pro create mode 100644 tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 82b135f..64672f6 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -7,7 +7,7 @@ SUBDIRS += \ datetimeformatter \ # Cover examples \ layouts \ # Cover - listview \ # Cover + qmlgraphicslistview \ # Cover qmlgraphicsgridview \ # Cover numberformatter \ # Cover pathview \ # Cover diff --git a/tests/auto/declarative/listview/data/listview-enforcerange.qml b/tests/auto/declarative/listview/data/listview-enforcerange.qml deleted file mode 100644 index 46fddae..0000000 --- a/tests/auto/declarative/listview/data/listview-enforcerange.qml +++ /dev/null @@ -1,55 +0,0 @@ -import Qt 4.6 - -Rectangle { - width: 240 - height: 320 - color: "#ffffff" - Component { - id: myDelegate - Item { - id: wrapper - objectName: "wrapper" - height: 20 - width: 240 - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 120 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - x: 200 - text: wrapper.y - } - } - } - - Component { - id: myHighlight - Rectangle { - color: "lightsteelblue" - } - } - - ListView { - id: list - objectName: "list" - width: 240 - height: 320 - model: testModel - delegate: myDelegate - highlight: myHighlight - preferredHighlightBegin: 100 - preferredHighlightEnd: 100 - highlightRangeMode: "StrictlyEnforceRange" - } -} diff --git a/tests/auto/declarative/listview/data/listview-sections.qml b/tests/auto/declarative/listview/data/listview-sections.qml deleted file mode 100644 index 56700be..0000000 --- a/tests/auto/declarative/listview/data/listview-sections.qml +++ /dev/null @@ -1,59 +0,0 @@ -import Qt 4.6 - -Rectangle { - width: 240 - height: 320 - color: "#ffffff" - resources: [ - Component { - id: myDelegate - Item { - id: wrapper - objectName: "wrapper" - height: ListView.prevSection != ListView.section ? 40 : 20; - width: 240 - Rectangle { - y: wrapper.ListView.prevSection != wrapper.ListView.section ? 20 : 0 - height: 20 - width: parent.width - color: wrapper.ListView.isCurrentItem ? "lightsteelblue" : "white" - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 120 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - x: 200 - text: wrapper.y - } - } - Rectangle { - color: "#99bb99" - height: wrapper.ListView.prevSection != wrapper.ListView.section ? 20 : 0 - width: parent.width - visible: wrapper.ListView.prevSection != wrapper.ListView.section ? true : false - Text { text: wrapper.ListView.section } - } - } - } - ] - ListView { - id: list - objectName: "list" - width: 240 - height: 320 - model: testModel - delegate: myDelegate - sectionExpression: "Math.floor(index/5)" - } -} diff --git a/tests/auto/declarative/listview/data/listview.qml b/tests/auto/declarative/listview/data/listview.qml deleted file mode 100644 index b7b838b..0000000 --- a/tests/auto/declarative/listview/data/listview.qml +++ /dev/null @@ -1,46 +0,0 @@ -import Qt 4.6 - -Rectangle { - width: 240 - height: 320 - color: "#ffffff" - resources: [ - Component { - id: myDelegate - Rectangle { - id: wrapper - objectName: "wrapper" - height: 20 - width: 240 - Text { - text: index - } - Text { - x: 30 - id: textName - objectName: "textName" - text: name - } - Text { - x: 120 - id: textNumber - objectName: "textNumber" - text: number - } - Text { - x: 200 - text: wrapper.y - } - color: ListView.isCurrentItem ? "lightsteelblue" : "white" - } - } - ] - ListView { - id: list - objectName: "list" - width: 240 - height: 320 - model: testModel - delegate: myDelegate - } -} diff --git a/tests/auto/declarative/listview/listview.pro b/tests/auto/declarative/listview/listview.pro deleted file mode 100644 index 23b0706..0000000 --- a/tests/auto/declarative/listview/listview.pro +++ /dev/null @@ -1,8 +0,0 @@ -load(qttest_p4) -contains(QT_CONFIG,declarative): QT += declarative -macx:CONFIG -= app_bundle - -SOURCES += tst_listview.cpp - -# Define SRCDIR equal to test's source directory -DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/listview/tst_listview.cpp b/tests/auto/declarative/listview/tst_listview.cpp deleted file mode 100644 index 5575ace..0000000 --- a/tests/auto/declarative/listview/tst_listview.cpp +++ /dev/null @@ -1,853 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include -#include -#include -#include -#include -#include -#include - -class tst_QmlGraphicsListView : public QObject -{ - Q_OBJECT -public: - tst_QmlGraphicsListView(); - -private slots: - // Test both QListModelInterface and QAbstractItemModel model types - void qListModelInterface_items(); - void qAbstractItemModel_items(); - - void qListModelInterface_changed(); - void qAbstractItemModel_changed(); - - void qListModelInterface_inserted(); - void qAbstractItemModel_inserted(); - - void qListModelInterface_removed(); - void qAbstractItemModel_removed(); - - void qListModelInterface_moved(); - void qAbstractItemModel_moved(); - - void enforceRange(); - void spacing(); - void sections(); - -private: - template void items(); - template void changed(); - template void inserted(); - template void removed(); - template void moved(); - QmlView *createView(const QString &filename); - template - T *findItem(QmlGraphicsItem *parent, const QString &id, int index=-1); - template - QList findItems(QmlGraphicsItem *parent, const QString &objectName); -}; - -class TestModel : public QListModelInterface -{ - Q_OBJECT -public: - TestModel(QObject *parent = 0) : QListModelInterface(parent) {} - ~TestModel() {} - - enum Roles { Name, Number }; - - QString name(int index) const { return list.at(index).first; } - QString number(int index) const { return list.at(index).second; } - - int count() const { return list.count(); } - - QList roles() const { return QList() << Name << Number; } - QString toString(int role) const { - switch(role) { - case Name: - return "name"; - case Number: - return "number"; - default: - return ""; - } - } - - QHash data(int index, const QList &roles) const { - QHash returnHash; - - for (int i = 0; i < roles.size(); ++i) { - int role = roles.at(i); - QVariant info; - switch(role) { - case Name: - info = list.at(index).first; - break; - case Number: - info = list.at(index).second; - break; - default: - break; - } - returnHash.insert(role, info); - } - return returnHash; - } - - void addItem(const QString &name, const QString &number) { - list.append(QPair(name, number)); - emit itemsInserted(list.count()-1, 1); - } - - void insertItem(int index, const QString &name, const QString &number) { - list.insert(index, QPair(name, number)); - emit itemsInserted(index, 1); - } - - void removeItem(int index) { - list.removeAt(index); - emit itemsRemoved(index, 1); - } - - void moveItem(int from, int to) { - list.move(from, to); - emit itemsMoved(from, to, 1); - } - - void modifyItem(int index, const QString &name, const QString &number) { - list[index] = QPair(name, number); - emit itemsChanged(index, 1, roles()); - } - -private: - QList > list; -}; - - -class TestModel2 : public QAbstractListModel -{ -public: - enum Roles { Name = Qt::UserRole+1, Number = Qt::UserRole+2 }; - - TestModel2(QObject *parent=0) : QAbstractListModel(parent) { - QHash roles; - roles[Name] = "name"; - roles[Number] = "number"; - setRoleNames(roles); - } - - int rowCount(const QModelIndex &parent=QModelIndex()) const { return list.count(); } - QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const { - QVariant rv; - if (role == Name) - rv = list.at(index.row()).first; - else if (role == Number) - rv = list.at(index.row()).second; - - return rv; - } - - int count() const { return rowCount(); } - QString name(int index) const { return list.at(index).first; } - QString number(int index) const { return list.at(index).second; } - - void addItem(const QString &name, const QString &number) { - emit beginInsertRows(QModelIndex(), list.count(), list.count()); - list.append(QPair(name, number)); - emit endInsertRows(); - } - - void insertItem(int index, const QString &name, const QString &number) { - emit beginInsertRows(QModelIndex(), index, index); - list.insert(index, QPair(name, number)); - emit endInsertRows(); - } - - void removeItem(int index) { - emit beginRemoveRows(QModelIndex(), index, index); - list.removeAt(index); - emit endRemoveRows(); - } - - void moveItem(int from, int to) { - emit beginMoveRows(QModelIndex(), from, from, QModelIndex(), to); - list.move(from, to); - emit endMoveRows(); - } - - void modifyItem(int idx, const QString &name, const QString &number) { - list[idx] = QPair(name, number); - emit dataChanged(index(idx,0), index(idx,0)); - } - -private: - QList > list; -}; - -tst_QmlGraphicsListView::tst_QmlGraphicsListView() -{ -} - -template -void tst_QmlGraphicsListView::items() -{ - QmlView *canvas = createView(SRCDIR "/data/listview.qml"); - - T model; - model.addItem("Fred", "12345"); - model.addItem("John", "2345"); - model.addItem("Bob", "54321"); - - QmlContext *ctxt = canvas->rootContext(); - ctxt->setContextProperty("testModel", &model); - - canvas->execute(); - qApp->processEvents(); - - QmlGraphicsListView *listview = findItem(canvas->root(), "list"); - QVERIFY(listview != 0); - - QmlGraphicsItem *viewport = listview->viewport(); - QVERIFY(viewport != 0); - - QCOMPARE(listview->count(), model.count()); - QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item - - for (int i = 0; i < model.count(); ++i) { - QmlGraphicsText *name = findItem(viewport, "textName", i); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(i)); - QmlGraphicsText *number = findItem(viewport, "textNumber", i); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(i)); - } - - listview->incrementCurrentIndex(); - QCOMPARE(listview->currentIndex(), 1); - listview->decrementCurrentIndex(); - QCOMPARE(listview->currentIndex(), 0); - - // set an empty model and confirm that items are destroyed - T model2; - ctxt->setContextProperty("testModel", &model2); - - int itemCount = findItems(viewport, "wrapper").count(); - QVERIFY(itemCount == 0); - - delete canvas; -} - -template -void tst_QmlGraphicsListView::changed() -{ - QmlView *canvas = createView(SRCDIR "/data/listview.qml"); - - T model; - model.addItem("Fred", "12345"); - model.addItem("John", "2345"); - model.addItem("Bob", "54321"); - - QmlContext *ctxt = canvas->rootContext(); - ctxt->setContextProperty("testModel", &model); - - canvas->execute(); - qApp->processEvents(); - - QmlGraphicsFlickable *listview = findItem(canvas->root(), "list"); - QVERIFY(listview != 0); - - QmlGraphicsItem *viewport = listview->viewport(); - QVERIFY(viewport != 0); - - model.modifyItem(1, "Will", "9876"); - QmlGraphicsText *name = findItem(viewport, "textName", 1); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(1)); - QmlGraphicsText *number = findItem(viewport, "textNumber", 1); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(1)); - - delete canvas; -} - -template -void tst_QmlGraphicsListView::inserted() -{ - QmlView *canvas = createView(SRCDIR "/data/listview.qml"); - - T model; - model.addItem("Fred", "12345"); - model.addItem("John", "2345"); - model.addItem("Bob", "54321"); - - QmlContext *ctxt = canvas->rootContext(); - ctxt->setContextProperty("testModel", &model); - - canvas->execute(); - qApp->processEvents(); - - QmlGraphicsListView *listview = findItem(canvas->root(), "list"); - QVERIFY(listview != 0); - - QmlGraphicsItem *viewport = listview->viewport(); - QVERIFY(viewport != 0); - - model.insertItem(1, "Will", "9876"); - - // let transitions settle. - QTest::qWait(1000); - - QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item - - QmlGraphicsText *name = findItem(viewport, "textName", 1); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(1)); - QmlGraphicsText *number = findItem(viewport, "textNumber", 1); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(1)); - - // Confirm items positioned correctly - for (int i = 0; i < model.count(); ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - QVERIFY(item->y() == i*20); - } - - model.insertItem(0, "Foo", "1111"); // zero index, and current item - - // let transitions settle. - QTest::qWait(1000); - - QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item - - name = findItem(viewport, "textName", 0); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(0)); - number = findItem(viewport, "textNumber", 0); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(0)); - - QCOMPARE(listview->currentIndex(), 1); - - // Confirm items positioned correctly - for (int i = 0; i < model.count(); ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - QVERIFY(item->y() == i*20); - } - - for (int i = model.count(); i < 30; ++i) - model.insertItem(i, "Hello", QString::number(i)); - QTest::qWait(1000); - - listview->setViewportY(80); - QTest::qWait(1000); - - // Insert item outside visible area - model.insertItem(1, "Hello", "1324"); - QTest::qWait(1000); - - QVERIFY(listview->viewportY() == 80); - - // Confirm items positioned correctly - int itemCount = findItems(viewport, "wrapper").count() - 1; - for (int i = 5; i < 5+itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - QVERIFY(item->y() == i*20 - 20); - } - - delete canvas; -} - -template -void tst_QmlGraphicsListView::removed() -{ - QmlView *canvas = createView(SRCDIR "/data/listview.qml"); - - T model; - for (int i = 0; i < 30; i++) - model.addItem("Item" + QString::number(i), ""); - - QmlContext *ctxt = canvas->rootContext(); - ctxt->setContextProperty("testModel", &model); - - canvas->execute(); - qApp->processEvents(); - - QmlGraphicsListView *listview = findItem(canvas->root(), "list"); - QVERIFY(listview != 0); - - QmlGraphicsItem *viewport = listview->viewport(); - QVERIFY(viewport != 0); - - model.removeItem(1); - - // let transitions settle. - QTest::qWait(1000); - - QmlGraphicsText *name = findItem(viewport, "textName", 1); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(1)); - QmlGraphicsText *number = findItem(viewport, "textNumber", 1); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(1)); - - // Confirm items positioned correctly - int itemCount = findItems(viewport, "wrapper").count(); - for (int i = 0; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QVERIFY(item->y() == i*20); - } - - // Remove first item (which is the current item); - model.removeItem(0); // post: top item starts at 20 - - // let transitions settle. - QTest::qWait(1000); - - name = findItem(viewport, "textName", 0); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(0)); - number = findItem(viewport, "textNumber", 0); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(0)); - - // Confirm items positioned correctly - itemCount = findItems(viewport, "wrapper").count(); - for (int i = 0; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QCOMPARE(item->y(),i*20.0 + 20.0); - } - - // Remove items not visible - model.removeItem(18); - // let transitions settle. - QTest::qWait(1000); - - // Confirm items positioned correctly - itemCount = findItems(viewport, "wrapper").count(); - for (int i = 0; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QCOMPARE(item->y(),i*20.0+20.0); - } - - // Remove items before visible - listview->setViewportY(80); - listview->setCurrentIndex(10); - - model.removeItem(1); // post: top item will be at 40 - // let transitions settle. - QTest::qWait(1000); - - // Confirm items positioned correctly - for (int i = 2; i < 18; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QCOMPARE(item->y(),40+i*20.0); - } - - listview->setViewportY(40); // That's the top now - // let transitions settle. - QTest::qWait(1000); - - // Confirm items positioned correctly - itemCount = findItems(viewport, "wrapper").count(); - for (int i = 0; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QCOMPARE(item->y(),40+i*20.0); - } - - delete canvas; -} - -template -void tst_QmlGraphicsListView::moved() -{ - QmlView *canvas = createView(SRCDIR "/data/listview.qml"); - - T model; - for (int i = 0; i < 30; i++) - model.addItem("Item" + QString::number(i), ""); - - QmlContext *ctxt = canvas->rootContext(); - ctxt->setContextProperty("testModel", &model); - - canvas->execute(); - qApp->processEvents(); - - QmlGraphicsListView *listview = findItem(canvas->root(), "list"); - QVERIFY(listview != 0); - - QmlGraphicsItem *viewport = listview->viewport(); - QVERIFY(viewport != 0); - - model.moveItem(1, 4); - - // let transitions settle. - QTest::qWait(1000); - - QmlGraphicsText *name = findItem(viewport, "textName", 1); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(1)); - QmlGraphicsText *number = findItem(viewport, "textNumber", 1); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(1)); - - name = findItem(viewport, "textName", 4); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(4)); - number = findItem(viewport, "textNumber", 4); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(4)); - - // Confirm items positioned correctly - int itemCount = findItems(viewport, "wrapper").count(); - for (int i = 0; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QVERIFY(item->y() == i*20); - } - - listview->setViewportY(80); - - // move outside visible area - model.moveItem(1, 18); - - // let transitions settle. - QTest::qWait(1000); - - // Confirm items positioned correctly and indexes correct - for (int i = 3; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QVERIFY(item->y() == i*20 + 20); - name = findItem(viewport, "textName", i); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(i)); - number = findItem(viewport, "textNumber", i); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(i)); - } - - // move from outside visible into visible - model.moveItem(20, 4); - - // let transitions settle. - QTest::qWait(1000); - - // Confirm items positioned correctly and indexes correct - for (int i = 3; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QVERIFY(item->y() == i*20 + 20); - name = findItem(viewport, "textName", i); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(i)); - number = findItem(viewport, "textNumber", i); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(i)); - } - - delete canvas; -} - -void tst_QmlGraphicsListView::enforceRange() -{ - QmlView *canvas = createView(SRCDIR "/data/listview-enforcerange.qml"); - - TestModel model; - for (int i = 0; i < 30; i++) - model.addItem("Item" + QString::number(i), ""); - - QmlContext *ctxt = canvas->rootContext(); - ctxt->setContextProperty("testModel", &model); - - canvas->execute(); - qApp->processEvents(); - - QmlGraphicsListView *listview = findItem(canvas->root(), "list"); - QVERIFY(listview != 0); - - QmlGraphicsItem *viewport = listview->viewport(); - QVERIFY(viewport != 0); - - // view should be positioned at the top of the range. - QmlGraphicsItem *item = findItem(viewport, "wrapper", 0); - QVERIFY(item); - QCOMPARE(listview->viewportY(), -100.0); - - QmlGraphicsText *name = findItem(viewport, "textName", 0); - QVERIFY(name != 0); - QCOMPARE(name->text(), model.name(0)); - QmlGraphicsText *number = findItem(viewport, "textNumber", 0); - QVERIFY(number != 0); - QCOMPARE(number->text(), model.number(0)); - - // Check currentIndex is updated when viewport moves - listview->setViewportY(20); - QTest::qWait(1000); - - QCOMPARE(listview->currentIndex(), 6); - - delete canvas; -} - -void tst_QmlGraphicsListView::spacing() -{ - QmlView *canvas = createView(SRCDIR "/data/listview.qml"); - - TestModel model; - for (int i = 0; i < 30; i++) - model.addItem("Item" + QString::number(i), ""); - - QmlContext *ctxt = canvas->rootContext(); - ctxt->setContextProperty("testModel", &model); - - canvas->execute(); - qApp->processEvents(); - - QmlGraphicsListView *listview = findItem(canvas->root(), "list"); - QVERIFY(listview != 0); - - QmlGraphicsItem *viewport = listview->viewport(); - QVERIFY(viewport != 0); - - // Confirm items positioned correctly - int itemCount = findItems(viewport, "wrapper").count(); - for (int i = 0; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QVERIFY(item->y() == i*20); - } - - listview->setSpacing(10); - QVERIFY(listview->spacing() == 10); - - // Confirm items positioned correctly - itemCount = findItems(viewport, "wrapper").count(); - for (int i = 0; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QVERIFY(item->y() == i*30); - } - - listview->setSpacing(0); - - // Confirm items positioned correctly - itemCount = findItems(viewport, "wrapper").count(); - for (int i = 0; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - if (!item) qWarning() << "Item" << i << "not found"; - QVERIFY(item); - QVERIFY(item->y() == i*20); - } - - delete canvas; -} - -void tst_QmlGraphicsListView::sections() -{ - QmlView *canvas = createView(SRCDIR "/data/listview-sections.qml"); - - TestModel model; - for (int i = 0; i < 30; i++) - model.addItem("Item" + QString::number(i), ""); - - QmlContext *ctxt = canvas->rootContext(); - ctxt->setContextProperty("testModel", &model); - - canvas->execute(); - qApp->processEvents(); - - QmlGraphicsListView *listview = findItem(canvas->root(), "list"); - QVERIFY(listview != 0); - - QmlGraphicsItem *viewport = listview->viewport(); - QVERIFY(viewport != 0); - - // Confirm items positioned correctly - int itemCount = findItems(viewport, "wrapper").count(); - for (int i = 0; i < model.count() && i < itemCount; ++i) { - QmlGraphicsItem *item = findItem(viewport, "wrapper", i); - QVERIFY(item); - QCOMPARE(item->y(), qreal(i*20 + ((i+4)/5) * 20)); - } - - QVERIFY(listview->currentSection() == "0"); - - listview->setViewportY(140); - QVERIFY(listview->currentSection() == "1"); - - delete canvas; -} - -void tst_QmlGraphicsListView::qListModelInterface_items() -{ - items(); -} - -void tst_QmlGraphicsListView::qAbstractItemModel_items() -{ - items(); -} - -void tst_QmlGraphicsListView::qListModelInterface_changed() -{ - changed(); -} - -void tst_QmlGraphicsListView::qAbstractItemModel_changed() -{ - changed(); -} - -void tst_QmlGraphicsListView::qListModelInterface_inserted() -{ - inserted(); -} - -void tst_QmlGraphicsListView::qAbstractItemModel_inserted() -{ - inserted(); -} - -void tst_QmlGraphicsListView::qListModelInterface_removed() -{ - removed(); -} - -void tst_QmlGraphicsListView::qAbstractItemModel_removed() -{ - removed(); -} - -void tst_QmlGraphicsListView::qListModelInterface_moved() -{ - moved(); -} - -void tst_QmlGraphicsListView::qAbstractItemModel_moved() -{ - moved(); -} - - -QmlView *tst_QmlGraphicsListView::createView(const QString &filename) -{ - QmlView *canvas = new QmlView(0); - canvas->setFixedSize(240,320); - - QFile file(filename); - file.open(QFile::ReadOnly); - QString qml = file.readAll(); - canvas->setQml(qml, filename); - - return canvas; -} - -/* - Find an item with the specified objectName. If index is supplied then the - item must also evaluate the {index} expression equal to index -*/ -template -T *tst_QmlGraphicsListView::findItem(QmlGraphicsItem *parent, const QString &objectName, int index) -{ - const QMetaObject &mo = T::staticMetaObject; - //qDebug() << parent->QGraphicsObject::children().count() << "children"; - for (int i = 0; i < parent->QGraphicsObject::children().count(); ++i) { - QmlGraphicsItem *item = qobject_cast(parent->QGraphicsObject::children().at(i)); - if(!item) - continue; - //qDebug() << "try" << item; - if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { - if (index != -1) { - QmlExpression e(qmlContext(item), "index", item); - e.setTrackChange(false); - if (e.value().toInt() == index) - return static_cast(item); - } else { - return static_cast(item); - } - } - item = findItem(item, objectName, index); - if (item) - return static_cast(item); - } - - return 0; -} - -template -QList tst_QmlGraphicsListView::findItems(QmlGraphicsItem *parent, const QString &objectName) -{ - QList items; - const QMetaObject &mo = T::staticMetaObject; - //qDebug() << parent->QGraphicsObject::children().count() << "children"; - for (int i = 0; i < parent->QGraphicsObject::children().count(); ++i) { - QmlGraphicsItem *item = qobject_cast(parent->QGraphicsObject::children().at(i)); - if(!item) - continue; - //qDebug() << "try" << item; - if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) - items.append(static_cast(item)); - items += findItems(item, objectName); - } - - return items; -} - - -QTEST_MAIN(tst_QmlGraphicsListView) - -#include "tst_listview.moc" diff --git a/tests/auto/declarative/qmlgraphicslistview/data/listview-enforcerange.qml b/tests/auto/declarative/qmlgraphicslistview/data/listview-enforcerange.qml new file mode 100644 index 0000000..46fddae --- /dev/null +++ b/tests/auto/declarative/qmlgraphicslistview/data/listview-enforcerange.qml @@ -0,0 +1,55 @@ +import Qt 4.6 + +Rectangle { + width: 240 + height: 320 + color: "#ffffff" + Component { + id: myDelegate + Item { + id: wrapper + objectName: "wrapper" + height: 20 + width: 240 + Text { + text: index + } + Text { + x: 30 + id: textName + objectName: "textName" + text: name + } + Text { + x: 120 + id: textNumber + objectName: "textNumber" + text: number + } + Text { + x: 200 + text: wrapper.y + } + } + } + + Component { + id: myHighlight + Rectangle { + color: "lightsteelblue" + } + } + + ListView { + id: list + objectName: "list" + width: 240 + height: 320 + model: testModel + delegate: myDelegate + highlight: myHighlight + preferredHighlightBegin: 100 + preferredHighlightEnd: 100 + highlightRangeMode: "StrictlyEnforceRange" + } +} diff --git a/tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml b/tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml new file mode 100644 index 0000000..56700be --- /dev/null +++ b/tests/auto/declarative/qmlgraphicslistview/data/listview-sections.qml @@ -0,0 +1,59 @@ +import Qt 4.6 + +Rectangle { + width: 240 + height: 320 + color: "#ffffff" + resources: [ + Component { + id: myDelegate + Item { + id: wrapper + objectName: "wrapper" + height: ListView.prevSection != ListView.section ? 40 : 20; + width: 240 + Rectangle { + y: wrapper.ListView.prevSection != wrapper.ListView.section ? 20 : 0 + height: 20 + width: parent.width + color: wrapper.ListView.isCurrentItem ? "lightsteelblue" : "white" + Text { + text: index + } + Text { + x: 30 + id: textName + objectName: "textName" + text: name + } + Text { + x: 120 + id: textNumber + objectName: "textNumber" + text: number + } + Text { + x: 200 + text: wrapper.y + } + } + Rectangle { + color: "#99bb99" + height: wrapper.ListView.prevSection != wrapper.ListView.section ? 20 : 0 + width: parent.width + visible: wrapper.ListView.prevSection != wrapper.ListView.section ? true : false + Text { text: wrapper.ListView.section } + } + } + } + ] + ListView { + id: list + objectName: "list" + width: 240 + height: 320 + model: testModel + delegate: myDelegate + sectionExpression: "Math.floor(index/5)" + } +} diff --git a/tests/auto/declarative/qmlgraphicslistview/data/listview.qml b/tests/auto/declarative/qmlgraphicslistview/data/listview.qml new file mode 100644 index 0000000..b7b838b --- /dev/null +++ b/tests/auto/declarative/qmlgraphicslistview/data/listview.qml @@ -0,0 +1,46 @@ +import Qt 4.6 + +Rectangle { + width: 240 + height: 320 + color: "#ffffff" + resources: [ + Component { + id: myDelegate + Rectangle { + id: wrapper + objectName: "wrapper" + height: 20 + width: 240 + Text { + text: index + } + Text { + x: 30 + id: textName + objectName: "textName" + text: name + } + Text { + x: 120 + id: textNumber + objectName: "textNumber" + text: number + } + Text { + x: 200 + text: wrapper.y + } + color: ListView.isCurrentItem ? "lightsteelblue" : "white" + } + } + ] + ListView { + id: list + objectName: "list" + width: 240 + height: 320 + model: testModel + delegate: myDelegate + } +} diff --git a/tests/auto/declarative/qmlgraphicslistview/qmlgraphicslistview.pro b/tests/auto/declarative/qmlgraphicslistview/qmlgraphicslistview.pro new file mode 100644 index 0000000..f00de39 --- /dev/null +++ b/tests/auto/declarative/qmlgraphicslistview/qmlgraphicslistview.pro @@ -0,0 +1,8 @@ +load(qttest_p4) +contains(QT_CONFIG,declarative): QT += declarative +macx:CONFIG -= app_bundle + +SOURCES += tst_qmlgraphicslistview.cpp + +# Define SRCDIR equal to test's source directory +DEFINES += SRCDIR=\\\"$$PWD\\\" diff --git a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp new file mode 100644 index 0000000..5575ace --- /dev/null +++ b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp @@ -0,0 +1,853 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (qt-info@nokia.com) +** +** This file is part of the test suite of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include + +class tst_QmlGraphicsListView : public QObject +{ + Q_OBJECT +public: + tst_QmlGraphicsListView(); + +private slots: + // Test both QListModelInterface and QAbstractItemModel model types + void qListModelInterface_items(); + void qAbstractItemModel_items(); + + void qListModelInterface_changed(); + void qAbstractItemModel_changed(); + + void qListModelInterface_inserted(); + void qAbstractItemModel_inserted(); + + void qListModelInterface_removed(); + void qAbstractItemModel_removed(); + + void qListModelInterface_moved(); + void qAbstractItemModel_moved(); + + void enforceRange(); + void spacing(); + void sections(); + +private: + template void items(); + template void changed(); + template void inserted(); + template void removed(); + template void moved(); + QmlView *createView(const QString &filename); + template + T *findItem(QmlGraphicsItem *parent, const QString &id, int index=-1); + template + QList findItems(QmlGraphicsItem *parent, const QString &objectName); +}; + +class TestModel : public QListModelInterface +{ + Q_OBJECT +public: + TestModel(QObject *parent = 0) : QListModelInterface(parent) {} + ~TestModel() {} + + enum Roles { Name, Number }; + + QString name(int index) const { return list.at(index).first; } + QString number(int index) const { return list.at(index).second; } + + int count() const { return list.count(); } + + QList roles() const { return QList() << Name << Number; } + QString toString(int role) const { + switch(role) { + case Name: + return "name"; + case Number: + return "number"; + default: + return ""; + } + } + + QHash data(int index, const QList &roles) const { + QHash returnHash; + + for (int i = 0; i < roles.size(); ++i) { + int role = roles.at(i); + QVariant info; + switch(role) { + case Name: + info = list.at(index).first; + break; + case Number: + info = list.at(index).second; + break; + default: + break; + } + returnHash.insert(role, info); + } + return returnHash; + } + + void addItem(const QString &name, const QString &number) { + list.append(QPair(name, number)); + emit itemsInserted(list.count()-1, 1); + } + + void insertItem(int index, const QString &name, const QString &number) { + list.insert(index, QPair(name, number)); + emit itemsInserted(index, 1); + } + + void removeItem(int index) { + list.removeAt(index); + emit itemsRemoved(index, 1); + } + + void moveItem(int from, int to) { + list.move(from, to); + emit itemsMoved(from, to, 1); + } + + void modifyItem(int index, const QString &name, const QString &number) { + list[index] = QPair(name, number); + emit itemsChanged(index, 1, roles()); + } + +private: + QList > list; +}; + + +class TestModel2 : public QAbstractListModel +{ +public: + enum Roles { Name = Qt::UserRole+1, Number = Qt::UserRole+2 }; + + TestModel2(QObject *parent=0) : QAbstractListModel(parent) { + QHash roles; + roles[Name] = "name"; + roles[Number] = "number"; + setRoleNames(roles); + } + + int rowCount(const QModelIndex &parent=QModelIndex()) const { return list.count(); } + QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const { + QVariant rv; + if (role == Name) + rv = list.at(index.row()).first; + else if (role == Number) + rv = list.at(index.row()).second; + + return rv; + } + + int count() const { return rowCount(); } + QString name(int index) const { return list.at(index).first; } + QString number(int index) const { return list.at(index).second; } + + void addItem(const QString &name, const QString &number) { + emit beginInsertRows(QModelIndex(), list.count(), list.count()); + list.append(QPair(name, number)); + emit endInsertRows(); + } + + void insertItem(int index, const QString &name, const QString &number) { + emit beginInsertRows(QModelIndex(), index, index); + list.insert(index, QPair(name, number)); + emit endInsertRows(); + } + + void removeItem(int index) { + emit beginRemoveRows(QModelIndex(), index, index); + list.removeAt(index); + emit endRemoveRows(); + } + + void moveItem(int from, int to) { + emit beginMoveRows(QModelIndex(), from, from, QModelIndex(), to); + list.move(from, to); + emit endMoveRows(); + } + + void modifyItem(int idx, const QString &name, const QString &number) { + list[idx] = QPair(name, number); + emit dataChanged(index(idx,0), index(idx,0)); + } + +private: + QList > list; +}; + +tst_QmlGraphicsListView::tst_QmlGraphicsListView() +{ +} + +template +void tst_QmlGraphicsListView::items() +{ + QmlView *canvas = createView(SRCDIR "/data/listview.qml"); + + T model; + model.addItem("Fred", "12345"); + model.addItem("John", "2345"); + model.addItem("Bob", "54321"); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsListView *listview = findItem(canvas->root(), "list"); + QVERIFY(listview != 0); + + QmlGraphicsItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + QCOMPARE(listview->count(), model.count()); + QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item + + for (int i = 0; i < model.count(); ++i) { + QmlGraphicsText *name = findItem(viewport, "textName", i); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(i)); + QmlGraphicsText *number = findItem(viewport, "textNumber", i); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(i)); + } + + listview->incrementCurrentIndex(); + QCOMPARE(listview->currentIndex(), 1); + listview->decrementCurrentIndex(); + QCOMPARE(listview->currentIndex(), 0); + + // set an empty model and confirm that items are destroyed + T model2; + ctxt->setContextProperty("testModel", &model2); + + int itemCount = findItems(viewport, "wrapper").count(); + QVERIFY(itemCount == 0); + + delete canvas; +} + +template +void tst_QmlGraphicsListView::changed() +{ + QmlView *canvas = createView(SRCDIR "/data/listview.qml"); + + T model; + model.addItem("Fred", "12345"); + model.addItem("John", "2345"); + model.addItem("Bob", "54321"); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsFlickable *listview = findItem(canvas->root(), "list"); + QVERIFY(listview != 0); + + QmlGraphicsItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + model.modifyItem(1, "Will", "9876"); + QmlGraphicsText *name = findItem(viewport, "textName", 1); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(1)); + QmlGraphicsText *number = findItem(viewport, "textNumber", 1); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(1)); + + delete canvas; +} + +template +void tst_QmlGraphicsListView::inserted() +{ + QmlView *canvas = createView(SRCDIR "/data/listview.qml"); + + T model; + model.addItem("Fred", "12345"); + model.addItem("John", "2345"); + model.addItem("Bob", "54321"); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsListView *listview = findItem(canvas->root(), "list"); + QVERIFY(listview != 0); + + QmlGraphicsItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + model.insertItem(1, "Will", "9876"); + + // let transitions settle. + QTest::qWait(1000); + + QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item + + QmlGraphicsText *name = findItem(viewport, "textName", 1); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(1)); + QmlGraphicsText *number = findItem(viewport, "textNumber", 1); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(1)); + + // Confirm items positioned correctly + for (int i = 0; i < model.count(); ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + QVERIFY(item->y() == i*20); + } + + model.insertItem(0, "Foo", "1111"); // zero index, and current item + + // let transitions settle. + QTest::qWait(1000); + + QCOMPARE(viewport->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item + + name = findItem(viewport, "textName", 0); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(0)); + number = findItem(viewport, "textNumber", 0); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(0)); + + QCOMPARE(listview->currentIndex(), 1); + + // Confirm items positioned correctly + for (int i = 0; i < model.count(); ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + QVERIFY(item->y() == i*20); + } + + for (int i = model.count(); i < 30; ++i) + model.insertItem(i, "Hello", QString::number(i)); + QTest::qWait(1000); + + listview->setViewportY(80); + QTest::qWait(1000); + + // Insert item outside visible area + model.insertItem(1, "Hello", "1324"); + QTest::qWait(1000); + + QVERIFY(listview->viewportY() == 80); + + // Confirm items positioned correctly + int itemCount = findItems(viewport, "wrapper").count() - 1; + for (int i = 5; i < 5+itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + QVERIFY(item->y() == i*20 - 20); + } + + delete canvas; +} + +template +void tst_QmlGraphicsListView::removed() +{ + QmlView *canvas = createView(SRCDIR "/data/listview.qml"); + + T model; + for (int i = 0; i < 30; i++) + model.addItem("Item" + QString::number(i), ""); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsListView *listview = findItem(canvas->root(), "list"); + QVERIFY(listview != 0); + + QmlGraphicsItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + model.removeItem(1); + + // let transitions settle. + QTest::qWait(1000); + + QmlGraphicsText *name = findItem(viewport, "textName", 1); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(1)); + QmlGraphicsText *number = findItem(viewport, "textNumber", 1); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(1)); + + // Confirm items positioned correctly + int itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->y() == i*20); + } + + // Remove first item (which is the current item); + model.removeItem(0); // post: top item starts at 20 + + // let transitions settle. + QTest::qWait(1000); + + name = findItem(viewport, "textName", 0); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(0)); + number = findItem(viewport, "textNumber", 0); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(0)); + + // Confirm items positioned correctly + itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QCOMPARE(item->y(),i*20.0 + 20.0); + } + + // Remove items not visible + model.removeItem(18); + // let transitions settle. + QTest::qWait(1000); + + // Confirm items positioned correctly + itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QCOMPARE(item->y(),i*20.0+20.0); + } + + // Remove items before visible + listview->setViewportY(80); + listview->setCurrentIndex(10); + + model.removeItem(1); // post: top item will be at 40 + // let transitions settle. + QTest::qWait(1000); + + // Confirm items positioned correctly + for (int i = 2; i < 18; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QCOMPARE(item->y(),40+i*20.0); + } + + listview->setViewportY(40); // That's the top now + // let transitions settle. + QTest::qWait(1000); + + // Confirm items positioned correctly + itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QCOMPARE(item->y(),40+i*20.0); + } + + delete canvas; +} + +template +void tst_QmlGraphicsListView::moved() +{ + QmlView *canvas = createView(SRCDIR "/data/listview.qml"); + + T model; + for (int i = 0; i < 30; i++) + model.addItem("Item" + QString::number(i), ""); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsListView *listview = findItem(canvas->root(), "list"); + QVERIFY(listview != 0); + + QmlGraphicsItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + model.moveItem(1, 4); + + // let transitions settle. + QTest::qWait(1000); + + QmlGraphicsText *name = findItem(viewport, "textName", 1); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(1)); + QmlGraphicsText *number = findItem(viewport, "textNumber", 1); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(1)); + + name = findItem(viewport, "textName", 4); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(4)); + number = findItem(viewport, "textNumber", 4); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(4)); + + // Confirm items positioned correctly + int itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->y() == i*20); + } + + listview->setViewportY(80); + + // move outside visible area + model.moveItem(1, 18); + + // let transitions settle. + QTest::qWait(1000); + + // Confirm items positioned correctly and indexes correct + for (int i = 3; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->y() == i*20 + 20); + name = findItem(viewport, "textName", i); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(i)); + number = findItem(viewport, "textNumber", i); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(i)); + } + + // move from outside visible into visible + model.moveItem(20, 4); + + // let transitions settle. + QTest::qWait(1000); + + // Confirm items positioned correctly and indexes correct + for (int i = 3; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->y() == i*20 + 20); + name = findItem(viewport, "textName", i); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(i)); + number = findItem(viewport, "textNumber", i); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(i)); + } + + delete canvas; +} + +void tst_QmlGraphicsListView::enforceRange() +{ + QmlView *canvas = createView(SRCDIR "/data/listview-enforcerange.qml"); + + TestModel model; + for (int i = 0; i < 30; i++) + model.addItem("Item" + QString::number(i), ""); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsListView *listview = findItem(canvas->root(), "list"); + QVERIFY(listview != 0); + + QmlGraphicsItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + // view should be positioned at the top of the range. + QmlGraphicsItem *item = findItem(viewport, "wrapper", 0); + QVERIFY(item); + QCOMPARE(listview->viewportY(), -100.0); + + QmlGraphicsText *name = findItem(viewport, "textName", 0); + QVERIFY(name != 0); + QCOMPARE(name->text(), model.name(0)); + QmlGraphicsText *number = findItem(viewport, "textNumber", 0); + QVERIFY(number != 0); + QCOMPARE(number->text(), model.number(0)); + + // Check currentIndex is updated when viewport moves + listview->setViewportY(20); + QTest::qWait(1000); + + QCOMPARE(listview->currentIndex(), 6); + + delete canvas; +} + +void tst_QmlGraphicsListView::spacing() +{ + QmlView *canvas = createView(SRCDIR "/data/listview.qml"); + + TestModel model; + for (int i = 0; i < 30; i++) + model.addItem("Item" + QString::number(i), ""); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsListView *listview = findItem(canvas->root(), "list"); + QVERIFY(listview != 0); + + QmlGraphicsItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + // Confirm items positioned correctly + int itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->y() == i*20); + } + + listview->setSpacing(10); + QVERIFY(listview->spacing() == 10); + + // Confirm items positioned correctly + itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->y() == i*30); + } + + listview->setSpacing(0); + + // Confirm items positioned correctly + itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + if (!item) qWarning() << "Item" << i << "not found"; + QVERIFY(item); + QVERIFY(item->y() == i*20); + } + + delete canvas; +} + +void tst_QmlGraphicsListView::sections() +{ + QmlView *canvas = createView(SRCDIR "/data/listview-sections.qml"); + + TestModel model; + for (int i = 0; i < 30; i++) + model.addItem("Item" + QString::number(i), ""); + + QmlContext *ctxt = canvas->rootContext(); + ctxt->setContextProperty("testModel", &model); + + canvas->execute(); + qApp->processEvents(); + + QmlGraphicsListView *listview = findItem(canvas->root(), "list"); + QVERIFY(listview != 0); + + QmlGraphicsItem *viewport = listview->viewport(); + QVERIFY(viewport != 0); + + // Confirm items positioned correctly + int itemCount = findItems(viewport, "wrapper").count(); + for (int i = 0; i < model.count() && i < itemCount; ++i) { + QmlGraphicsItem *item = findItem(viewport, "wrapper", i); + QVERIFY(item); + QCOMPARE(item->y(), qreal(i*20 + ((i+4)/5) * 20)); + } + + QVERIFY(listview->currentSection() == "0"); + + listview->setViewportY(140); + QVERIFY(listview->currentSection() == "1"); + + delete canvas; +} + +void tst_QmlGraphicsListView::qListModelInterface_items() +{ + items(); +} + +void tst_QmlGraphicsListView::qAbstractItemModel_items() +{ + items(); +} + +void tst_QmlGraphicsListView::qListModelInterface_changed() +{ + changed(); +} + +void tst_QmlGraphicsListView::qAbstractItemModel_changed() +{ + changed(); +} + +void tst_QmlGraphicsListView::qListModelInterface_inserted() +{ + inserted(); +} + +void tst_QmlGraphicsListView::qAbstractItemModel_inserted() +{ + inserted(); +} + +void tst_QmlGraphicsListView::qListModelInterface_removed() +{ + removed(); +} + +void tst_QmlGraphicsListView::qAbstractItemModel_removed() +{ + removed(); +} + +void tst_QmlGraphicsListView::qListModelInterface_moved() +{ + moved(); +} + +void tst_QmlGraphicsListView::qAbstractItemModel_moved() +{ + moved(); +} + + +QmlView *tst_QmlGraphicsListView::createView(const QString &filename) +{ + QmlView *canvas = new QmlView(0); + canvas->setFixedSize(240,320); + + QFile file(filename); + file.open(QFile::ReadOnly); + QString qml = file.readAll(); + canvas->setQml(qml, filename); + + return canvas; +} + +/* + Find an item with the specified objectName. If index is supplied then the + item must also evaluate the {index} expression equal to index +*/ +template +T *tst_QmlGraphicsListView::findItem(QmlGraphicsItem *parent, const QString &objectName, int index) +{ + const QMetaObject &mo = T::staticMetaObject; + //qDebug() << parent->QGraphicsObject::children().count() << "children"; + for (int i = 0; i < parent->QGraphicsObject::children().count(); ++i) { + QmlGraphicsItem *item = qobject_cast(parent->QGraphicsObject::children().at(i)); + if(!item) + continue; + //qDebug() << "try" << item; + if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { + if (index != -1) { + QmlExpression e(qmlContext(item), "index", item); + e.setTrackChange(false); + if (e.value().toInt() == index) + return static_cast(item); + } else { + return static_cast(item); + } + } + item = findItem(item, objectName, index); + if (item) + return static_cast(item); + } + + return 0; +} + +template +QList tst_QmlGraphicsListView::findItems(QmlGraphicsItem *parent, const QString &objectName) +{ + QList items; + const QMetaObject &mo = T::staticMetaObject; + //qDebug() << parent->QGraphicsObject::children().count() << "children"; + for (int i = 0; i < parent->QGraphicsObject::children().count(); ++i) { + QmlGraphicsItem *item = qobject_cast(parent->QGraphicsObject::children().at(i)); + if(!item) + continue; + //qDebug() << "try" << item; + if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) + items.append(static_cast(item)); + items += findItems(item, objectName); + } + + return items; +} + + +QTEST_MAIN(tst_QmlGraphicsListView) + +#include "tst_listview.moc" -- cgit v0.12 From 47f50491cafe76216f209d25d4a96643a05c1253 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 6 Nov 2009 14:09:22 +1000 Subject: More language tests --- src/declarative/qml/qmlcompiler.cpp | 13 +++++--- .../qmllanguage/data/assignBasicTypes.qml | 1 + .../qmllanguage/data/attachedProperties.qml | 3 ++ .../qmllanguage/data/fakeDotProperty.errors.txt | 2 +- .../data/invalidAttachedProperty.1.errors.txt | 1 + .../qmllanguage/data/invalidAttachedProperty.1.qml | 7 +++++ .../data/invalidAttachedProperty.10.errors.txt | 1 + .../data/invalidAttachedProperty.10.qml | 6 ++++ .../data/invalidAttachedProperty.11.errors.txt | 1 + .../data/invalidAttachedProperty.11.qml | 7 +++++ .../data/invalidAttachedProperty.2.errors.txt | 1 + .../qmllanguage/data/invalidAttachedProperty.2.qml | 6 ++++ .../data/invalidAttachedProperty.3.errors.txt | 1 + .../qmllanguage/data/invalidAttachedProperty.3.qml | 8 +++++ .../data/invalidAttachedProperty.4.errors.txt | 1 + .../qmllanguage/data/invalidAttachedProperty.4.qml | 7 +++++ .../data/invalidAttachedProperty.5.errors.txt | 1 + .../qmllanguage/data/invalidAttachedProperty.5.qml | 7 +++++ .../data/invalidAttachedProperty.6.errors.txt | 1 + .../qmllanguage/data/invalidAttachedProperty.6.qml | 7 +++++ .../data/invalidAttachedProperty.7.errors.txt | 1 + .../qmllanguage/data/invalidAttachedProperty.7.qml | 6 ++++ .../data/invalidAttachedProperty.8.errors.txt | 1 + .../qmllanguage/data/invalidAttachedProperty.8.qml | 6 ++++ .../data/invalidAttachedProperty.9.errors.txt | 1 + .../qmllanguage/data/invalidAttachedProperty.9.qml | 7 +++++ .../data/invalidGroupedProperty.1.errors.txt | 2 +- .../data/invalidGroupedProperty.2.errors.txt | 2 +- .../data/invalidGroupedProperty.3.errors.txt | 1 + .../qmllanguage/data/invalidGroupedProperty.3.qml | 5 +++ .../data/invalidGroupedProperty.4.errors.txt | 1 + .../qmllanguage/data/invalidGroupedProperty.4.qml | 5 +++ .../data/invalidGroupedProperty.5.errors.txt | 1 + .../qmllanguage/data/invalidGroupedProperty.5.qml | 5 +++ .../data/invalidGroupedProperty.6.errors.txt | 1 + .../qmllanguage/data/invalidGroupedProperty.6.qml | 6 ++++ .../data/invalidGroupedProperty.7.errors.txt | 1 + .../qmllanguage/data/invalidGroupedProperty.7.qml | 5 +++ .../data/missingValueTypeProperty.errors.txt | 1 + .../qmllanguage/data/missingValueTypeProperty.qml | 5 +++ .../data/objectValueTypeProperty.errors.txt | 1 + .../qmllanguage/data/objectValueTypeProperty.qml | 6 ++++ .../qmllanguage/data/wrongType.15.errors.txt | 1 + .../declarative/qmllanguage/data/wrongType.15.qml | 4 +++ tests/auto/declarative/qmllanguage/testtypes.h | 19 +++++++++++- .../declarative/qmllanguage/tst_qmllanguage.cpp | 36 +++++++++++++++++++++- 46 files changed, 202 insertions(+), 10 deletions(-) create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.qml create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.qml create mode 100644 tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.qml create mode 100644 tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.qml create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.15.errors.txt create mode 100644 tests/auto/declarative/qmllanguage/data/wrongType.15.qml diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index 240f16c..8e92eb4 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -1714,7 +1714,7 @@ bool QmlCompiler::buildGroupedProperty(QmlParser::Property *prop, prop->value, obj, ctxt.incr())); obj->addValueTypeProperty(prop); } else { - COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Invalid property access")); + COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Invalid grouped property access")); } } else { @@ -1722,7 +1722,7 @@ bool QmlCompiler::buildGroupedProperty(QmlParser::Property *prop, prop->value->metatype = QmlEnginePrivate::get(engine)->metaObjectForType(prop->type); if (!prop->value->metatype) - COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Cannot nest non-QObject property \"%1\"").arg(QString::fromUtf8(prop->name))); + COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Invalid grouped property access")); obj->addGroupedProperty(prop); @@ -1749,8 +1749,11 @@ bool QmlCompiler::buildValueTypeProperty(QObject *type, prop->index = idx; prop->type = p.userType(); - if (prop->value || prop->values.count() != 1) - COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Invalid property use")); + if (prop->value) + COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Property assignment expected")); + + if (prop->values.count() != 1) + COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Single property assignment expected")); Value *value = prop->values.at(0); @@ -1758,7 +1761,7 @@ bool QmlCompiler::buildValueTypeProperty(QObject *type, bool isPropertyValue = output->types.at(value->object->type).type->propertyValueSourceCast() != -1; bool isPropertyInterceptor = output->types.at(value->object->type).type->propertyValueInterceptorCast() != -1; if (!isPropertyValue && !isPropertyInterceptor) { - COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Invalid property use")); + COMPILE_EXCEPTION(prop, qApp->translate("QmlCompiler","Unexpected object assignment")); } else { COMPILE_CHECK(buildObject(value->object, ctxt)); diff --git a/tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml b/tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml index 50723a3..c86c96b 100644 --- a/tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml +++ b/tests/auto/declarative/qmllanguage/data/assignBasicTypes.qml @@ -23,6 +23,7 @@ MyTypeObject { boolProperty: true variantProperty: "Hello World!" vectorProperty: "10,1,2.2" + urlProperty: "main.qml" objectProperty: MyTypeObject { intProperty: 8 } } diff --git a/tests/auto/declarative/qmllanguage/data/attachedProperties.qml b/tests/auto/declarative/qmllanguage/data/attachedProperties.qml index 8343754..fec96cc 100644 --- a/tests/auto/declarative/qmllanguage/data/attachedProperties.qml +++ b/tests/auto/declarative/qmllanguage/data/attachedProperties.qml @@ -1,5 +1,8 @@ import Test 1.0 +import Test 1.0 as Namespace import Qt 4.6 + Object { MyQmlObject.value: 10 + Namespace.MyQmlObject.value2: 13 } diff --git a/tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt b/tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt index e56ad3a..3074823 100644 --- a/tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/fakeDotProperty.errors.txt @@ -1 +1 @@ -3:5:Invalid property access +3:5:Invalid grouped property access diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.errors.txt new file mode 100644 index 0000000..68fe671 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.errors.txt @@ -0,0 +1 @@ +5:17:Cannot assign to non-existant property "foo" diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.qml new file mode 100644 index 0000000..e99c635 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.1.qml @@ -0,0 +1,7 @@ +import Test 1.0 +import Qt 4.6 + +Object { + MyQmlObject.foo: 10 +} + diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.errors.txt new file mode 100644 index 0000000..7f630f4 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.errors.txt @@ -0,0 +1 @@ +5:15:Non-existant attached object diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.qml new file mode 100644 index 0000000..8f987ce --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.10.qml @@ -0,0 +1,6 @@ +import Test 1.0 as Namespace +import Qt 4.6 + +Object { + Namespace.MadeUpClass.foo: 10 +} diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.errors.txt new file mode 100644 index 0000000..fee5050 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.errors.txt @@ -0,0 +1 @@ +5:15:Not an attached property name diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.qml new file mode 100644 index 0000000..18770fc --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.11.qml @@ -0,0 +1,7 @@ +import Test 1.0 as Namespace +import Qt 4.6 + +Object { + Namespace.madeUpClass.foo: 10 +} + diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.errors.txt new file mode 100644 index 0000000..9f06e07 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.errors.txt @@ -0,0 +1 @@ +5:27:Cannot assign to non-existant property "foo" diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.qml new file mode 100644 index 0000000..3c9ae5b --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.2.qml @@ -0,0 +1,6 @@ +import Test 1.0 as Namespace +import Qt 4.6 + +Object { + Namespace.MyQmlObject.foo: 10 +} diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.errors.txt new file mode 100644 index 0000000..05161c4 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.errors.txt @@ -0,0 +1 @@ +5:5:Invalid attached object assignment diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.qml new file mode 100644 index 0000000..e9405a4 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.3.qml @@ -0,0 +1,8 @@ +import Test 1.0 +import Qt 4.6 + +Object { + MyQmlObject: 10 +} + + diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.errors.txt new file mode 100644 index 0000000..a208bcf --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.errors.txt @@ -0,0 +1 @@ +5:15:Invalid attached object assignment diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.qml new file mode 100644 index 0000000..6fbf718 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.4.qml @@ -0,0 +1,7 @@ +import Test 1.0 as Namespace +import Qt 4.6 + +Object { + Namespace.MyQmlObject: 10 +} + diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.errors.txt new file mode 100644 index 0000000..05161c4 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.errors.txt @@ -0,0 +1 @@ +5:5:Invalid attached object assignment diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.qml new file mode 100644 index 0000000..1827a16 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.5.qml @@ -0,0 +1,7 @@ +import Test 1.0 +import Qt 4.6 + +Object { + MyQmlObject: Object {} +} + diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.errors.txt new file mode 100644 index 0000000..e232b23 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.errors.txt @@ -0,0 +1 @@ +5:5:Non-existant attached object diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.qml new file mode 100644 index 0000000..5c7f0ec --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.6.qml @@ -0,0 +1,7 @@ +import Test 1.0 +import Qt 4.6 + +Object { + Test.MyQmlObject: Object {} +} + diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.errors.txt new file mode 100644 index 0000000..e232b23 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.errors.txt @@ -0,0 +1 @@ +5:5:Non-existant attached object diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.qml new file mode 100644 index 0000000..841cc08 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.7.qml @@ -0,0 +1,6 @@ +import Test 1.0 +import Qt 4.6 + +Object { + MyTypeObject.foo: 10 +} diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.errors.txt new file mode 100644 index 0000000..7f630f4 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.errors.txt @@ -0,0 +1 @@ +5:15:Non-existant attached object diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.qml new file mode 100644 index 0000000..f1b4b96 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.8.qml @@ -0,0 +1,6 @@ +import Test 1.0 as Namespace +import Qt 4.6 + +Object { + Namespace.MyTypeObject.foo: 10 +} diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.errors.txt new file mode 100644 index 0000000..e232b23 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.errors.txt @@ -0,0 +1 @@ +5:5:Non-existant attached object diff --git a/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.qml b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.qml new file mode 100644 index 0000000..99c4a5c --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidAttachedProperty.9.qml @@ -0,0 +1,7 @@ +import Test 1.0 +import Qt 4.6 + +Object { + MadeUpClass.foo: 10 +} + diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.1.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.1.errors.txt index 7c00ce4..810fd31 100644 --- a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.1.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.1.errors.txt @@ -1 +1 @@ -5:5:Invalid property access +5:5:Invalid grouped property access diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.2.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.2.errors.txt index 7c00ce4..810fd31 100644 --- a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.2.errors.txt +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.2.errors.txt @@ -1 +1 @@ -5:5:Invalid property access +5:5:Invalid grouped property access diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.errors.txt new file mode 100644 index 0000000..f6d6f29 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.errors.txt @@ -0,0 +1 @@ +4:5:Invalid grouped property access diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.qml b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.qml new file mode 100644 index 0000000..0bbfc4f --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.3.qml @@ -0,0 +1,5 @@ +import Test 1.0 + +MyQmlObject { + customType.x: 10 +} diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.errors.txt new file mode 100644 index 0000000..19934fa --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.errors.txt @@ -0,0 +1 @@ +4:5:Cannot assign to non-existant property "foo" diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.qml b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.qml new file mode 100644 index 0000000..134fef9 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.4.qml @@ -0,0 +1,5 @@ +import Test 1.0 + +MyQmlObject { + foo.x: 10 +} diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.errors.txt new file mode 100644 index 0000000..2c8a970 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.errors.txt @@ -0,0 +1 @@ +4:18:Property assignment expected diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.qml b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.qml new file mode 100644 index 0000000..55cefe6 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.5.qml @@ -0,0 +1,5 @@ +import Test 1.0 + +MyTypeObject { + rectProperty.x.foo: 100 +} diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.errors.txt new file mode 100644 index 0000000..8331725 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.errors.txt @@ -0,0 +1 @@ +5:18:Single property assignment expected diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.qml b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.qml new file mode 100644 index 0000000..9ec33ab --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.6.qml @@ -0,0 +1,6 @@ +import Test 1.0 + +MyTypeObject { + rectProperty.x: 100 + rectProperty.x: 101 +} diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.errors.txt b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.errors.txt new file mode 100644 index 0000000..4a7e383 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.errors.txt @@ -0,0 +1 @@ +4:-1:Cannot set properties on nullGrouped as it is null diff --git a/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.qml b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.qml new file mode 100644 index 0000000..b77fb90 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/invalidGroupedProperty.7.qml @@ -0,0 +1,5 @@ +import Test 1.0 + +MyTypeObject { + nullGrouped.script: print(1921) +} diff --git a/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.errors.txt b/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.errors.txt new file mode 100644 index 0000000..dfaa218 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.errors.txt @@ -0,0 +1 @@ +4:18:Cannot assign to non-existant property "foo" diff --git a/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.qml b/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.qml new file mode 100644 index 0000000..9a0fa6a --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/missingValueTypeProperty.qml @@ -0,0 +1,5 @@ +import Test 1.0 + +MyTypeObject { + rectProperty.foo: 9 +} diff --git a/tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.errors.txt b/tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.errors.txt new file mode 100644 index 0000000..db7d9c0 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.errors.txt @@ -0,0 +1 @@ +4:18:Unexpected object assignment diff --git a/tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.qml b/tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.qml new file mode 100644 index 0000000..9924773 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/objectValueTypeProperty.qml @@ -0,0 +1,6 @@ +import Test 1.0 + +MyTypeObject { + rectProperty.x: MyTypeObject {} +} + diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.15.errors.txt b/tests/auto/declarative/qmllanguage/data/wrongType.15.errors.txt new file mode 100644 index 0000000..44768e3 --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.15.errors.txt @@ -0,0 +1 @@ +3:18:Invalid property assignment: url expected diff --git a/tests/auto/declarative/qmllanguage/data/wrongType.15.qml b/tests/auto/declarative/qmllanguage/data/wrongType.15.qml new file mode 100644 index 0000000..633a5ba --- /dev/null +++ b/tests/auto/declarative/qmllanguage/data/wrongType.15.qml @@ -0,0 +1,4 @@ +import Test 1.0 +MyTypeObject { + urlProperty: 12 +} diff --git a/tests/auto/declarative/qmllanguage/testtypes.h b/tests/auto/declarative/qmllanguage/testtypes.h index e654faa..b251f87 100644 --- a/tests/auto/declarative/qmllanguage/testtypes.h +++ b/tests/auto/declarative/qmllanguage/testtypes.h @@ -80,14 +80,19 @@ class MyAttachedObject : public QObject { Q_OBJECT Q_PROPERTY(int value READ value WRITE setValue) + Q_PROPERTY(int value2 READ value2 WRITE setValue2) public: - MyAttachedObject(QObject *parent) : QObject(parent), m_value(0) {} + MyAttachedObject(QObject *parent) : QObject(parent), m_value(0), m_value2(0) {} int value() const { return m_value; } void setValue(int v) { m_value = v; } + int value2() const { return m_value2; } + void setValue2(int v) { m_value2 = v; } + private: int m_value; + int m_value2; }; class MyQmlObject : public QObject, public MyInterface, public QmlParserStatus @@ -201,9 +206,11 @@ class MyTypeObject : public QObject Q_PROPERTY(bool boolProperty READ boolProperty WRITE setBoolProperty); Q_PROPERTY(QVariant variantProperty READ variantProperty WRITE setVariantProperty); Q_PROPERTY(QVector3D vectorProperty READ vectorProperty WRITE setVectorProperty); + Q_PROPERTY(QUrl urlProperty READ urlProperty WRITE setUrlProperty); Q_PROPERTY(QmlScriptString scriptProperty READ scriptProperty WRITE setScriptProperty); Q_PROPERTY(MyGroupedObject *grouped READ grouped CONSTANT); + Q_PROPERTY(MyGroupedObject *nullGrouped READ nullGrouped CONSTANT); public: MyTypeObject() @@ -413,6 +420,14 @@ public: vectorPropertyValue = v; } + QUrl urlPropertyValue; + QUrl urlProperty() const { + return urlPropertyValue; + } + void setUrlProperty(const QUrl &v) { + urlPropertyValue = v; + } + QmlScriptString scriptPropertyValue; QmlScriptString scriptProperty() const { return scriptPropertyValue; @@ -424,6 +439,8 @@ public: MyGroupedObject groupedValue; MyGroupedObject *grouped() { return &groupedValue; } + MyGroupedObject *nullGrouped() { return 0; } + void doAction() { emit action(); } signals: void action(); diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp index c646583..c23bb2d 100644 --- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp +++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp @@ -141,6 +141,7 @@ private: QFile file(QLatin1String("data/") + QLatin1String(errorfile)); \ QVERIFY(file.open(QIODevice::ReadOnly)); \ QByteArray data = file.readAll(); \ + file.close(); \ QList expected = data.split('\n'); \ expected.removeAll(QByteArray("")); \ QList errors = component.errors(); \ @@ -154,7 +155,16 @@ private: } \ if (qgetenv("DEBUG") != "" && expected != actual) \ qWarning() << "Expected:" << expected << "Actual:" << actual; \ - QCOMPARE(expected, actual); \ + if (qgetenv("QMLLANGUAGE_UPDATEERRORS") != "" && expected != actual) {\ + QFile file(QLatin1String("data/") + QLatin1String(errorfile)); \ + QVERIFY(file.open(QIODevice::WriteOnly)); \ + for (int ii = 0; ii < actual.count(); ++ii) { \ + file.write(actual.at(ii)); file.write("\n"); \ + } \ + file.close(); \ + } else { \ + QCOMPARE(expected, actual); \ + } \ } inline QUrl TEST_FILE(const QString &filename) @@ -214,6 +224,7 @@ void tst_qmllanguage::errors_data() QTest::newRow("wrongType (color for size)") << "wrongType.12.qml" << "wrongType.12.errors.txt" << false; QTest::newRow("wrongType (number string for int)") << "wrongType.13.qml" << "wrongType.13.errors.txt" << false; QTest::newRow("wrongType (int for string)") << "wrongType.14.qml" << "wrongType.14.errors.txt" << false; + QTest::newRow("wrongType (int for url)") << "wrongType.15.qml" << "wrongType.15.errors.txt" << false; QTest::newRow("readOnly.1") << "readOnly.1.qml" << "readOnly.1.errors.txt" << false; QTest::newRow("readOnly.2") << "readOnly.2.qml" << "readOnly.2.errors.txt" << false; @@ -240,8 +251,14 @@ void tst_qmllanguage::errors_data() QTest::newRow("missingSignal") << "missingSignal.qml" << "missingSignal.errors.txt" << false; QTest::newRow("finalOverride") << "finalOverride.qml" << "finalOverride.errors.txt" << false; QTest::newRow("customParserIdNotAllowed") << "customParserIdNotAllowed.qml" << "customParserIdNotAllowed.errors.txt" << false; + QTest::newRow("invalidGroupedProperty.1") << "invalidGroupedProperty.1.qml" << "invalidGroupedProperty.1.errors.txt" << false; QTest::newRow("invalidGroupedProperty.2") << "invalidGroupedProperty.2.qml" << "invalidGroupedProperty.2.errors.txt" << false; + QTest::newRow("invalidGroupedProperty.3") << "invalidGroupedProperty.3.qml" << "invalidGroupedProperty.3.errors.txt" << false; + QTest::newRow("invalidGroupedProperty.4") << "invalidGroupedProperty.4.qml" << "invalidGroupedProperty.4.errors.txt" << false; + QTest::newRow("invalidGroupedProperty.5") << "invalidGroupedProperty.5.qml" << "invalidGroupedProperty.5.errors.txt" << false; + QTest::newRow("invalidGroupedProperty.6") << "invalidGroupedProperty.6.qml" << "invalidGroupedProperty.6.errors.txt" << false; + QTest::newRow("invalidGroupedProperty.7") << "invalidGroupedProperty.7.qml" << "invalidGroupedProperty.7.errors.txt" << true; QTest::newRow("importNamespaceConflict") << "importNamespaceConflict.qml" << "importNamespaceConflict.errors.txt" << false; QTest::newRow("importVersionMissing (builtin)") << "importVersionMissingBuiltIn.qml" << "importVersionMissingBuiltIn.errors.txt" << false; @@ -278,13 +295,28 @@ void tst_qmllanguage::errors_data() QTest::newRow("Component.5") << "component.5.qml" << "component.5.errors.txt" << false; QTest::newRow("Component.6") << "component.6.qml" << "component.6.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.1") << "invalidAttachedProperty.1.qml" << "invalidAttachedProperty.1.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.2") << "invalidAttachedProperty.2.qml" << "invalidAttachedProperty.2.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.3") << "invalidAttachedProperty.3.qml" << "invalidAttachedProperty.3.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.4") << "invalidAttachedProperty.4.qml" << "invalidAttachedProperty.4.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.5") << "invalidAttachedProperty.5.qml" << "invalidAttachedProperty.5.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.6") << "invalidAttachedProperty.6.qml" << "invalidAttachedProperty.6.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.7") << "invalidAttachedProperty.7.qml" << "invalidAttachedProperty.7.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.8") << "invalidAttachedProperty.8.qml" << "invalidAttachedProperty.8.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.9") << "invalidAttachedProperty.9.qml" << "invalidAttachedProperty.9.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.10") << "invalidAttachedProperty.10.qml" << "invalidAttachedProperty.10.errors.txt" << false; + QTest::newRow("invalidAttachedProperty.11") << "invalidAttachedProperty.11.qml" << "invalidAttachedProperty.11.errors.txt" << false; + QTest::newRow("nestedErrors") << "nestedErrors.qml" << "nestedErrors.errors.txt" << false; QTest::newRow("defaultGrouped") << "defaultGrouped.qml" << "defaultGrouped.errors.txt" << false; QTest::newRow("emptySignal") << "emptySignal.qml" << "emptySignal.errors.txt" << false; QTest::newRow("doubleSignal") << "doubleSignal.qml" << "doubleSignal.errors.txt" << false; QTest::newRow("invalidRoot") << "invalidRoot.qml" << "invalidRoot.errors.txt" << false; + QTest::newRow("missingValueTypeProperty") << "missingValueTypeProperty.qml" << "missingValueTypeProperty.errors.txt" << false; + QTest::newRow("objectValueTypeProperty") << "objectValueTypeProperty.qml" << "objectValueTypeProperty.errors.txt" << false; } + void tst_qmllanguage::errors() { QFETCH(QString, file); @@ -420,6 +452,7 @@ void tst_qmllanguage::assignBasicTypes() QCOMPARE(object->boolProperty(), true); QCOMPARE(object->variantProperty(), QVariant("Hello World!")); QCOMPARE(object->vectorProperty(), QVector3D(10, 1, 2.2)); + QCOMPARE(object->urlProperty(), component.url().resolved(QUrl("main.qml"))); QVERIFY(object->objectProperty() != 0); MyTypeObject *child = qobject_cast(object->objectProperty()); QVERIFY(child != 0); @@ -611,6 +644,7 @@ void tst_qmllanguage::attachedProperties() QObject *attached = qmlAttachedPropertiesObject(object); QVERIFY(attached != 0); QCOMPARE(attached->property("value"), QVariant(10)); + QCOMPARE(attached->property("value2"), QVariant(13)); } // Tests non-static object properties -- cgit v0.12 From d13d9d070e63cb9321bbdbc0eacf965f1ed070bb Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Fri, 6 Nov 2009 14:13:11 +1000 Subject: A missing fixup after rename --- tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp index 5575ace..9f904b8 100644 --- a/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp +++ b/tests/auto/declarative/qmlgraphicslistview/tst_qmlgraphicslistview.cpp @@ -850,4 +850,4 @@ QList tst_QmlGraphicsListView::findItems(QmlGraphicsItem *parent, const QStr QTEST_MAIN(tst_QmlGraphicsListView) -#include "tst_listview.moc" +#include "tst_qmlgraphicslistview.moc" -- cgit v0.12 From 28b9a4c1bfb6632a10f19bd51528f30205207da0 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 6 Nov 2009 14:25:26 +1000 Subject: test paletteChanged() --- .../qmlsystempalette/tst_qmlsystempalette.cpp | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/auto/declarative/qmlsystempalette/tst_qmlsystempalette.cpp b/tests/auto/declarative/qmlsystempalette/tst_qmlsystempalette.cpp index 039eaa8..2648463 100644 --- a/tests/auto/declarative/qmlsystempalette/tst_qmlsystempalette.cpp +++ b/tests/auto/declarative/qmlsystempalette/tst_qmlsystempalette.cpp @@ -38,7 +38,9 @@ ** $QT_END_LICENSE$ ** ****************************************************************************/ + #include +#include #include #include #include @@ -56,6 +58,7 @@ private slots: void activePalette(); void inactivePalette(); void disabledPalette(); + void paletteChanged(); private: QmlEngine engine; @@ -149,6 +152,30 @@ void tst_qmlsystempalette::disabledPalette() delete object; } +void tst_qmlsystempalette::paletteChanged() +{ + QString componentStr = "import Qt 4.6\nSystemPalette { }"; + QmlComponent component(&engine, componentStr.toLatin1(), QUrl("file://")); + QmlSystemPalette *object = qobject_cast(component.create()); + + QVERIFY(object != 0); + + QPalette p; + p.setCurrentColorGroup(QPalette::Active); + p.setColor(QPalette::Active, QPalette::Text, QColor("red")); + p.setColor(QPalette::Active, QPalette::ButtonText, QColor("green")); + p.setColor(QPalette::Active, QPalette::WindowText, QColor("blue")); + + qApp->setPalette(p); + + object->setColorGroup(QmlSystemPalette::Active); + QTRY_COMPARE(QColor("red"), object->text()); + QTRY_COMPARE(QColor("green"), object->buttonText()); + QTRY_COMPARE(QColor("blue"), object->windowText()); + + delete object; +} + QTEST_MAIN(tst_qmlsystempalette) #include "tst_qmlsystempalette.moc" -- cgit v0.12 From 6deb03553ca08857146b4cb4ecde396352fe36d7 Mon Sep 17 00:00:00 2001 From: Yann Bodson Date: Fri, 6 Nov 2009 14:49:56 +1000 Subject: update tests and visuals for qmlgraphicstext --- .../visual/qfxtext/elide/data-X11/elide.0.png | Bin 1002 -> 0 bytes .../visual/qfxtext/elide/data-X11/elide.qml | 279 ---------------- .../qfxtext/elide/data-X11/multilength.0.png | Bin 596 -> 0 bytes .../visual/qfxtext/elide/data-X11/multilength.qml | 303 ----------------- .../visual/qfxtext/elide/data/elide.0.png | Bin 1604 -> 0 bytes .../visual/qfxtext/elide/data/elide.qml | 279 ---------------- .../declarative/visual/qfxtext/elide/elide.qml | 31 -- .../visual/qfxtext/elide/multilength.qml | 19 -- .../visual/qfxtext/font/data-MAC/plaintext.0.png | Bin 103016 -> 0 bytes .../visual/qfxtext/font/data-MAC/plaintext.qml | 351 -------------------- .../visual/qfxtext/font/data-MAC/richtext.0.png | Bin 136499 -> 0 bytes .../visual/qfxtext/font/data-MAC/richtext.qml | 359 --------------------- .../visual/qfxtext/font/data/plaintext.0.png | Bin 94120 -> 0 bytes .../visual/qfxtext/font/data/plaintext.qml | 351 -------------------- .../visual/qfxtext/font/data/richtext.0.png | Bin 121122 -> 0 bytes .../visual/qfxtext/font/data/richtext.qml | 359 --------------------- .../declarative/visual/qfxtext/font/plaintext.qml | 85 ----- .../declarative/visual/qfxtext/font/richtext.qml | 85 ----- .../qmlgraphicstext/elide/data-X11/elide.0.png | Bin 0 -> 1002 bytes .../qmlgraphicstext/elide/data-X11/elide.qml | 279 ++++++++++++++++ .../elide/data-X11/multilength.0.png | Bin 0 -> 596 bytes .../qmlgraphicstext/elide/data-X11/multilength.qml | 303 +++++++++++++++++ .../visual/qmlgraphicstext/elide/data/elide.0.png | Bin 0 -> 1604 bytes .../visual/qmlgraphicstext/elide/data/elide.qml | 279 ++++++++++++++++ .../visual/qmlgraphicstext/elide/elide.qml | 31 ++ .../visual/qmlgraphicstext/elide/multilength.qml | 19 ++ .../qmlgraphicstext/font/data-MAC/plaintext.0.png | Bin 0 -> 103018 bytes .../qmlgraphicstext/font/data-MAC/plaintext.qml | 351 ++++++++++++++++++++ .../qmlgraphicstext/font/data-MAC/richtext.0.png | Bin 0 -> 136492 bytes .../qmlgraphicstext/font/data-MAC/richtext.qml | 359 +++++++++++++++++++++ .../qmlgraphicstext/font/data/plaintext.0.png | Bin 0 -> 94120 bytes .../visual/qmlgraphicstext/font/data/plaintext.qml | 351 ++++++++++++++++++++ .../qmlgraphicstext/font/data/richtext.0.png | Bin 0 -> 121122 bytes .../visual/qmlgraphicstext/font/data/richtext.qml | 359 +++++++++++++++++++++ .../visual/qmlgraphicstext/font/plaintext.qml | 85 +++++ .../visual/qmlgraphicstext/font/richtext.qml | 85 +++++ 36 files changed, 2501 insertions(+), 2501 deletions(-) delete mode 100644 tests/auto/declarative/visual/qfxtext/elide/data-X11/elide.0.png delete mode 100644 tests/auto/declarative/visual/qfxtext/elide/data-X11/elide.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/elide/data-X11/multilength.0.png delete mode 100644 tests/auto/declarative/visual/qfxtext/elide/data-X11/multilength.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/elide/data/elide.0.png delete mode 100644 tests/auto/declarative/visual/qfxtext/elide/data/elide.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/elide/elide.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/elide/multilength.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.0.png delete mode 100644 tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.0.png delete mode 100644 tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/font/data/plaintext.0.png delete mode 100644 tests/auto/declarative/visual/qfxtext/font/data/plaintext.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/font/data/richtext.0.png delete mode 100644 tests/auto/declarative/visual/qfxtext/font/data/richtext.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/font/plaintext.qml delete mode 100644 tests/auto/declarative/visual/qfxtext/font/richtext.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/elide.0.png create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/elide.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/multilength.0.png create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/multilength.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/elide/data/elide.0.png create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/elide/data/elide.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/elide/elide.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/elide/multilength.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/plaintext.0.png create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/plaintext.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/richtext.0.png create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/richtext.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/data/plaintext.0.png create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/data/plaintext.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/data/richtext.0.png create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/data/richtext.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/plaintext.qml create mode 100644 tests/auto/declarative/visual/qmlgraphicstext/font/richtext.qml diff --git a/tests/auto/declarative/visual/qfxtext/elide/data-X11/elide.0.png b/tests/auto/declarative/visual/qfxtext/elide/data-X11/elide.0.png deleted file mode 100644 index 5631a46..0000000 Binary files a/tests/auto/declarative/visual/qfxtext/elide/data-X11/elide.0.png and /dev/null differ diff --git a/tests/auto/declarative/visual/qfxtext/elide/data-X11/elide.qml b/tests/auto/declarative/visual/qfxtext/elide/data-X11/elide.qml deleted file mode 100644 index cfd832e..0000000 --- a/tests/auto/declarative/visual/qfxtext/elide/data-X11/elide.qml +++ /dev/null @@ -1,279 +0,0 @@ -import Qt.VisualTest 4.6 - -VisualTest { - Frame { - msec: 0 - } - Frame { - msec: 16 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 32 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 48 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 64 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 80 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 96 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 112 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 128 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 144 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 160 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 176 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 192 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 208 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 224 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 240 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 256 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 272 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 288 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 304 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 320 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 336 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 352 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 368 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 384 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 400 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 416 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 432 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 448 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 464 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 480 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 496 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 512 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 528 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 544 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 560 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 576 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 592 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 608 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 624 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 640 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 656 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 672 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 688 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 704 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 720 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 736 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 752 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 768 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 784 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 800 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 816 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 832 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 848 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 864 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 880 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 896 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 912 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 928 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 944 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 960 - image: "elide.0.png" - } - Frame { - msec: 976 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Key { - type: 6 - key: 16777249 - modifiers: 67108864 - text: "" - autorep: false - count: 1 - } - Frame { - msec: 992 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 1008 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 1024 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 1040 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } - Frame { - msec: 1056 - hash: "48e2da07fd229d9db6afc0eda494cd11" - } -} diff --git a/tests/auto/declarative/visual/qfxtext/elide/data-X11/multilength.0.png b/tests/auto/declarative/visual/qfxtext/elide/data-X11/multilength.0.png deleted file mode 100644 index 6e2b625..0000000 Binary files a/tests/auto/declarative/visual/qfxtext/elide/data-X11/multilength.0.png and /dev/null differ diff --git a/tests/auto/declarative/visual/qfxtext/elide/data-X11/multilength.qml b/tests/auto/declarative/visual/qfxtext/elide/data-X11/multilength.qml deleted file mode 100644 index 0c06196..0000000 --- a/tests/auto/declarative/visual/qfxtext/elide/data-X11/multilength.qml +++ /dev/null @@ -1,303 +0,0 @@ -import Qt.VisualTest 4.6 - -VisualTest { - Frame { - msec: 0 - } - Frame { - msec: 16 - hash: "873e914454b7a040b05649ebd1a2f8c5" - } - Frame { - msec: 32 - hash: "7682a4f1e361ca252da9713734a598e8" - } - Frame { - msec: 48 - hash: "fa8884b550c8df872f96b61557163bcf" - } - Frame { - msec: 64 - hash: "b84ecf9e38f126c3e32defee831d9462" - } - Frame { - msec: 80 - hash: "21cc08f22d1f1fcb38b27a3a4259debe" - } - Frame { - msec: 96 - hash: "93bdfeab813e25e85917f49c0d5f1314" - } - Frame { - msec: 112 - hash: "5f03c252602e60fe19879945fa77c203" - } - Frame { - msec: 128 - hash: "f0b2079f6c512bf80989ebfdbec4cfd8" - } - Frame { - msec: 144 - hash: "9e7bb12d5b7605fc1d78ed9b2a549527" - } - Frame { - msec: 160 - hash: "242bbbe6da87708c92fd47607ecb789d" - } - Frame { - msec: 176 - hash: "f1db5c3a230b4d3e2e1dfefe6bf032a1" - } - Frame { - msec: 192 - hash: "a416e820efd8e173cc52372218513e33" - } - Frame { - msec: 208 - hash: "df711ab70c6087f8138fded16167f069" - } - Frame { - msec: 224 - hash: "fb28eb2eeccfab28299640ef996c1115" - } - Frame { - msec: 240 - hash: "c72c6d79a50dd7147f6b33784880eb36" - } - Frame { - msec: 256 - hash: "4421027e65e95f98499ca53c57220ede" - } - Frame { - msec: 272 - hash: "b7fbfb90d8cc167809e8e846d9021b4b" - } - Frame { - msec: 288 - hash: "004614b1bf18e9aa78e78509c4f289aa" - } - Frame { - msec: 304 - hash: "1792bbd8b69bae1d92fed2a6bcfe0187" - } - Frame { - msec: 320 - hash: "957a8b95d6e85885d854b8eb1db10b04" - } - Frame { - msec: 336 - hash: "d00c3e4d6d8e8d04b949840c28d73a33" - } - Frame { - msec: 352 - hash: "2b79feaa62d773d92d8a684685b2004c" - } - Frame { - msec: 368 - hash: "ef2f11b187028de0c56b23db3168fbc8" - } - Frame { - msec: 384 - hash: "3a489a96aaeca80355313198b935691d" - } - Frame { - msec: 400 - hash: "389f1798f900795a8686c38ace755974" - } - Frame { - msec: 416 - hash: "34fc20be52fe3843420819b9adb90b22" - } - Frame { - msec: 432 - hash: "fa715c5b6640eafe204bf3b8095c74b9" - } - Frame { - msec: 448 - hash: "8e8315edcf23167ac58228b8c28b43e6" - } - Frame { - msec: 464 - hash: "c18e82038f57dd869112cb1be14e4cfe" - } - Frame { - msec: 480 - hash: "3f07e95b09e39f2e5d93216850f4a4d9" - } - Frame { - msec: 496 - hash: "20f0e6eaeac04d6f93565adfab485218" - } - Frame { - msec: 512 - hash: "e3f66d1dfe88dd868a54a8493828ef5f" - } - Frame { - msec: 528 - hash: "d39d34f63e1b29c187249cb388552b38" - } - Frame { - msec: 544 - hash: "5d2e8df5003732f3b53fff4aaddea06c" - } - Frame { - msec: 560 - hash: "35c3aa2dae481a8f817d849b3f3151f2" - } - Frame { - msec: 576 - hash: "966b78018879224948b4d85fe73d7985" - } - Frame { - msec: 592 - hash: "0db067bf9debc3f36dd539cf83652fb8" - } - Frame { - msec: 608 - hash: "ea1c3249ffd2439533907ceaeaafbc56" - } - Frame { - msec: 624 - hash: "da85c0e14b95ca9a729984b67ebd52ad" - } - Frame { - msec: 640 - hash: "5c26ae844ac52dbe131fed0638787aac" - } - Frame { - msec: 656 - hash: "4b09c23ad624db80afcb2a6c1d5ddb96" - } - Frame { - msec: 672 - hash: "9995deb3d22b418a19093b4b988b3fcc" - } - Frame { - msec: 688 - hash: "77e53358f2d4392d0ba988187e7e272c" - } - Frame { - msec: 704 - hash: "3fbbb73e790cf4a0583531fe1580f761" - } - Frame { - msec: 720 - hash: "9d562e141095a258ee61463e644d9889" - } - Frame { - msec: 736 - hash: "d05633ca49f96bf327bed5c9c0f6ac98" - } - Frame { - msec: 752 - hash: "34c38e40e831dbede8fa83de31ed76aa" - } - Frame { - msec: 768 - hash: "288e52c8be54f4914f687cef4ce1f24a" - } - Frame { - msec: 784 - hash: "0b8b744aaf67e8b17fa459bb0ffb6db5" - } - Frame { - msec: 800 - hash: "273dbe3e8c21bfeafa516d07778928c8" - } - Frame { - msec: 816 - hash: "ef94ee1885287c72fa78038547d98b96" - } - Frame { - msec: 832 - hash: "965e6387672319ac04fdc42768e581f1" - } - Frame { - msec: 848 - hash: "95553d8aaece94c7017e57b03cd46c9a" - } - Frame { - msec: 864 - hash: "bdaf35b920e5b08b8639d452afd2d51e" - } - Frame { - msec: 880 - hash: "0ed16f00e89327dc8679bec42179c4ce" - } - Frame { - msec: 896 - hash: "8c93e0ac399e09e98e34b90654e0e42a" - } - Frame { - msec: 912 - hash: "93798fbb33adb6c813018757cfa34017" - } - Frame { - msec: 928 - hash: "db4d7581e9a1f082a2c29ef7482a7893" - } - Frame { - msec: 944 - hash: "67e074c1e083334de84a3549f4ee9ca4" - } - Frame { - msec: 960 - image: "multilength.0.png" - } - Frame { - msec: 976 - hash: "b1122c815a755c9988bcf03a3f7d7d6d" - } - Frame { - msec: 992 - hash: "31148bae6653bdc3f1827d06de845663" - } - Frame { - msec: 1008 - hash: "812428a944086ca46e102891964dac69" - } - Frame { - msec: 1024 - hash: "ee7bb66bd7e8623325200ac994f8b41a" - } - Frame { - msec: 1040 - hash: "6bd21a98e5c373a2c78334a0255e7750" - } - Frame { - msec: 1056 - hash: "2e8e1eea14068b0e82464ed52ec1ab7a" - } - Frame { - msec: 1072 - hash: "6dca5756e20eeb778e31d7b602ce77d7" - } - Frame { - msec: 1088 - hash: "3cbb6700b9e30864a2b1e3d4d71d2a78" - } - Frame { - msec: 1104 - hash: "c4d0230d2c4f73191a514e5df4c0b083" - } - Frame { - msec: 1120 - hash: "a33df967fe43151dfc503d2ac78f8ca8" - } - Frame { - msec: 1136 - hash: "0c7ff101efe60b600cacaf8d04d79053" - } - Frame { - msec: 1152 - hash: "d246cfb75d89b9666877860aaf45ba60" - } - Frame { - msec: 1168 - hash: "1130998aa2618a29ec6bc4b9219eedfa" - } - Frame { - msec: 1184 - hash: "741dd83003633bbf8d28c2d4ddd8a2d0" - } -} diff --git a/tests/auto/declarative/visual/qfxtext/elide/data/elide.0.png b/tests/auto/declarative/visual/qfxtext/elide/data/elide.0.png deleted file mode 100644 index 1a8c89b..0000000 Binary files a/tests/auto/declarative/visual/qfxtext/elide/data/elide.0.png and /dev/null differ diff --git a/tests/auto/declarative/visual/qfxtext/elide/data/elide.qml b/tests/auto/declarative/visual/qfxtext/elide/data/elide.qml deleted file mode 100644 index 59f17f7..0000000 --- a/tests/auto/declarative/visual/qfxtext/elide/data/elide.qml +++ /dev/null @@ -1,279 +0,0 @@ -import Qt.VisualTest 4.6 - -VisualTest { - Frame { - msec: 0 - } - Frame { - msec: 16 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 32 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 48 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 64 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 80 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 96 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 112 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 128 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 144 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 160 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 176 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 192 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 208 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 224 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 240 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 256 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 272 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 288 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 304 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 320 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 336 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 352 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 368 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 384 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 400 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 416 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 432 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 448 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 464 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 480 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 496 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 512 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 528 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 544 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 560 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 576 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 592 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 608 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 624 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 640 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 656 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 672 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 688 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 704 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 720 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 736 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 752 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 768 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 784 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 800 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 816 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 832 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 848 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 864 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 880 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 896 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 912 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 928 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 944 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 960 - image: "elide.0.png" - } - Frame { - msec: 976 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Key { - type: 6 - key: 16777249 - modifiers: 67108864 - text: "" - autorep: false - count: 1 - } - Frame { - msec: 992 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 1008 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 1024 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 1040 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } - Frame { - msec: 1056 - hash: "c80d2bcd4be99c73e6c628870206ce8c" - } -} diff --git a/tests/auto/declarative/visual/qfxtext/elide/elide.qml b/tests/auto/declarative/visual/qfxtext/elide/elide.qml deleted file mode 100644 index 3c9ea5b..0000000 --- a/tests/auto/declarative/visual/qfxtext/elide/elide.qml +++ /dev/null @@ -1,31 +0,0 @@ -import Qt 4.6 - -Rectangle { - width: childrenRect.width - height: childrenRect.height - Column { - width: 80 - height: MyText.height*4 - Text { - elide: "ElideLeft" - text: "aaa bbb ccc ddd eee fff" - width: 80 - id: MyText - } - Text { - elide: "ElideMiddle" - text: "aaa bbb ccc ddd eee fff" - width: 80 - } - Text { - elide: "ElideRight" - text: "aaa bbb ccc ddd eee fff" - width: 80 - } - Text { - elide: "ElideNone" - text: "aaa bbb ccc ddd eee fff" - width: 80 - } - } -} diff --git a/tests/auto/declarative/visual/qfxtext/elide/multilength.qml b/tests/auto/declarative/visual/qfxtext/elide/multilength.qml deleted file mode 100644 index fa74cc4..0000000 --- a/tests/auto/declarative/visual/qfxtext/elide/multilength.qml +++ /dev/null @@ -1,19 +0,0 @@ -import Qt 4.6 - -Rectangle { - width: 500 - height: 50 - color: "lightBlue" - Rectangle { - width: MyText.width - height: MyText.height - color: "white" - anchors.centerIn: parent - Text { - id: MyText - width: NumberAnimation { from: 500; to: 0; running: true; repeat: true; duration: 1000 } - elide: "ElideRight" - text: "Brevity is the soul of wit, and tediousness the limbs and outward flourishes.\x9CBrevity is a great charm of eloquence.\x9CBe concise!\x9CSHHHHHHHHHHHHHHHHHHHHHHHHHHHH" - } - } -} diff --git a/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.0.png b/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.0.png deleted file mode 100644 index a54a327..0000000 Binary files a/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.0.png and /dev/null differ diff --git a/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.qml b/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.qml deleted file mode 100644 index 266c9a3..0000000 --- a/tests/auto/declarative/visual/qfxtext/font/data-MAC/plaintext.qml +++ /dev/null @@ -1,351 +0,0 @@ -import Qt.VisualTest 4.6 - -VisualTest { - Frame { - msec: 0 - } - Frame { - msec: 16 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 32 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 48 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 64 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 80 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 96 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 112 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 128 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 144 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 160 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 176 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 192 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 208 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 224 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 240 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 256 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 272 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 288 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 304 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 320 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 336 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 352 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 368 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 384 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 400 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 416 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 432 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 448 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 464 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 480 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 496 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 512 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 528 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 544 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 560 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 576 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 592 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 608 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 624 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 640 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 656 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 672 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 688 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 704 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 720 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 736 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 752 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 768 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 784 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 800 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 816 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 832 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 848 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 864 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 880 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 896 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 912 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 928 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 944 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 960 - image: "plaintext.0.png" - } - Frame { - msec: 976 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 992 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1008 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1024 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1040 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1056 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1072 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1088 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1104 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1120 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1136 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1152 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1168 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1184 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Key { - type: 6 - key: 16777249 - modifiers: 0 - text: "" - autorep: false - count: 1 - } - Frame { - msec: 1200 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1216 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1232 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1248 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1264 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1280 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1296 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1312 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1328 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } - Frame { - msec: 1344 - hash: "9f3d0a505dec1982d9b405be72c265f8" - } -} diff --git a/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.0.png b/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.0.png deleted file mode 100644 index c2ddee1..0000000 Binary files a/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.0.png and /dev/null differ diff --git a/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.qml b/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.qml deleted file mode 100644 index e971809..0000000 --- a/tests/auto/declarative/visual/qfxtext/font/data-MAC/richtext.qml +++ /dev/null @@ -1,359 +0,0 @@ -import Qt.VisualTest 4.6 - -VisualTest { - Frame { - msec: 0 - } - Frame { - msec: 16 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 32 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 48 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 64 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 80 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 96 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 112 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 128 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 144 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 160 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 176 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 192 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 208 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 224 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 240 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 256 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 272 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 288 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 304 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 320 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 336 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 352 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 368 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 384 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 400 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 416 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 432 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 448 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 464 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 480 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 496 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 512 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 528 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 544 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 560 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 576 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 592 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 608 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 624 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 640 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 656 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 672 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 688 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 704 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 720 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 736 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 752 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 768 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 784 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 800 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 816 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 832 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 848 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 864 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 880 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 896 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 912 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 928 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 944 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 960 - image: "richtext.0.png" - } - Frame { - msec: 976 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 992 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1008 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1024 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1040 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1056 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1072 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1088 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1104 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1120 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1136 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1152 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Key { - type: 6 - key: 16777249 - modifiers: 0 - text: "" - autorep: false - count: 1 - } - Frame { - msec: 1168 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1184 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1200 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1216 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1232 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1248 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1264 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1280 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1296 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1312 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1328 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1344 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1360 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } - Frame { - msec: 1376 - hash: "259cc9829171ea866dac4ffe8ef6b489" - } -} diff --git a/tests/auto/declarative/visual/qfxtext/font/data/plaintext.0.png b/tests/auto/declarative/visual/qfxtext/font/data/plaintext.0.png deleted file mode 100644 index 50d56dc..0000000 Binary files a/tests/auto/declarative/visual/qfxtext/font/data/plaintext.0.png and /dev/null differ diff --git a/tests/auto/declarative/visual/qfxtext/font/data/plaintext.qml b/tests/auto/declarative/visual/qfxtext/font/data/plaintext.qml deleted file mode 100644 index f4cbcbd..0000000 --- a/tests/auto/declarative/visual/qfxtext/font/data/plaintext.qml +++ /dev/null @@ -1,351 +0,0 @@ -import Qt.VisualTest 4.6 - -VisualTest { - Frame { - msec: 0 - } - Frame { - msec: 16 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 32 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 48 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 64 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 80 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 96 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 112 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 128 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 144 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 160 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 176 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 192 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 208 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 224 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 240 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 256 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 272 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 288 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 304 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 320 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 336 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 352 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 368 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 384 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 400 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 416 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 432 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 448 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 464 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 480 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 496 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 512 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 528 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 544 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 560 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 576 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 592 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 608 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 624 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 640 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 656 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 672 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 688 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 704 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 720 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 736 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 752 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 768 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 784 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 800 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 816 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 832 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 848 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 864 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 880 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 896 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 912 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 928 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 944 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 960 - image: "plaintext.0.png" - } - Frame { - msec: 976 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 992 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1008 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1024 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1040 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1056 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1072 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1088 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1104 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1120 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1136 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1152 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1168 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1184 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Key { - type: 6 - key: 16777249 - modifiers: 67108864 - text: "" - autorep: false - count: 1 - } - Frame { - msec: 1200 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1216 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1232 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1248 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1264 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1280 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1296 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1312 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1328 - hash: "d553014bc56a46787e30459b0f44f57a" - } - Frame { - msec: 1344 - hash: "d553014bc56a46787e30459b0f44f57a" - } -} diff --git a/tests/auto/declarative/visual/qfxtext/font/data/richtext.0.png b/tests/auto/declarative/visual/qfxtext/font/data/richtext.0.png deleted file mode 100644 index 2910670..0000000 Binary files a/tests/auto/declarative/visual/qfxtext/font/data/richtext.0.png and /dev/null differ diff --git a/tests/auto/declarative/visual/qfxtext/font/data/richtext.qml b/tests/auto/declarative/visual/qfxtext/font/data/richtext.qml deleted file mode 100644 index 9f396c2..0000000 --- a/tests/auto/declarative/visual/qfxtext/font/data/richtext.qml +++ /dev/null @@ -1,359 +0,0 @@ -import Qt.VisualTest 4.6 - -VisualTest { - Frame { - msec: 0 - } - Frame { - msec: 16 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 32 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 48 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 64 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 80 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 96 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 112 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 128 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 144 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 160 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 176 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 192 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 208 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 224 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 240 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 256 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 272 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 288 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 304 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 320 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 336 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 352 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 368 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 384 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 400 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 416 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 432 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 448 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 464 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 480 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 496 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 512 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 528 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 544 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 560 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 576 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 592 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 608 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 624 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 640 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 656 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 672 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 688 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 704 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 720 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 736 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 752 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 768 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 784 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 800 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 816 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 832 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 848 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 864 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 880 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 896 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 912 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 928 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 944 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 960 - image: "richtext.0.png" - } - Frame { - msec: 976 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 992 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1008 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1024 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1040 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1056 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1072 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1088 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1104 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1120 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1136 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1152 - hash: "dfea78484b840b8cab690e277b960723" - } - Key { - type: 6 - key: 16777249 - modifiers: 67108864 - text: "" - autorep: false - count: 1 - } - Frame { - msec: 1168 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1184 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1200 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1216 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1232 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1248 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1264 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1280 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1296 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1312 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1328 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1344 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1360 - hash: "dfea78484b840b8cab690e277b960723" - } - Frame { - msec: 1376 - hash: "dfea78484b840b8cab690e277b960723" - } -} diff --git a/tests/auto/declarative/visual/qfxtext/font/plaintext.qml b/tests/auto/declarative/visual/qfxtext/font/plaintext.qml deleted file mode 100644 index f219e09..0000000 --- a/tests/auto/declarative/visual/qfxtext/font/plaintext.qml +++ /dev/null @@ -1,85 +0,0 @@ -import Qt 4.6 - -Rectangle { - id: s; width: 800; height: 1000; color: "lightsteelblue" - property string text: "The quick brown fox jumps over the lazy dog." - - Column { - spacing: 10 - Text { - text: s.text - } - Text { - text: s.text; font.pixelSize: 18 - } - Text { - text: s.text; font.pointSize: 25 - } - Text { - text: s.text; color: "red"; smooth: true - } - Text { - text: s.text; font.capitalization: "AllUppercase" - } - Text { - text: s.text; font.underline: true - } - Text { - text: s.text; font.overline: true; smooth: true - } - Text { - text: s.text; font.strikeout: true - } - Text { - text: s.text; font.underline: true; font.overline: true; font.strikeout: true - } - Text { - text: s.text; font.letterSpacing: 200 - } - Text { - text: s.text; font.underline: true; font.letterSpacing: 200; font.capitalization: "AllUppercase"; color: "blue" - } - Text { - text: s.text; font.overline: true; font.wordSpacing: 25; font.capitalization: "Capitalize"; color: "green" - } - Text { - text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white" - } - Text { - text: s.text; font.pixelSize: 18; style: Text.Sunken; styleColor: "gray" - } - Text { - text: s.text; font.pixelSize: 18; style: Text.Raised; styleColor: "yellow" - } - Text { - text: s.text; horizontalAlignment: Text.AlignLeft; width: 800 - } - Text { - text: s.text; horizontalAlignment: Text.AlignHCenter; width: 800 - } - Text { - text: s.text; horizontalAlignment: Text.AlignRight; width: 800 - } - Text { - text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white"; wrap: true; width: 200 - } - Text { - text: s.text; elide: Text.ElideLeft; width: 200 - } - Text { - text: s.text; elide: Text.ElideMiddle; width: 200 - } - Text { - text: s.text; elide: Text.ElideRight; width: 200 - } - Text { - text: s.text; elide: Text.ElideLeft; width: 200; wrap: true - } - Text { - text: s.text; elide: Text.ElideMiddle; width: 200; wrap: true - } - Text { - text: s.text; elide: Text.ElideRight; width: 200; wrap: true - } - } -} diff --git a/tests/auto/declarative/visual/qfxtext/font/richtext.qml b/tests/auto/declarative/visual/qfxtext/font/richtext.qml deleted file mode 100644 index 00a9749..0000000 --- a/tests/auto/declarative/visual/qfxtext/font/richtext.qml +++ /dev/null @@ -1,85 +0,0 @@ -import Qt 4.6 - -Rectangle { - id: s; width: 800; height: 1000; color: "lightsteelblue" - property string text: "The quick brown fox jumps over the lazy dog." - - Column { - spacing: 10 - Text { - text: s.text - } - Text { - text: s.text; font.pixelSize: 18 - } - Text { - text: s.text; font.pointSize: 25 - } - Text { - text: s.text; color: "red"; smooth: true - } - Text { - text: s.text; font.capitalization: "AllUppercase" - } - Text { - text: s.text; font.underline: true - } - Text { - text: s.text; font.overline: true; smooth: true - } - Text { - text: s.text; font.strikeout: true - } - Text { - text: s.text; font.underline: true; font.overline: true; font.strikeout: true - } - Text { - text: s.text; font.letterSpacing: 200 - } - Text { - text: s.text; font.underline: true; font.letterSpacing: 200; font.capitalization: "AllUppercase"; color: "blue" - } - Text { - text: s.text; font.overline: true; font.wordSpacing: 25; font.capitalization: "Capitalize"; color: "green" - } - Text { - text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white" - } - Text { - text: s.text; font.pixelSize: 18; style: Text.Sunken; styleColor: "gray" - } - Text { - text: s.text; font.pixelSize: 18; style: Text.Raised; styleColor: "yellow" - } - Text { - text: s.text; horizontalAlignment: Text.AlignLeft; width: 800 - } - Text { - text: s.text; horizontalAlignment: Text.AlignHCenter; width: 800 - } - Text { - text: s.text; horizontalAlignment: Text.AlignRight; width: 800 - } - Text { - text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white"; wrap: true; width: 200 - } - Text { - text: s.text; elide: Text.ElideLeft; width: 200 - } - Text { - text: s.text; elide: Text.ElideMiddle; width: 200 - } - Text { - text: s.text; elide: Text.ElideRight; width: 200 - } - Text { - text: s.text; elide: Text.ElideLeft; width: 200; wrap: true - } - Text { - text: s.text; elide: Text.ElideMiddle; width: 200; wrap: true - } - Text { - text: s.text; elide: Text.ElideRight; width: 200; wrap: true - } - } -} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/elide.0.png b/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/elide.0.png new file mode 100644 index 0000000..5631a46 Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/elide.0.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/elide.qml b/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/elide.qml new file mode 100644 index 0000000..cfd832e --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/elide.qml @@ -0,0 +1,279 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 32 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 48 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 64 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 80 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 96 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 112 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 128 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 144 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 160 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 176 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 192 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 208 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 224 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 240 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 256 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 272 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 288 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 304 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 320 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 336 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 352 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 368 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 384 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 400 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 416 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 432 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 448 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 464 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 480 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 496 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 512 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 528 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 544 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 560 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 576 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 592 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 608 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 624 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 640 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 656 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 672 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 688 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 704 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 720 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 736 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 752 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 768 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 784 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 800 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 816 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 832 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 848 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 864 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 880 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 896 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 912 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 928 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 944 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 960 + image: "elide.0.png" + } + Frame { + msec: 976 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 992 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 1008 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 1024 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 1040 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } + Frame { + msec: 1056 + hash: "48e2da07fd229d9db6afc0eda494cd11" + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/multilength.0.png b/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/multilength.0.png new file mode 100644 index 0000000..6e2b625 Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/multilength.0.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/multilength.qml b/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/multilength.qml new file mode 100644 index 0000000..0c06196 --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/elide/data-X11/multilength.qml @@ -0,0 +1,303 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "873e914454b7a040b05649ebd1a2f8c5" + } + Frame { + msec: 32 + hash: "7682a4f1e361ca252da9713734a598e8" + } + Frame { + msec: 48 + hash: "fa8884b550c8df872f96b61557163bcf" + } + Frame { + msec: 64 + hash: "b84ecf9e38f126c3e32defee831d9462" + } + Frame { + msec: 80 + hash: "21cc08f22d1f1fcb38b27a3a4259debe" + } + Frame { + msec: 96 + hash: "93bdfeab813e25e85917f49c0d5f1314" + } + Frame { + msec: 112 + hash: "5f03c252602e60fe19879945fa77c203" + } + Frame { + msec: 128 + hash: "f0b2079f6c512bf80989ebfdbec4cfd8" + } + Frame { + msec: 144 + hash: "9e7bb12d5b7605fc1d78ed9b2a549527" + } + Frame { + msec: 160 + hash: "242bbbe6da87708c92fd47607ecb789d" + } + Frame { + msec: 176 + hash: "f1db5c3a230b4d3e2e1dfefe6bf032a1" + } + Frame { + msec: 192 + hash: "a416e820efd8e173cc52372218513e33" + } + Frame { + msec: 208 + hash: "df711ab70c6087f8138fded16167f069" + } + Frame { + msec: 224 + hash: "fb28eb2eeccfab28299640ef996c1115" + } + Frame { + msec: 240 + hash: "c72c6d79a50dd7147f6b33784880eb36" + } + Frame { + msec: 256 + hash: "4421027e65e95f98499ca53c57220ede" + } + Frame { + msec: 272 + hash: "b7fbfb90d8cc167809e8e846d9021b4b" + } + Frame { + msec: 288 + hash: "004614b1bf18e9aa78e78509c4f289aa" + } + Frame { + msec: 304 + hash: "1792bbd8b69bae1d92fed2a6bcfe0187" + } + Frame { + msec: 320 + hash: "957a8b95d6e85885d854b8eb1db10b04" + } + Frame { + msec: 336 + hash: "d00c3e4d6d8e8d04b949840c28d73a33" + } + Frame { + msec: 352 + hash: "2b79feaa62d773d92d8a684685b2004c" + } + Frame { + msec: 368 + hash: "ef2f11b187028de0c56b23db3168fbc8" + } + Frame { + msec: 384 + hash: "3a489a96aaeca80355313198b935691d" + } + Frame { + msec: 400 + hash: "389f1798f900795a8686c38ace755974" + } + Frame { + msec: 416 + hash: "34fc20be52fe3843420819b9adb90b22" + } + Frame { + msec: 432 + hash: "fa715c5b6640eafe204bf3b8095c74b9" + } + Frame { + msec: 448 + hash: "8e8315edcf23167ac58228b8c28b43e6" + } + Frame { + msec: 464 + hash: "c18e82038f57dd869112cb1be14e4cfe" + } + Frame { + msec: 480 + hash: "3f07e95b09e39f2e5d93216850f4a4d9" + } + Frame { + msec: 496 + hash: "20f0e6eaeac04d6f93565adfab485218" + } + Frame { + msec: 512 + hash: "e3f66d1dfe88dd868a54a8493828ef5f" + } + Frame { + msec: 528 + hash: "d39d34f63e1b29c187249cb388552b38" + } + Frame { + msec: 544 + hash: "5d2e8df5003732f3b53fff4aaddea06c" + } + Frame { + msec: 560 + hash: "35c3aa2dae481a8f817d849b3f3151f2" + } + Frame { + msec: 576 + hash: "966b78018879224948b4d85fe73d7985" + } + Frame { + msec: 592 + hash: "0db067bf9debc3f36dd539cf83652fb8" + } + Frame { + msec: 608 + hash: "ea1c3249ffd2439533907ceaeaafbc56" + } + Frame { + msec: 624 + hash: "da85c0e14b95ca9a729984b67ebd52ad" + } + Frame { + msec: 640 + hash: "5c26ae844ac52dbe131fed0638787aac" + } + Frame { + msec: 656 + hash: "4b09c23ad624db80afcb2a6c1d5ddb96" + } + Frame { + msec: 672 + hash: "9995deb3d22b418a19093b4b988b3fcc" + } + Frame { + msec: 688 + hash: "77e53358f2d4392d0ba988187e7e272c" + } + Frame { + msec: 704 + hash: "3fbbb73e790cf4a0583531fe1580f761" + } + Frame { + msec: 720 + hash: "9d562e141095a258ee61463e644d9889" + } + Frame { + msec: 736 + hash: "d05633ca49f96bf327bed5c9c0f6ac98" + } + Frame { + msec: 752 + hash: "34c38e40e831dbede8fa83de31ed76aa" + } + Frame { + msec: 768 + hash: "288e52c8be54f4914f687cef4ce1f24a" + } + Frame { + msec: 784 + hash: "0b8b744aaf67e8b17fa459bb0ffb6db5" + } + Frame { + msec: 800 + hash: "273dbe3e8c21bfeafa516d07778928c8" + } + Frame { + msec: 816 + hash: "ef94ee1885287c72fa78038547d98b96" + } + Frame { + msec: 832 + hash: "965e6387672319ac04fdc42768e581f1" + } + Frame { + msec: 848 + hash: "95553d8aaece94c7017e57b03cd46c9a" + } + Frame { + msec: 864 + hash: "bdaf35b920e5b08b8639d452afd2d51e" + } + Frame { + msec: 880 + hash: "0ed16f00e89327dc8679bec42179c4ce" + } + Frame { + msec: 896 + hash: "8c93e0ac399e09e98e34b90654e0e42a" + } + Frame { + msec: 912 + hash: "93798fbb33adb6c813018757cfa34017" + } + Frame { + msec: 928 + hash: "db4d7581e9a1f082a2c29ef7482a7893" + } + Frame { + msec: 944 + hash: "67e074c1e083334de84a3549f4ee9ca4" + } + Frame { + msec: 960 + image: "multilength.0.png" + } + Frame { + msec: 976 + hash: "b1122c815a755c9988bcf03a3f7d7d6d" + } + Frame { + msec: 992 + hash: "31148bae6653bdc3f1827d06de845663" + } + Frame { + msec: 1008 + hash: "812428a944086ca46e102891964dac69" + } + Frame { + msec: 1024 + hash: "ee7bb66bd7e8623325200ac994f8b41a" + } + Frame { + msec: 1040 + hash: "6bd21a98e5c373a2c78334a0255e7750" + } + Frame { + msec: 1056 + hash: "2e8e1eea14068b0e82464ed52ec1ab7a" + } + Frame { + msec: 1072 + hash: "6dca5756e20eeb778e31d7b602ce77d7" + } + Frame { + msec: 1088 + hash: "3cbb6700b9e30864a2b1e3d4d71d2a78" + } + Frame { + msec: 1104 + hash: "c4d0230d2c4f73191a514e5df4c0b083" + } + Frame { + msec: 1120 + hash: "a33df967fe43151dfc503d2ac78f8ca8" + } + Frame { + msec: 1136 + hash: "0c7ff101efe60b600cacaf8d04d79053" + } + Frame { + msec: 1152 + hash: "d246cfb75d89b9666877860aaf45ba60" + } + Frame { + msec: 1168 + hash: "1130998aa2618a29ec6bc4b9219eedfa" + } + Frame { + msec: 1184 + hash: "741dd83003633bbf8d28c2d4ddd8a2d0" + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/elide/data/elide.0.png b/tests/auto/declarative/visual/qmlgraphicstext/elide/data/elide.0.png new file mode 100644 index 0000000..1a8c89b Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicstext/elide/data/elide.0.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicstext/elide/data/elide.qml b/tests/auto/declarative/visual/qmlgraphicstext/elide/data/elide.qml new file mode 100644 index 0000000..59f17f7 --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/elide/data/elide.qml @@ -0,0 +1,279 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 32 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 48 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 64 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 80 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 96 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 112 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 128 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 144 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 160 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 176 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 192 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 208 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 224 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 240 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 256 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 272 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 288 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 304 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 320 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 336 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 352 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 368 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 384 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 400 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 416 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 432 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 448 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 464 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 480 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 496 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 512 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 528 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 544 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 560 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 576 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 592 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 608 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 624 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 640 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 656 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 672 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 688 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 704 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 720 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 736 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 752 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 768 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 784 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 800 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 816 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 832 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 848 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 864 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 880 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 896 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 912 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 928 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 944 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 960 + image: "elide.0.png" + } + Frame { + msec: 976 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 992 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 1008 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 1024 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 1040 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } + Frame { + msec: 1056 + hash: "c80d2bcd4be99c73e6c628870206ce8c" + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/elide/elide.qml b/tests/auto/declarative/visual/qmlgraphicstext/elide/elide.qml new file mode 100644 index 0000000..3c9ea5b --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/elide/elide.qml @@ -0,0 +1,31 @@ +import Qt 4.6 + +Rectangle { + width: childrenRect.width + height: childrenRect.height + Column { + width: 80 + height: MyText.height*4 + Text { + elide: "ElideLeft" + text: "aaa bbb ccc ddd eee fff" + width: 80 + id: MyText + } + Text { + elide: "ElideMiddle" + text: "aaa bbb ccc ddd eee fff" + width: 80 + } + Text { + elide: "ElideRight" + text: "aaa bbb ccc ddd eee fff" + width: 80 + } + Text { + elide: "ElideNone" + text: "aaa bbb ccc ddd eee fff" + width: 80 + } + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/elide/multilength.qml b/tests/auto/declarative/visual/qmlgraphicstext/elide/multilength.qml new file mode 100644 index 0000000..fa74cc4 --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/elide/multilength.qml @@ -0,0 +1,19 @@ +import Qt 4.6 + +Rectangle { + width: 500 + height: 50 + color: "lightBlue" + Rectangle { + width: MyText.width + height: MyText.height + color: "white" + anchors.centerIn: parent + Text { + id: MyText + width: NumberAnimation { from: 500; to: 0; running: true; repeat: true; duration: 1000 } + elide: "ElideRight" + text: "Brevity is the soul of wit, and tediousness the limbs and outward flourishes.\x9CBrevity is a great charm of eloquence.\x9CBe concise!\x9CSHHHHHHHHHHHHHHHHHHHHHHHHHHHH" + } + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/plaintext.0.png b/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/plaintext.0.png new file mode 100644 index 0000000..05a6e51 Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/plaintext.0.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/plaintext.qml b/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/plaintext.qml new file mode 100644 index 0000000..7e591c8 --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/plaintext.qml @@ -0,0 +1,351 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 32 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 48 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 64 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 80 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 96 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 112 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 128 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 144 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 160 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 176 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 192 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 208 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 224 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 240 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 256 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 272 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 288 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 304 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 320 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 336 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 352 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 368 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 384 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 400 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 416 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 432 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 448 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 464 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 480 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 496 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 512 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 528 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 544 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 560 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 576 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 592 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 608 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 624 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 640 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 656 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 672 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 688 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 704 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 720 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 736 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 752 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 768 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 784 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 800 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 816 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 832 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 848 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 864 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 880 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 896 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 912 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 928 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 944 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 960 + image: "plaintext.0.png" + } + Frame { + msec: 976 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 992 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1008 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1024 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1040 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1056 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1072 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1088 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1104 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1120 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1136 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1152 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1168 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1184 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 1200 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1216 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1232 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1248 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1264 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1280 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1296 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1312 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1328 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } + Frame { + msec: 1344 + hash: "d6479cc04d67055c2fd8f4ed2fca829b" + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/richtext.0.png b/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/richtext.0.png new file mode 100644 index 0000000..6379942 Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/richtext.0.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/richtext.qml b/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/richtext.qml new file mode 100644 index 0000000..4414c1c --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/font/data-MAC/richtext.qml @@ -0,0 +1,359 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 32 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 48 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 64 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 80 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 96 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 112 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 128 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 144 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 160 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 176 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 192 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 208 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 224 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 240 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 256 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 272 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 288 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 304 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 320 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 336 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 352 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 368 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 384 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 400 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 416 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 432 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 448 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 464 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 480 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 496 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 512 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 528 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 544 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 560 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 576 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 592 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 608 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 624 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 640 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 656 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 672 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 688 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 704 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 720 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 736 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 752 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 768 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 784 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 800 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 816 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 832 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 848 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 864 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 880 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 896 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 912 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 928 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 944 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 960 + image: "richtext.0.png" + } + Frame { + msec: 976 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 992 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1008 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1024 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1040 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1056 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1072 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1088 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1104 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1120 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1136 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1152 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 1168 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1184 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1200 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1216 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1232 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1248 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1264 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1280 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1296 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1312 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1328 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1344 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1360 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } + Frame { + msec: 1376 + hash: "b902ff73e7c943bb09b5d2ae6c7a760e" + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/data/plaintext.0.png b/tests/auto/declarative/visual/qmlgraphicstext/font/data/plaintext.0.png new file mode 100644 index 0000000..50d56dc Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicstext/font/data/plaintext.0.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/data/plaintext.qml b/tests/auto/declarative/visual/qmlgraphicstext/font/data/plaintext.qml new file mode 100644 index 0000000..f4cbcbd --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/font/data/plaintext.qml @@ -0,0 +1,351 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 32 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 48 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 64 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 80 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 96 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 112 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 128 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 144 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 160 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 176 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 192 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 208 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 224 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 240 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 256 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 272 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 288 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 304 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 320 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 336 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 352 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 368 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 384 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 400 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 416 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 432 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 448 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 464 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 480 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 496 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 512 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 528 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 544 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 560 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 576 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 592 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 608 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 624 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 640 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 656 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 672 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 688 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 704 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 720 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 736 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 752 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 768 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 784 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 800 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 816 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 832 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 848 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 864 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 880 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 896 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 912 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 928 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 944 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 960 + image: "plaintext.0.png" + } + Frame { + msec: 976 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 992 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1008 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1024 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1040 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1056 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1072 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1088 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1104 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1120 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1136 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1152 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1168 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1184 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 1200 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1216 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1232 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1248 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1264 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1280 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1296 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1312 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1328 + hash: "d553014bc56a46787e30459b0f44f57a" + } + Frame { + msec: 1344 + hash: "d553014bc56a46787e30459b0f44f57a" + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/data/richtext.0.png b/tests/auto/declarative/visual/qmlgraphicstext/font/data/richtext.0.png new file mode 100644 index 0000000..2910670 Binary files /dev/null and b/tests/auto/declarative/visual/qmlgraphicstext/font/data/richtext.0.png differ diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/data/richtext.qml b/tests/auto/declarative/visual/qmlgraphicstext/font/data/richtext.qml new file mode 100644 index 0000000..9f396c2 --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/font/data/richtext.qml @@ -0,0 +1,359 @@ +import Qt.VisualTest 4.6 + +VisualTest { + Frame { + msec: 0 + } + Frame { + msec: 16 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 32 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 48 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 64 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 80 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 96 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 112 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 128 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 144 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 160 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 176 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 192 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 208 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 224 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 240 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 256 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 272 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 288 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 304 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 320 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 336 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 352 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 368 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 384 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 400 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 416 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 432 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 448 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 464 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 480 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 496 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 512 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 528 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 544 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 560 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 576 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 592 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 608 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 624 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 640 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 656 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 672 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 688 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 704 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 720 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 736 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 752 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 768 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 784 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 800 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 816 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 832 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 848 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 864 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 880 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 896 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 912 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 928 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 944 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 960 + image: "richtext.0.png" + } + Frame { + msec: 976 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 992 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1008 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1024 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1040 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1056 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1072 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1088 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1104 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1120 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1136 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1152 + hash: "dfea78484b840b8cab690e277b960723" + } + Key { + type: 6 + key: 16777249 + modifiers: 67108864 + text: "" + autorep: false + count: 1 + } + Frame { + msec: 1168 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1184 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1200 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1216 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1232 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1248 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1264 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1280 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1296 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1312 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1328 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1344 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1360 + hash: "dfea78484b840b8cab690e277b960723" + } + Frame { + msec: 1376 + hash: "dfea78484b840b8cab690e277b960723" + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/plaintext.qml b/tests/auto/declarative/visual/qmlgraphicstext/font/plaintext.qml new file mode 100644 index 0000000..a3aa929 --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/font/plaintext.qml @@ -0,0 +1,85 @@ +import Qt 4.6 + +Rectangle { + id: s; width: 800; height: 1000; color: "lightsteelblue" + property string text: "The quick brown fox jumps over the lazy dog." + + Column { + spacing: 10 + Text { + text: s.text + } + Text { + text: s.text; font.pixelSize: 18 + } + Text { + text: s.text; font.pointSize: 25 + } + Text { + text: s.text; color: "red"; smooth: true + } + Text { + text: s.text; font.capitalization: "AllUppercase" + } + Text { + text: s.text; font.underline: true + } + Text { + text: s.text; font.overline: true; smooth: true + } + Text { + text: s.text; font.strikeout: true + } + Text { + text: s.text; font.underline: true; font.overline: true; font.strikeout: true + } + Text { + text: s.text; font.letterSpacing: 200 + } + Text { + text: s.text; font.underline: true; font.letterSpacing: 200; font.capitalization: "AllUppercase"; color: "blue" + } + Text { + text: s.text; font.overline: true; font.wordSpacing: 25; font.capitalization: "Capitalize"; color: "green" + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white" + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Sunken; styleColor: "gray" + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Raised; styleColor: "yellow" + } + Text { + text: s.text; horizontalAlignment: Text.AlignLeft; width: 800 + } + Text { + text: s.text; horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter; width: 800; height: 20 + } + Text { + text: s.text; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignBottom; width: 800; height: 20 + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white"; wrap: true; width: 200 + } + Text { + text: s.text; elide: Text.ElideLeft; width: 200 + } + Text { + text: s.text; elide: Text.ElideMiddle; width: 200 + } + Text { + text: s.text; elide: Text.ElideRight; width: 200 + } + Text { + text: s.text; elide: Text.ElideLeft; width: 200; wrap: true + } + Text { + text: s.text; elide: Text.ElideMiddle; width: 200; wrap: true + } + Text { + text: s.text; elide: Text.ElideRight; width: 200; wrap: true + } + } +} diff --git a/tests/auto/declarative/visual/qmlgraphicstext/font/richtext.qml b/tests/auto/declarative/visual/qmlgraphicstext/font/richtext.qml new file mode 100644 index 0000000..35aa232 --- /dev/null +++ b/tests/auto/declarative/visual/qmlgraphicstext/font/richtext.qml @@ -0,0 +1,85 @@ +import Qt 4.6 + +Rectangle { + id: s; width: 800; height: 1000; color: "lightsteelblue" + property string text: "The quick brown fox jumps over the lazy dog." + + Column { + spacing: 10 + Text { + text: s.text + } + Text { + text: s.text; font.pixelSize: 18 + } + Text { + text: s.text; font.pointSize: 25 + } + Text { + text: s.text; color: "red"; smooth: true + } + Text { + text: s.text; font.capitalization: "AllUppercase" + } + Text { + text: s.text; font.underline: true + } + Text { + text: s.text; font.overline: true; smooth: true + } + Text { + text: s.text; font.strikeout: true + } + Text { + text: s.text; font.underline: true; font.overline: true; font.strikeout: true + } + Text { + text: s.text; font.letterSpacing: 200 + } + Text { + text: s.text; font.underline: true; font.letterSpacing: 200; font.capitalization: "AllUppercase"; color: "blue" + } + Text { + text: s.text; font.overline: true; font.wordSpacing: 25; font.capitalization: "Capitalize"; color: "green" + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white" + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Sunken; styleColor: "gray" + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Raised; styleColor: "yellow" + } + Text { + text: s.text; horizontalAlignment: Text.AlignLeft; width: 800 + } + Text { + text: s.text; horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter; width: 800; height: 20 + } + Text { + text: s.text; horizontalAlignment: Text.AlignRight; verticalAlignment: Text.AlignBottom; width: 800; height: 20 + } + Text { + text: s.text; font.pixelSize: 18; style: Text.Outline; styleColor: "white"; wrap: true; width: 200 + } + Text { + text: s.text; elide: Text.ElideLeft; width: 200 + } + Text { + text: s.text; elide: Text.ElideMiddle; width: 200 + } + Text { + text: s.text; elide: Text.ElideRight; width: 200 + } + Text { + text: s.text; elide: Text.ElideLeft; width: 200; wrap: true + } + Text { + text: s.text; elide: Text.ElideMiddle; width: 200; wrap: true + } + Text { + text: s.text; elide: Text.ElideRight; width: 200; wrap: true + } + } +} -- cgit v0.12 From 336cfc8ec78977458b485c3da364af7c0890911e Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Fri, 6 Nov 2009 15:03:55 +1000 Subject: More test coverage for Text --- .../qmlgraphicstext/tst_qmlgraphicstext.cpp | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp b/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp index 2a3cdde..1e10873 100644 --- a/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp +++ b/tests/auto/declarative/qmlgraphicstext/tst_qmlgraphicstext.cpp @@ -45,6 +45,7 @@ #include #include #include +#include #include class tst_qmlgraphicstext : public QObject @@ -78,6 +79,8 @@ private slots: void letterSpacing(); void wordSpacing(); + void clickLink(); + private: QStringList standard; QStringList richText; @@ -258,6 +261,10 @@ void tst_qmlgraphicstext::wrap() QVERIFY(textObject != 0); QCOMPARE(textObject->width(), 30.); QVERIFY(textObject->height() > textHeight); + + int oldHeight = textObject->height(); + textObject->setWidth(100); + QVERIFY(textObject->height() < oldHeight); } for (int i = 0; i < richText.size(); i++) @@ -730,6 +737,54 @@ void tst_qmlgraphicstext::wordSpacing() } } +class EventSender : public QGraphicsItem +{ +public: + void sendEvent(QEvent *event) { sceneEvent(event); } +}; + +class LinkTest : public QObject +{ + Q_OBJECT +public: + LinkTest() {} + + QString link; + +public slots: + void linkClicked(QString l) { link = l; } +}; + +void tst_qmlgraphicstext::clickLink() +{ + { + QString componentStr = "import Qt 4.6\nText { text: \"Hello world!\" }"; + QmlComponent textComponent(&engine, componentStr.toLatin1(), QUrl("file://")); + QmlGraphicsText *textObject = qobject_cast(textComponent.create()); + + QVERIFY(textObject != 0); + + LinkTest test; + QObject::connect(textObject, SIGNAL(linkActivated(QString)), &test, SLOT(linkClicked(QString))); + + { + QGraphicsSceneMouseEvent me(QEvent::GraphicsSceneMousePress); + me.setPos(QPointF(textObject->x()/2, textObject->y()/2)); + me.setButton(Qt::LeftButton); + static_cast(static_cast(textObject))->sendEvent(&me); + } + + { + QGraphicsSceneMouseEvent me(QEvent::GraphicsSceneMouseRelease); + me.setPos(QPointF(textObject->x()/2, textObject->y()/2)); + me.setButton(Qt::LeftButton); + static_cast(static_cast(textObject))->sendEvent(&me); + } + + QCOMPARE(test.link, QLatin1String("http://qt.nokia.com")); + } +} + QTEST_MAIN(tst_qmlgraphicstext) #include "tst_qmlgraphicstext.moc" -- cgit v0.12