Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.5.0 Beta, 5.5.0, 5.5.1, 5.6.0 RC, 5.6.0, 5.7.0, 5.8.0, 5.9.3, 5.10.0
-
e8570bd1af74724b6fae1ac8a2d8bbdfee7a6504
Description
I created a simple example that uses a TreeModel and a TreeView.
The item delegate of the TreeView is expanded automatically in the Component.onCompleted signal handler.
The model is based on the example at http://doc.qt.io/qt-5/qtwidgets-itemviews-simpletreemodel-example.html. The only modifications to the model are in the setup function and in the columnCount function.
The issue is the visualization of weird spaces between the items of the treeview.
See the attached screenshot and sample project for reproducing the bug
However, this has actually nothing to do with TreeView or AbstractItemModel. A plain ListView with a QML ListModel does the same thing:
import QtQuick 2.9 import QtQuick.Window 2.2 Window { width: 640 height: 480 visible: true ListModel { id: listModel ListElement { name: "a" } ListElement { name: "b" } ListElement { name: "c" } ListElement { name: "d" } ListElement { name: "e" } ListElement { name: "f" } ListElement { name: "g" } ListElement { name: "h" } ListElement { name: "i" } ListElement { name: "j" } } ListView { id: treeView anchors.fill: parent model: listModel delegate: Text { text: name Component.onCompleted: { console.log(index, name); if (name.length === 1) { for (var i = 0; i < 10; ++i) listModel.insert(index + 1, {name: name + i}); } } } } }
Mind that the ListModel example is less deterministic, though. Sometimes the gap appears after "b", sometimes after "c" and sometimes not at all.
Attachments
Issue Links
- resulted in
-
QTBUG-83118 QQuickItemView does redundant refill when layout
-
- Closed
-