From aca950e43a25f4b80707ff4e2f17d71aef441d52 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 22 Jan 2018 10:58:06 +0100 Subject: Control: fix background size regression caused by deferred execution Task-number: QTBUG-65880 Change-Id: Ic4f9fb087f4a78bd4c6257828011240186b6b22e Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_popup.qml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/auto/controls/data/tst_popup.qml b/tests/auto/controls/data/tst_popup.qml index bec50ad0..1f3a097f 100644 --- a/tests/auto/controls/data/tst_popup.qml +++ b/tests/auto/controls/data/tst_popup.qml @@ -1253,4 +1253,12 @@ TestCase { control.open() verify(control.visible) } + + function test_deferredBackgroundSize() { + var control = createTemporaryObject(popupControl, testCase, {width: 200, height: 100}) + verify(control) + + compare(control.background.width, 200) + compare(control.background.height, 100) + } } -- cgit v1.2.3 From 0dbbfc2f2824aa3891fde0b219fb4951e94a64c9 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 22 Jan 2018 11:32:48 +0100 Subject: Fix Action shortcuts in Repeater QQuickRepeater does not set a QObject-parent, so make QQuickShortcutContext::matcher() start from the object itself and if no window is found, then iterate to the QObject parents. Task-number: QTBUG-65889 Change-Id: I30a1ed0616edd002abcf28d1b8dc7e2d87e99c13 Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_action.qml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'tests') diff --git a/tests/auto/controls/data/tst_action.qml b/tests/auto/controls/data/tst_action.qml index 7d057c26..35e65202 100644 --- a/tests/auto/controls/data/tst_action.qml +++ b/tests/auto/controls/data/tst_action.qml @@ -137,4 +137,32 @@ TestCase { keyClick(Qt.Key_B, Qt.ControlModifier) compare(container.lastSource, container.action) } + + Component { + id: actionAndRepeater + Item { + property alias action: testAction + Action { + id: testAction + shortcut: "Ctrl+A" + } + Repeater { + model: 1 + Button { + action: testAction + } + } + } + } + + function test_repeater() { + var container = createTemporaryObject(actionAndRepeater, testCase) + verify(container) + + var spy = signalSpy.createObject(container, {target: container.action, signalName: "triggered"}) + verify(spy.valid) + + keyClick(Qt.Key_A, Qt.ControlModifier) + compare(spy.count, 1) + } } -- cgit v1.2.3 From b500fbfb5b24f24f6cb3cb02981726fb858287ce Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Mon, 22 Jan 2018 13:10:11 +0100 Subject: Fix test_itemsCorrectlyPositioned() failure Ensure that "moving" is false before comparing the y position of the delegate item. Change-Id: Ie23e86c1f89180c5afca3a48b9361a82635d5e39 Reviewed-by: J-P Nurmi Reviewed-by: Qt CI Bot --- tests/auto/controls/data/tst_tumbler.qml | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/auto/controls/data/tst_tumbler.qml b/tests/auto/controls/data/tst_tumbler.qml index 03908566..058cbeca 100644 --- a/tests/auto/controls/data/tst_tumbler.qml +++ b/tests/auto/controls/data/tst_tumbler.qml @@ -349,6 +349,7 @@ TestCase { verify(firstItem); // Test QTBUG-40298. actualPos = testCase.mapFromItem(firstItem, 0, 0); + tryCompare(tumbler, "moving", false); fuzzyCompare(actualPos.x, tumbler.leftPadding, 0.0001); fuzzyCompare(actualPos.y, tumbler.topPadding, 0.0001); -- cgit v1.2.3 From c3858bd53974e486e03537d1937deb0020828556 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 24 Jan 2018 13:44:00 +0100 Subject: QQuickComboBox: fix popup's deferred execution Unlike other delegates, such as background and contentItem, popup is not unconditionally executed upon component completion. For performance reasons, its execution is delayed until the popup is needed, that is, the popup is accessed or shown. When the popup is accessed, we use the current completion status via isComponentComplete() to determine whether its execution must be completed immediately, or if we can wait until componentComplete(). However, if the popup was accessed while the combobox itself was being completed (used in ComboBox's bindings), the popup was never completed because isComponentComplete() was still returning false even though the popup was actually being indirectly accessed from componentComplete(). A simple execution order change, to complete the combobox itself before the popup, fixes the problem. Task-number: QTBUG-65962 Change-Id: I4764eb7e273e7f6fa1dab1a65a02b87722ee7cba Reviewed-by: Mitch Curtis --- tests/auto/customization/tst_customization.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests') diff --git a/tests/auto/customization/tst_customization.cpp b/tests/auto/customization/tst_customization.cpp index 3010565c..977bcb61 100644 --- a/tests/auto/customization/tst_customization.cpp +++ b/tests/auto/customization/tst_customization.cpp @@ -481,6 +481,20 @@ void tst_customization::comboPopup() QTest::mouseClick(&window, Qt::LeftButton, Qt::NoModifier, QPoint(1, 1)); QVERIFY(qt_createdQObjects()->contains("combobox-popup-simple")); } + + reset(); + + { + // test that ComboBox::popup is completed upon component completion (if appropriate) + QQmlComponent component(engine); + component.setData("import QtQuick 2.9; import QtQuick.Controls 2.2; ComboBox { id: control; contentItem: Item { visible: !control.popup.visible } popup: Popup { property bool wasCompleted: false; Component.onCompleted: wasCompleted = true } }", QUrl()); + QScopedPointer comboBox(qobject_cast(component.create())); + QVERIFY(comboBox); + + QObject *popup = comboBox->property("popup").value(); + QVERIFY(popup); + QCOMPARE(popup->property("wasCompleted"), QVariant(true)); + } } QTEST_MAIN(tst_customization) -- cgit v1.2.3 From 3ca1bde1e34bbe4deba2c3344da790d632252e17 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 25 Jan 2018 13:43:35 +0100 Subject: tst_qquickiconimage: skip tests that grabToImage() on offscreen platforms The LinuxQEMUarm64GCC and LinuxQEMUarmv7GCC CI platform fails because they use QT_QPA_PLATFORM=offscreen, and grabToImage() doesn't work on offscreen platforms. Task-number: QTBUG-63185 Task-number: QTBUG-65975 Change-Id: I037110408bd7b676d6ca142808774b29d1aa749f Reviewed-by: Sami Nurmenniemi Reviewed-by: J-P Nurmi Reviewed-by: Liang Qi --- tests/auto/qquickiconimage/tst_qquickiconimage.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/auto/qquickiconimage/tst_qquickiconimage.cpp b/tests/auto/qquickiconimage/tst_qquickiconimage.cpp index 77b860a2..1dab0784 100644 --- a/tests/auto/qquickiconimage/tst_qquickiconimage.cpp +++ b/tests/auto/qquickiconimage/tst_qquickiconimage.cpp @@ -406,6 +406,9 @@ void tst_qquickiconimage::color() { SKIP_IF_DPR_TOO_HIGH(); + if (QGuiApplication::platformName() == QLatin1String("offscreen")) + QSKIP("grabToImage() doesn't work on the \"offscreen\" platform plugin (QTBUG-63185)"); + QQuickView view(testFileUrl("color.qml")); QCOMPARE(view.status(), QQuickView::Ready); view.show(); @@ -461,6 +464,9 @@ void tst_qquickiconimage::fileSelectors() { SKIP_IF_DPR_TOO_HIGH(); + if (QGuiApplication::platformName() == QLatin1String("offscreen")) + QSKIP("grabToImage() doesn't work on the \"offscreen\" platform plugin (QTBUG-63185)"); + QQuickView view; QQmlFileSelector* fileSelector = new QQmlFileSelector(view.engine()); fileSelector->setExtraSelectors(QStringList() << "testselector"); @@ -503,6 +509,9 @@ public: // don't crash (QTBUG-63959) void tst_qquickiconimage::imageProvider() { + if (QGuiApplication::platformName() == QLatin1String("offscreen")) + QSKIP("grabToImage() doesn't work on the \"offscreen\" platform plugin (QTBUG-63185)"); + QQuickView view; view.engine()->addImageProvider("provider", new TestImageProvider); view.setSource(testFileUrl("imageProvider.qml")); -- cgit v1.2.3 From ac6f4903aeb2e8399b5aa538b35a760f0392568c Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Thu, 25 Jan 2018 19:52:28 +0100 Subject: tst_qquickiconlabel: skip colorChanges() that grabToImage() on offscreen platforms The LinuxQEMUarm64GCC and LinuxQEMUarmv7GCC CI platform fails because they use QT_QPA_PLATFORM=offscreen, and grabToImage() doesn't work on offscreen platforms. Task-number: QTBUG-63185 Change-Id: Ifac43dfa26182e3b518397fa070bb4d4a62114e0 Reviewed-by: Sami Nurmenniemi Reviewed-by: Liang Qi --- tests/auto/qquickiconlabel/tst_qquickiconlabel.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/auto/qquickiconlabel/tst_qquickiconlabel.cpp b/tests/auto/qquickiconlabel/tst_qquickiconlabel.cpp index a251b471..1f00d8e7 100644 --- a/tests/auto/qquickiconlabel/tst_qquickiconlabel.cpp +++ b/tests/auto/qquickiconlabel/tst_qquickiconlabel.cpp @@ -295,6 +295,9 @@ void tst_qquickiconlabel::emptyIconSource() void tst_qquickiconlabel::colorChanges() { + if (QGuiApplication::platformName() == QLatin1String("offscreen")) + QSKIP("grabToImage() doesn't work on the \"offscreen\" platform plugin (QTBUG-63185)"); + QQuickView view(testFileUrl("colorChanges.qml")); QCOMPARE(view.status(), QQuickView::Ready); view.show(); -- cgit v1.2.3