From 692c0d3526b4bd5e5b17e17b4a6547046c2bfcbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= Date: Mon, 16 Jun 2014 14:10:09 +0200 Subject: Fix QQmlDelegateModel ignoring layoutChange in certain situations Fix a regression introduced by commit a0aefe1 which caused the model to ignore layout changes if d->m_adaptorModel.rootIndex was just a descendant of any of the parent indexes, or when no parent indexes at all were provided in the notification. Task-number: QTBUG-39492 Change-Id: I4c97929d25ef75947ccfcbbe5bc234096689c58d Reviewed-by: Alan Alpert --- .../auto/quick/qquicklistview/data/qtbug39492.qml | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tests/auto/quick/qquicklistview/data/qtbug39492.qml (limited to 'tests/auto/quick/qquicklistview/data') diff --git a/tests/auto/quick/qquicklistview/data/qtbug39492.qml b/tests/auto/quick/qquicklistview/data/qtbug39492.qml new file mode 100644 index 0000000000..4df3a080d7 --- /dev/null +++ b/tests/auto/quick/qquicklistview/data/qtbug39492.qml @@ -0,0 +1,40 @@ +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 + } +} -- cgit v1.2.3