diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-12-19 14:47:09 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-12-20 17:37:20 +0000 |
commit | b94cb52c8b03511a2549469dfed33c6e0e857021 (patch) | |
tree | ca5b55762740c79f63f17f4d1204202a0dc4babb | |
parent | 4367be99cc89c733b8667a30c8a82dac21ba08bb (diff) |
Default: cleanup and test internal IDs
Remove the undesired internal IDs where easily possible, and
add expected failures for the harder ones for now.
Task-number: QTBUG-65341
Change-Id: I5964b2cb59652661c90141259c68b95c721cf6ca
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r-- | src/imports/controls/Dial.qml | 1 | ||||
-rw-r--r-- | src/imports/controls/ScrollBar.qml | 6 | ||||
-rw-r--r-- | src/imports/controls/ScrollIndicator.qml | 6 | ||||
-rw-r--r-- | tests/auto/customization/tst_customization.cpp | 14 |
4 files changed, 18 insertions, 9 deletions
diff --git a/src/imports/controls/Dial.qml b/src/imports/controls/Dial.qml index affcfa62..0bd2f163 100644 --- a/src/imports/controls/Dial.qml +++ b/src/imports/controls/Dial.qml @@ -54,7 +54,6 @@ T.Dial { } handle: Image { - id: handleItem x: background.x + background.width / 2 - handle.width / 2 y: background.y + background.height / 2 - handle.height / 2 width: 14 diff --git a/src/imports/controls/ScrollBar.qml b/src/imports/controls/ScrollBar.qml index 79e3e1ee..3e763550 100644 --- a/src/imports/controls/ScrollBar.qml +++ b/src/imports/controls/ScrollBar.qml @@ -51,8 +51,6 @@ T.ScrollBar { visible: control.policy !== T.ScrollBar.AlwaysOff contentItem: Rectangle { - id: handle - implicitWidth: control.interactive ? 6 : 2 implicitHeight: control.interactive ? 6 : 2 @@ -63,14 +61,14 @@ T.ScrollBar { states: State { name: "active" when: control.policy === T.ScrollBar.AlwaysOn || (control.active && control.size < 1.0) - PropertyChanges { target: handle; opacity: 0.75 } + PropertyChanges { target: control.contentItem; opacity: 0.75 } } transitions: Transition { from: "active" SequentialAnimation { PauseAnimation { duration: 450 } - NumberAnimation { target: handle; duration: 200; property: "opacity"; to: 0.0 } + NumberAnimation { target: control.contentItem; duration: 200; property: "opacity"; to: 0.0 } } } } diff --git a/src/imports/controls/ScrollIndicator.qml b/src/imports/controls/ScrollIndicator.qml index 12ec2d40..8607c8d4 100644 --- a/src/imports/controls/ScrollIndicator.qml +++ b/src/imports/controls/ScrollIndicator.qml @@ -50,8 +50,6 @@ T.ScrollIndicator { padding: 2 contentItem: Rectangle { - id: indicator - implicitWidth: 2 implicitHeight: 2 @@ -62,7 +60,7 @@ T.ScrollIndicator { states: State { name: "active" when: control.active - PropertyChanges { target: indicator; opacity: 0.75 } + PropertyChanges { target: control.contentItem; opacity: 0.75 } } transitions: [ @@ -70,7 +68,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/tests/auto/customization/tst_customization.cpp b/tests/auto/customization/tst_customization.cpp index 10525e9e..e975e546 100644 --- a/tests/auto/customization/tst_customization.cpp +++ b/tests/auto/customization/tst_customization.cpp @@ -131,6 +131,7 @@ typedef QHash<QObject *, QString> QObjectNameHash; Q_GLOBAL_STATIC(QObjectNameHash, qt_objectNames) Q_GLOBAL_STATIC(QStringList, qt_createdQObjects) Q_GLOBAL_STATIC(QStringList, qt_destroyedQObjects) +Q_GLOBAL_STATIC(QStringList, qt_destroyedParentQObjects) extern "C" Q_DECL_EXPORT void qt_addQObject(QObject *object) { @@ -152,6 +153,13 @@ extern "C" Q_DECL_EXPORT void qt_removeQObject(QObject *object) if (!objectName.isEmpty()) qt_destroyedQObjects()->append(objectName); qt_objectNames()->remove(object); + + QObject *parent = object->parent(); + if (parent) { + QString parentName = parent->objectName(); + if (!parentName.isEmpty()) + qt_destroyedParentQObjects()->append(parentName); + } } void tst_customization::init() @@ -179,6 +187,7 @@ void tst_customization::reset() { qt_createdQObjects()->clear(); qt_destroyedQObjects()->clear(); + qt_destroyedParentQObjects()->clear(); } QObject* tst_customization::createControl(const QString &name, QString *error) @@ -247,6 +256,11 @@ void tst_customization::creation() QVERIFY2(qt_createdQObjects()->isEmpty(), qPrintable("unexpectedly created: " + qt_createdQObjects->join(", "))); QVERIFY2(qt_destroyedQObjects()->isEmpty(), qPrintable("unexpectedly destroyed: " + qt_destroyedQObjects->join(", ") + " were unexpectedly destroyed")); + + QEXPECT_FAIL("Default:BusyIndicator", "TODO: remove internal IDs", Abort); + QEXPECT_FAIL("Default:DelayButton", "TODO: remove internal IDs", Abort); + + QVERIFY2(qt_destroyedParentQObjects()->isEmpty(), qPrintable("delegates/children of: " + qt_destroyedParentQObjects->join(", ") + " were unexpectedly destroyed")); } void tst_customization::comboPopup() |