diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2018-01-16 15:22:40 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2018-01-17 14:22:18 +0000 |
commit | da7d894deb4cc36155ade5e6a1ebecc3262363f8 (patch) | |
tree | 9b8337edd90dbdf2e4601a025cd2c72161e15a44 /tests/auto/controls/data/TumblerListView.qml | |
parent | d61567f3cfa100aeab865bd6b436de87970575f5 (diff) |
Make Tumbler compatible with deferred execution
Now that the contentItem is created at a different stage, we
have to shuffle some code around and add some null checks.
Task-number: QTBUG-50992
Change-Id: I34d3a9ea9cb9ab54008a1015b37b1666538c085e
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/auto/controls/data/TumblerListView.qml')
-rw-r--r-- | tests/auto/controls/data/TumblerListView.qml | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/auto/controls/data/TumblerListView.qml b/tests/auto/controls/data/TumblerListView.qml index 4e71f471..1248bec0 100644 --- a/tests/auto/controls/data/TumblerListView.qml +++ b/tests/auto/controls/data/TumblerListView.qml @@ -49,15 +49,21 @@ ****************************************************************************/ import QtQuick 2.6 +import QtQuick.Controls 2.2 ListView { anchors.fill: parent - model: parent.model - delegate: parent.delegate - snapMode: ListView.SnapToItem highlightRangeMode: ListView.StrictlyEnforceRange preferredHighlightBegin: height / 2 - (height / parent.visibleItemCount / 2) preferredHighlightEnd: height / 2 + (height / parent.visibleItemCount / 2) clip: true + model: parent.model + delegate: Text { + objectName: text + text: "Custom" + modelData + opacity: 1.0 - Math.abs(Tumbler.displacement) / (Tumbler.tumbler.visibleItemCount / 2) + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } } |