Details
-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
6.10
-
5
-
Foundation Sprint 134
Description
The interaction of complex data and custom setters/getters does not work as documented. This is documented only in the following snippet (https://doc.qt.io/qt-6/qml-qt-labs-qmlmodels-tablemodel.html#supported-row-data-structures):
TableModel { TableModelColumn { display: function(modelIndex) { return rows[modelIndex.row][0].checked } setDisplay: function(modelIndex, cellData) { rows[modelIndex.row][0].checked = cellData } } // ... rows: [ [ { checked: false, checkable: true }, { amount: 1 }, { fruitType: "Apple" }, { fruitName: "Granny Smith" }, { fruitPrice: 1.50 } ] // ... ] }
The getter is tested in tests/auto/qml/qqmltablemodel/data/complex.qml but the setter is not. A quick test showed that it would not work as documented. In fact, it is documented that it does not work to use the rows property to set data.
There might be a way to make it work as shown here: https://codereview.qt-project.org/c/qt/qtdeclarative/+/662049 but it is rather hacky.
Because it does not work and was never tested, it is safe to assume that no Qt user is using the custom setter functionality. Therefore we think it would be ok to remove the setters, which were never documented in depth anyway (https://doc.qt.io/qt-6/qml-qt-labs-qmlmodels-tablemodelcolumn.html). The custom getters and the complex data can stay as they seem to work and provide value.
Improve the documentation of TableModelColumn when we're at it.
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-138553 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
662281,2 | Remove support of manipulation of complex rows in QQmlTableModel | dev | qt/qtdeclarative | Status: NEW | 0 | 0 |
662282,2 | Remove support of manipulation of complex rows in QQmlTreeModel | dev | qt/qtdeclarative | Status: NEW | 0 | 0 |