-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5.9, 6.8.4, 6.9.1, 6.10.0 Beta2
The attached project adds a new row to a QStringListModel subclass every second. The same model is attached to both a ListView and TableView.
- In the ListView, users are able to activate the DelayButton (Expected)
- In the TableView, users can never activate the DelayButton. All attempts get cancelled whenever a new row is added, and the cancellation is usually accompanied with a visual glitch (Not Expected)
Code
import QtQuick import QtQuick.Controls.Basic import TableViewControlsStudy ApplicationWindow { width: 640 height: 480 visible: true MyStringListModel { id: stringModel } Component { id: dlg_comp DelayButton { required property var modelData text: modelData.display delay: 1250 } } header: Row { Label { width: parent.width/2 text: "ListView" } Label { width: parent.width/2 text: "TableView" } } ListView { anchors.fill: parent anchors.rightMargin: parent.width/2 model: stringModel delegate: dlg_comp } TableView { anchors.fill: parent anchors.leftMargin: parent.width/2 model: stringModel delegate: dlg_comp } Timer { interval: 1000 running: true repeat: true onTriggered: stringModel.appendOne() } }
Analysis
The root cause is QTBUG-116723/QTBUG-116650. Aside from simply being computationally wasteful, this bug breaks GUIs.
- duplicates
-
QTBUG-116650 TableView rebuilds the entire table when a single row is added/removed
-
- In Progress
-
- resulted from
-
QTBUG-116650 TableView rebuilds the entire table when a single row is added/removed
-
- In Progress
-
-
QTBUG-116723 TableView + TableModel discards every delegate with every update
-
- Closed
-