Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.1
-
None
-
82d0d8321 (dev), 17f5777e6 (6.6), 5f0f2da91 (6.5)
Description
I have recently switched from Qt 5.15 to Qt 6.5 and doing so, I had to use the Quick.Controls 2 TableView.
When trying to do this kind of thing:
TableView { id: tableView anchors.fill: parent leftMargin: checkColumn.width clip: true model: TableModel { TableModelColumn { display: "name" } rows: [{ "name": "Harry" }, { "name": "Hedwig" }] } selectionModel: ItemSelectionModel { model: tableView.model } delegate: Rectangle { implicitWidth: 100 implicitHeight: 30 color: selected ? "blue" : "lightgray" required property bool selected Text { text: display } } } VerticalHeaderView { id: checkColumn parent: tableView syncView: tableView selectionModel: tableView.selectionModel boundsBehavior: tableView.boundsBehavior delegate: CheckBox { required property int row required property bool selected onRowChanged: console.log("onRowChanged", row, selected) onSelectedChanged: console.log("onSelectedChanged", row, selected) checked: selected onToggled: tableView.selectionModel.select(tableView.model.index(row, 0), ItemSelectionModel.Toggle | ItemSelectionModel.Rows) } }
I realised that the "required property int row" in the checkbox is reupdated on every item loaded in the header as soon as 1 item is flicked outside the view, and required property bool selected changes to false without even emiting any signals (I can see it through the checkbox that is unselected) though there is selected indexes in the ItemSelectionModel. But this does not appens int the main TableView.