Details
-
Bug
-
Resolution: Won't Do
-
P3: Somewhat important
-
None
-
6.2.12, 6.5.5-1, 6.7.0
-
Windows 10 22H2, MSVC 2019 x64
Description
Code
import QtQuick import QtQuick.Controls.Basic import Qt.labs.qmlmodels Window { width: 640 height: 480 visible: true TableView { anchors.fill: parent reuseItems: true model: TableModel { id: tableModel TableModelColumn { display: "A" } TableModelColumn { display: "B" } TableModelColumn { display: "C" } } delegate: Rectangle { id: delegate implicitWidth: 100 implicitHeight: 100 border.width: 1 required property string modelData Text { text: delegate.modelData font.pointSize: 18 anchors.centerIn: parent } TableView.onPooled: console.log("Pooled", delegate.modelData) TableView.onReused: console.log("Reused", delegate.modelData) Component.onCompleted: console.log("Constructed", delegate.modelData) Component.onDestruction: console.log("Destroyed", delegate.modelData) } } Component.onCompleted: { let rows = [] for (let i = 0; i < 3; ++i) { rows.push({ "A": `(${i}, 0)`, "B": `(${i}, 1)`, "C": `(${i}, 2)` }) } tableModel.rows = rows } }
Steps to reproduce
- Run the code above
- Shrink the window to be as close to 0x0 as possible
- Enlarge the window again to allow all delegates to fit in the window
Expected outcomes
- Step 2: All delegates get pooled
- Step 3: All delegates get reused
Actual outcomes
- Step 2: All delegates get pooled and then get destroyed
- Step 3: All delegates get re-constructed from scratch
Attachments
Issue Links
- is required for
-
QTBUG-70326 TableView
-
- In Progress
-
- relates to
-
QTBUG-116650 TableView rebuilds the entire table when a single row is added/removed
-
- Reported
-