diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-06-30 09:08:35 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-06-30 09:08:35 +0200 |
commit | 5112821a37ab749f758e354e84703df2d09d5471 (patch) | |
tree | 8f19ba6e7661109675b5e1e9b0ddae94b4c96d4f /tests | |
parent | 5d2ea1d5e9d6e29a16d0e9333cfc2dc8e7c5b677 (diff) | |
parent | a3f686cf7cc14ff481b972b1170a7ff76d0e0fd0 (diff) |
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
.qmake.conf
src/qml/qml/qqmlengine.cpp
src/quick/items/qquickitemsmodule.cpp
tools/qml/main.cpp
Change-Id: Ida8daf6b4d7e675385f2f5514c446e52dedaf136
Diffstat (limited to 'tests')
16 files changed, 165 insertions, 15 deletions
diff --git a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.cpp b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.cpp index 68279413e0..bddece6452 100644 --- a/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.cpp +++ b/tests/auto/qml/debugger/qqmldebuggingenabler/qqmldebuggingenablerserver/qqmldebuggingenablerserver.cpp @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) { - bool block = false; + QQmlDebuggingEnabler::StartMode block = QQmlDebuggingEnabler::DoNotWaitForClient; int portFrom = 0; int portTo = 0; @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) arguments.removeFirst(); if (arguments.size() && arguments.first() == QLatin1String("-block")) { - block = true; + block = QQmlDebuggingEnabler::WaitForClient; arguments.removeFirst(); } diff --git a/tests/auto/qml/qqmllanguage/data/invalidAlias.10.errors.txt b/tests/auto/qml/qqmllanguage/data/invalidAlias.10.errors.txt index 93652a7042..1ac78f2fc2 100644 --- a/tests/auto/qml/qqmllanguage/data/invalidAlias.10.errors.txt +++ b/tests/auto/qml/qqmllanguage/data/invalidAlias.10.errors.txt @@ -1 +1 @@ -5:23:Invalid alias location +5:23:Invalid alias target location: blah diff --git a/tests/auto/qml/qqmllanguage/data/invalidAlias.6.errors.txt b/tests/auto/qml/qqmllanguage/data/invalidAlias.6.errors.txt index 93652a7042..5b467ebc31 100644 --- a/tests/auto/qml/qqmllanguage/data/invalidAlias.6.errors.txt +++ b/tests/auto/qml/qqmllanguage/data/invalidAlias.6.errors.txt @@ -1 +1 @@ -5:23:Invalid alias location +5:23:Invalid alias target location: foobar diff --git a/tests/auto/qml/qqmllanguage/data/invalidAlias.7.errors.txt b/tests/auto/qml/qqmllanguage/data/invalidAlias.7.errors.txt index 93652a7042..8334f30ede 100644 --- a/tests/auto/qml/qqmllanguage/data/invalidAlias.7.errors.txt +++ b/tests/auto/qml/qqmllanguage/data/invalidAlias.7.errors.txt @@ -1 +1 @@ -5:23:Invalid alias location +5:23:Invalid alias target location: nonScriptable diff --git a/tests/auto/qml/qqmllanguage/data/invalidAlias.8.errors.txt b/tests/auto/qml/qqmllanguage/data/invalidAlias.8.errors.txt index 93652a7042..c77182f3ba 100644 --- a/tests/auto/qml/qqmllanguage/data/invalidAlias.8.errors.txt +++ b/tests/auto/qml/qqmllanguage/data/invalidAlias.8.errors.txt @@ -1 +1 @@ -5:23:Invalid alias location +5:23:Invalid alias target location: imaginary diff --git a/tests/auto/qml/qqmllanguage/data/invalidAlias.9.errors.txt b/tests/auto/qml/qqmllanguage/data/invalidAlias.9.errors.txt index 93652a7042..33ba4d293e 100644 --- a/tests/auto/qml/qqmllanguage/data/invalidAlias.9.errors.txt +++ b/tests/auto/qml/qqmllanguage/data/invalidAlias.9.errors.txt @@ -1 +1 @@ -5:23:Invalid alias location +5:23:Invalid alias target location: x diff --git a/tests/auto/qml/qqmlvaluetypes/data/rect_compare.qml b/tests/auto/qml/qqmlvaluetypes/data/rect_compare.qml index c511c2dfc4..104e7ba1e9 100644 --- a/tests/auto/qml/qqmlvaluetypes/data/rect_compare.qml +++ b/tests/auto/qml/qqmlvaluetypes/data/rect_compare.qml @@ -1,10 +1,6 @@ import Test 1.0 MyTypeObject { - property int r_x: rect.x - property int r_y: rect.y - property int r_width: rect.width - property int r_height: rect.height property variant copy: rect property string tostring: rect.toString() diff --git a/tests/auto/qml/qqmlvaluetypes/data/rect_read.qml b/tests/auto/qml/qqmlvaluetypes/data/rect_read.qml index c3b37a7099..da6deddd75 100644 --- a/tests/auto/qml/qqmlvaluetypes/data/rect_read.qml +++ b/tests/auto/qml/qqmlvaluetypes/data/rect_read.qml @@ -5,6 +5,10 @@ MyTypeObject { property int r_y: rect.y property int r_width: rect.width property int r_height: rect.height + property int r_left: rect.left + property int r_right: rect.right + property int r_top: rect.top + property int r_bottom: rect.bottom property variant copy: rect } diff --git a/tests/auto/qml/qqmlvaluetypes/data/rectf_compare.qml b/tests/auto/qml/qqmlvaluetypes/data/rectf_compare.qml index 6ac4049558..eb61755bcf 100644 --- a/tests/auto/qml/qqmlvaluetypes/data/rectf_compare.qml +++ b/tests/auto/qml/qqmlvaluetypes/data/rectf_compare.qml @@ -1,10 +1,6 @@ import Test 1.0 MyTypeObject { - property real r_x: rectf.x - property real r_y: rectf.y - property real r_width: rectf.width - property real r_height: rectf.height property variant copy: rectf property string tostring: rectf.toString() diff --git a/tests/auto/qml/qqmlvaluetypes/data/rectf_read.qml b/tests/auto/qml/qqmlvaluetypes/data/rectf_read.qml index 6ff3ce30bf..878868254d 100644 --- a/tests/auto/qml/qqmlvaluetypes/data/rectf_read.qml +++ b/tests/auto/qml/qqmlvaluetypes/data/rectf_read.qml @@ -5,6 +5,10 @@ MyTypeObject { property real r_y: rectf.y property real r_width: rectf.width property real r_height: rectf.height + property real r_left: rectf.left + property real r_right: rectf.right + property real r_top: rectf.top + property real r_bottom: rectf.bottom property variant copy: rectf } diff --git a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp index 2892e746da..578004b0a1 100644 --- a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp +++ b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp @@ -371,6 +371,10 @@ void tst_qqmlvaluetypes::rect() QCOMPARE(object->property("r_y").toInt(), 3); QCOMPARE(object->property("r_width").toInt(), 109); QCOMPARE(object->property("r_height").toInt(), 102); + QCOMPARE(object->property("r_left").toInt(), 2); + QCOMPARE(object->property("r_right").toInt(), 110); + QCOMPARE(object->property("r_top").toInt(), 3); + QCOMPARE(object->property("r_bottom").toInt(), 104); QCOMPARE(object->property("copy"), QVariant(QRect(2, 3, 109, 102))); delete object; @@ -418,6 +422,10 @@ void tst_qqmlvaluetypes::rectf() QCOMPARE(float(object->property("r_y").toDouble()), float(99.2)); QCOMPARE(float(object->property("r_width").toDouble()), float(88.1)); QCOMPARE(float(object->property("r_height").toDouble()), float(77.6)); + QCOMPARE(float(object->property("r_left").toDouble()), float(103.8)); + QCOMPARE(float(object->property("r_right").toDouble()), float(191.9)); + QCOMPARE(float(object->property("r_top").toDouble()), float(99.2)); + QCOMPARE(float(object->property("r_bottom").toDouble()), float(176.8)); QCOMPARE(object->property("copy"), QVariant(QRectF(103.8, 99.2, 88.1, 77.6))); delete object; diff --git a/tests/auto/quick/qquicklistview/data/listview-sections_delegate.qml b/tests/auto/quick/qquicklistview/data/listview-sections_delegate.qml index 7245025bac..11da286f4d 100644 --- a/tests/auto/quick/qquicklistview/data/listview-sections_delegate.qml +++ b/tests/auto/quick/qquicklistview/data/listview-sections_delegate.qml @@ -12,6 +12,9 @@ Rectangle { Item { id: wrapper objectName: "wrapper" + property string section: ListView.section + property string nextSection: ListView.nextSection + property string prevSection: ListView.previousSection height: 20; width: 240 Rectangle { diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp index b25fc5402b..6377650696 100644 --- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp +++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp @@ -133,6 +133,7 @@ private slots: void sectionsDelegate_headerVisibility(); void sectionPropertyChange(); void sectionDelegateChange(); + void sectionsItemInsertion(); void cacheBuffer(); void positionViewAtBeginningEnd(); void positionViewAtIndex(); @@ -2544,6 +2545,67 @@ void tst_QQuickListView::sectionDelegateChange() delete window; } +// QTBUG-43873 +void tst_QQuickListView::sectionsItemInsertion() +{ + QQuickView *window = createView(); + + QaimModel model; + for (int i = 0; i < 30; i++) + model.addItem("Item" + QString::number(i), QString::number(i/5)); + + QQmlContext *ctxt = window->rootContext(); + ctxt->setContextProperty("testModel", &model); + + window->setSource(testFileUrl("listview-sections_delegate.qml")); + window->show(); + QVERIFY(QTest::qWaitForWindowExposed(window)); + + QQuickListView *listview = findItem<QQuickListView>(window->rootObject(), "list"); + QTRY_VERIFY(listview != 0); + QQuickItem *contentItem = listview->contentItem(); + QTRY_VERIFY(contentItem != 0); + QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false); + + for (int i = 0; i < 3; ++i) { + QQuickItem *item = findItem<QQuickItem>(contentItem, "sect_" + QString::number(i)); + QVERIFY(item); + QTRY_COMPARE(item->y(), qreal(i*20*6)); + } + + QQuickItem *topItem = findVisibleChild(contentItem, "sect_0"); // section header + QVERIFY(topItem); + QCOMPARE(topItem->y(), 0.); + + // Insert a full screen of items at the beginning. + for (int i = 0; i < 10; i++) + model.insertItem(i, "Item" + QString::number(i), QLatin1String("A")); + + QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false); + + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); + QVERIFY(itemCount > 10); + + // Verify that the new items are postioned correctly, and have the correct attached section properties + for (int i = 0; i < 10 && i < itemCount; ++i) { + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); + QVERIFY(item); + QTRY_COMPARE(item->y(), 20+i*20.0); + QCOMPARE(item->property("section").toString(), QLatin1String("A")); + QCOMPARE(item->property("nextSection").toString(), i < 9 ? QLatin1String("A") : QLatin1String("0")); + QCOMPARE(item->property("prevSection").toString(), i > 0 ? QLatin1String("A") : QLatin1String("")); + } + // Verify that the exiting items are postioned correctly, and have the correct attached section properties + for (int i = 10; i < 15 && i < itemCount; ++i) { + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); + QVERIFY(item); + QTRY_COMPARE(item->y(), 40+i*20.0); + QCOMPARE(item->property("section").toString(), QLatin1String("0")); + QCOMPARE(item->property("nextSection").toString(), i < 14 ? QLatin1String("0") : QLatin1String("1")); + QCOMPARE(item->property("prevSection").toString(), i > 10 ? QLatin1String("0") : QLatin1String("A")); + } +} + void tst_QQuickListView::currentIndex_delayedItemCreation() { QFETCH(bool, setCurrentToZero); diff --git a/tests/auto/quick/qquickrectangle/data/gradient-border.qml b/tests/auto/quick/qquickrectangle/data/gradient-border.qml new file mode 100644 index 0000000000..1d45fb2799 --- /dev/null +++ b/tests/auto/quick/qquickrectangle/data/gradient-border.qml @@ -0,0 +1,21 @@ +import QtQuick 2.0 + +Item { + Rectangle { + width: 100 + height: 100 + border.width: 10 + radius: 10 + + gradient: Gradient { + GradientStop { + position: 0.00 + color: '#ffffff' + } + GradientStop { + position: 0.94 + color: '#000000' + } + } + } +} diff --git a/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp b/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp index 8a24636647..a7e82e272f 100644 --- a/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp +++ b/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp @@ -35,6 +35,7 @@ #include <QtQml/qqmlengine.h> #include <QtQml/qqmlcomponent.h> +#include <QtQuick/qquickview.h> #include <private/qquickrectangle_p.h> #include "../../shared/util.h" @@ -47,6 +48,7 @@ public: private slots: void gradient(); + void gradient_border(); void antialiasing(); private: @@ -88,6 +90,15 @@ void tst_qquickrectangle::gradient() delete rect; } +void tst_qquickrectangle::gradient_border() +{ + QQuickView view; + view.setSource(testFileUrl("gradient-border.qml")); + view.show(); + + QVERIFY(QTest::qWaitForWindowExposed(&view)); +} + void tst_qquickrectangle::antialiasing() { QQmlComponent component(&engine); diff --git a/tests/manual/scenegraph_lancelot/data/text/text_emoji.qml b/tests/manual/scenegraph_lancelot/data/text/text_emoji.qml new file mode 100644 index 0000000000..d50f6d6715 --- /dev/null +++ b/tests/manual/scenegraph_lancelot/data/text/text_emoji.qml @@ -0,0 +1,45 @@ +import QtQuick 2.0 + +Item { + width: 320 + height: 480 + + Component { + id: component + Column { + property variant listModel: model + Repeater { + model: [Text.NativeRendering, Text.QtRendering] + Rectangle { + width: text.implicitWidth + height: text.implicitHeight + color: listModel.backGroundColor ? listModel.backGroundColor : "white" + + Text { + id: text + font.pixelSize: 32 + renderType: modelData + text: "e😃m😇o😍j😜i😸!" + + color: listModel.color ? listModel.color : "black" + opacity: listModel.opacity ? listModel.opacity : 1.0 + } + } + } + } + } + + Column { + anchors.centerIn: parent + Repeater { + model: ListModel { + ListElement { color: "black" } + ListElement { color: "blue" } + ListElement { color: "#990000ff" } + ListElement { opacity: 0.5 } + ListElement { backGroundColor: "green" } + } + delegate: component + } + } +} |