diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-12-22 13:27:08 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-12-22 14:29:48 +0000 |
commit | 368e8046184f71b31618e49de4f5e49ee20db5f4 (patch) | |
tree | 432e10bf8e32dfba0bc74e09ac2a22b1481df137 | |
parent | c996c22d3b24a56ab93f9f1f6fdf5347b16c0b40 (diff) |
Fix and test deferred execution for Universal & Material
Change-Id: I8ee27a0c65c9ce8c9cc48c6f59d2b34d02849be8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r-- | src/imports/controls/material/Dial.qml | 2 | ||||
-rw-r--r-- | src/imports/controls/material/ScrollBar.qml | 2 | ||||
-rw-r--r-- | src/imports/controls/material/ScrollIndicator.qml | 6 | ||||
-rw-r--r-- | src/imports/controls/universal/ScrollIndicator.qml | 6 | ||||
-rw-r--r-- | tests/auto/customization/tst_customization.cpp | 9 |
5 files changed, 10 insertions, 15 deletions
diff --git a/src/imports/controls/material/Dial.qml b/src/imports/controls/material/Dial.qml index e0632e62..946142f1 100644 --- a/src/imports/controls/material/Dial.qml +++ b/src/imports/controls/material/Dial.qml @@ -57,8 +57,6 @@ T.Dial { } handle: SliderHandle { - id: handleItem - x: background.x + background.width / 2 - handle.width / 2 y: background.y + background.height / 2 - handle.height / 2 transform: [ diff --git a/src/imports/controls/material/ScrollBar.qml b/src/imports/controls/material/ScrollBar.qml index 8374c0f9..3687b550 100644 --- a/src/imports/controls/material/ScrollBar.qml +++ b/src/imports/controls/material/ScrollBar.qml @@ -50,8 +50,6 @@ T.ScrollBar { visible: control.policy !== T.ScrollBar.AlwaysOff contentItem: Rectangle { - id: handle - implicitWidth: control.interactive ? 13 : 4 implicitHeight: control.interactive ? 13 : 4 diff --git a/src/imports/controls/material/ScrollIndicator.qml b/src/imports/controls/material/ScrollIndicator.qml index effb18ad..41e72df6 100644 --- a/src/imports/controls/material/ScrollIndicator.qml +++ b/src/imports/controls/material/ScrollIndicator.qml @@ -49,8 +49,6 @@ T.ScrollIndicator { padding: 2 contentItem: Rectangle { - id: indicator - implicitWidth: 4 implicitHeight: 4 @@ -61,7 +59,7 @@ T.ScrollIndicator { states: State { name: "active" when: control.active - PropertyChanges { target: indicator; opacity: 0.75 } + PropertyChanges { target: control.contentItem; opacity: 0.75 } } transitions: [ @@ -69,7 +67,7 @@ T.ScrollIndicator { from: "active" SequentialAnimation { PauseAnimation { duration: 450 } - NumberAnimation { target: indicator; duration: 200; property: "opacity"; to: 0.0 } + NumberAnimation { target: control.contentItem; duration: 200; property: "opacity"; to: 0.0 } } } ] diff --git a/src/imports/controls/universal/ScrollIndicator.qml b/src/imports/controls/universal/ScrollIndicator.qml index 2f30ebe5..0b6733aa 100644 --- a/src/imports/controls/universal/ScrollIndicator.qml +++ b/src/imports/controls/universal/ScrollIndicator.qml @@ -47,8 +47,6 @@ T.ScrollIndicator { contentItem.implicitHeight + topPadding + bottomPadding) contentItem: Rectangle { - id: indicator - implicitWidth: 6 implicitHeight: 6 @@ -66,13 +64,13 @@ T.ScrollIndicator { transitions: [ Transition { to: "active" - NumberAnimation { target: indicator; property: "opacity"; to: 1.0 } + NumberAnimation { target: control.contentItem; property: "opacity"; to: 1.0 } }, Transition { from: "active" SequentialAnimation { PauseAnimation { duration: 5000 } - NumberAnimation { target: indicator; property: "opacity"; to: 0.0 } + NumberAnimation { target: control.contentItem; property: "opacity"; to: 0.0 } } } ] diff --git a/tests/auto/customization/tst_customization.cpp b/tests/auto/customization/tst_customization.cpp index 24635a61..5c6310ba 100644 --- a/tests/auto/customization/tst_customization.cpp +++ b/tests/auto/customization/tst_customization.cpp @@ -251,7 +251,7 @@ void tst_customization::reset() QObject* tst_customization::createControl(const QString &name, const QString &qml, QString *error) { QQmlComponent component(engine); - component.setData("import QtQuick 2.9; import QtQuick.Controls 2.2; " + name.toUtf8() + " { " + qml.toUtf8() + " }", QUrl()); + component.setData("import QtQuick 2.9; import QtQuick.Window 2.2; import QtQuick.Controls 2.2; " + name.toUtf8() + " { " + qml.toUtf8() + " }", QUrl()); QObject *obj = component.create(); if (!obj) *error = component.errorString(); @@ -356,7 +356,7 @@ void tst_customization::override_data() QTest::newRow(qPrintable("overidentified:" + control.type)) << "identified" << control.type << control.delegates << "identified" << true; // test that the built-in styles don't have undesired IDs in their delegates - const QStringList styles = QStringList() << "Default"; // ### TODO: QQuickStyle::availableStyles(); + const QStringList styles = QStringList() << "Default" << "Material" << "Universal"; // ### TODO: QQuickStyle::availableStyles(); for (const QString &style : styles) { for (const ControlInfo &control : ControlInfos) QTest::newRow(qPrintable(style + ":" + control.type)) << style << control.type << control.delegates << "" << false; @@ -392,8 +392,11 @@ void tst_customization::override() // delegates, no item should get un-parented during the creation process. An item being // unparented means that a delegate got destroyed, so there must be an internal ID in one // of the delegates in the tested style. - if (!identify && nonDeferred.isEmpty()) + if (!identify && nonDeferred.isEmpty()) { + QEXPECT_FAIL("Material:BusyIndicator", "TODO: remove internal ID in the OpacityAnimator", Continue); + QEXPECT_FAIL("Universal:ApplicationWindow", "ApplicationWindow.qml contains an intentionally unparented FocusRectangle", Continue); QCOMPARE(qt_unparentedItemCount, 0); + } // <control>-<style>-override QString controlName = type.toLower() + "-" + style + "-override"; |