aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicklistview/data
diff options
context:
space:
mode:
authorDan Vrátil <dan@progdan.cz>2014-07-29 11:11:11 +0200
committerAlbert Astals Cid <albert.astals@canonical.com>2014-07-30 13:17:35 +0200
commit47ffb30a69285d6ced1287f14ff5842a298e60e0 (patch)
tree9f83fcf67d3d0baa9400a0452bd867000a959a97 /tests/auto/quick/qquicklistview/data
parent872008a0e053d739636e4ad8ecbbc941b3fdc99d (diff)
Fix QQmlDelegateModel getting out of sync
Fixes a regression introduced by a0aefe1, which caused that the source data model and adaptorModel could sometimes get out of sync. Change-Id: Ia6b5fc380cc6cf6549ae857e6da54e088a5dadb5 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
Diffstat (limited to 'tests/auto/quick/qquicklistview/data')
-rw-r--r--tests/auto/quick/qquicklistview/data/layoutChangeSort.qml58
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/data/layoutChangeSort.qml b/tests/auto/quick/qquicklistview/data/layoutChangeSort.qml
new file mode 100644
index 0000000000..e54f164e45
--- /dev/null
+++ b/tests/auto/quick/qquicklistview/data/layoutChangeSort.qml
@@ -0,0 +1,58 @@
+import QtQuick 2.0
+import QtQml.Models 2.1
+
+Rectangle {
+ id: root
+ width: 240
+ height: 320
+ color: "#ffffff"
+
+
+ Component {
+ id: myDelegate
+ Rectangle {
+ id: wrapper
+ objectName: "wrapper"
+ height: 20
+ width: 240
+ Text {
+ objectName: "delegateText"
+ text: display
+ }
+ color: ListView.isCurrentItem ? "lightsteelblue" : "white"
+ }
+ }
+
+ DelegateModel {
+ id: delegateModel
+ objectName: "delegateModel"
+ model: testModel
+ delegate: myDelegate
+ }
+
+ ListView {
+ id: list
+ objectName: "listView"
+ model: delegateModel;
+ focus: true
+ anchors.fill: parent
+
+
+ section {
+ property: "SortRole";
+ delegate: Rectangle {
+ width: parent.width;
+ height: 20;
+ color: "steelblue";
+
+ Text {
+ anchors {
+ fill: parent;
+ margins: 5;
+ }
+ text: section;
+ }
+ }
+ }
+ }
+}