diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-07-10 11:14:42 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-07-10 12:39:52 +0000 |
commit | 58c988e090bac094e8c2e8b77975c1c720725a6e (patch) | |
tree | 6100f317fc1a8a8c15e20154506f39411724a78e /src/quick/items/qquicktableview.cpp | |
parent | 04e7882fc2044020f98c9f6507429a47981f222b (diff) |
TableView: remove row and column from attached object
TableView.row and TableView.column is no different from the row
and column properties that are injected into the context from the
model classes. So just remove them to not bloat the API.
This attached properties where added at an early stage where we
thought that it should be possible to set a different row and
column count on the view than compared to the model (to e.g to
"fake" a table layout when just assigning an integer as a model).
Also, we consider supporting right-to-left etc, where we might
end up with cells that have a different row/column in the view
compared to where the cell is in the model. If we decide to
do this later (not for the first release), we can consider
adding the attached properties back again at that point.
Change-Id: I588a45913b968db789978339bc9a63cd2ccfad49
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quick/items/qquicktableview.cpp')
-rw-r--r-- | src/quick/items/qquicktableview.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp index 0485f7c7b8..26aa409cec 100644 --- a/src/quick/items/qquicktableview.cpp +++ b/src/quick/items/qquicktableview.cpp @@ -1201,16 +1201,7 @@ void QQuickTableViewPrivate::initItemCallback(int modelIndex, QObject *object) if (!attached) return; - // Even though row and column is injected directly into the context of a delegate item - // from QQmlDelegateModel and its model classes, they will only return which row and - // column an item represents in the model. This might be different from which - // cell an item ends up in in the Table, if a different rows/columns has been set - // on it (which is typically the case for list models). For those cases, Table.row - // and Table.column can be helpful. - QPoint cell = cellAtModelIndex(modelIndex); attached->setTableView(q_func()); - attached->setColumn(cell.x()); - attached->setRow(cell.y()); } void QQuickTableViewPrivate::modelUpdated(const QQmlChangeSet &changeSet, bool reset) |