aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicktableview/testmodel.h
Commit message (Collapse)AuthorAgeFilesLines
* TableView: connect to 'layoutChanged' signal from the modelRichard Moe Gustavsen2018-10-171-2/+12
| | | | | | | | Ensure we rebuild the table when the model emits 'layoutChanged'. Fixes: QTBUG-71140 Change-Id: I70dac897830bf5a12ae6987920e388743fd358a1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQmlAdaptorModel: return correct column count from the modelRichard Moe Gustavsen2018-10-171-0/+1
| | | | | | | | | | | There is no reason for QQmlAdaptorModel to return the wrong column count to the view. For models that are not QAIM, the accessor that wraps the model will report the column count to be 1 anyway. The same is also true for QAbstractListModel. Change-Id: Ia259b044201d76743e5f43d9f0999d3848912075 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQuickTableView: don't overwrite rebuildStateRichard Moe Gustavsen2018-08-231-0/+5
| | | | | | | | | | Since it's fully possible to end up calling invalidateTable() while in the process of rebuilding the table, we need to ensure that we don't mess with the current rebuildState. Instead, just schedule that we need to rebuild once more later. Change-Id: If27bb14f0bc9f72c53eb47e6115d7ad580cdb516 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QQmlTableInstanceModel: handle model data changes more gracefullyRichard Moe Gustavsen2018-08-021-10/+19
| | | | | | | | | | | | | Equal to QQmlDelegateModel, we need to listen for changes done to existing model items, and notify existing delegate items about it. Otherwise, they will not stay in sync with the model. By accident, this sort of worked in QQuickTableView already, since it would rebuild the whole table for every model update. This is really slow, and completely unnecessary. Change-Id: I10750ff387f8b455d0f27c50a17926d9beb6dd03 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tst_qquicktableview: actually test that model is resetMitch Curtis2018-07-191-0/+7
| | | | | | | | I added the test but didn't call beginResetModel()/endResetModel()... whoops. Change-Id: Ia74a83562c2df689b4bbc00df1b7181b40e82d87 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* TableView: invalidate table when model is resetMitch Curtis2018-07-171-0/+44
| | | | | | | | Signals like rowsInserted() were already accounted for in QQuickTableViewPrivate::connectToModel(), but modelReset() was not. Change-Id: I6b8248d745d507d4ea846e9bee717182915792b3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QQmlDelegateModelItem: move row and column up to the base classRichard Moe Gustavsen2018-06-091-1/+1
| | | | | | | | | | | | | | | | Change 8c33c70 injected row and column (alongside index) into the QML context of a delegate when the view had a QAbstractItemModel as model. Rather than only inject those properties when using QAIM, this patch will move the code to the base class. This way, if a view uses e.g a javascript list as model, row and column is still be available. This is useful, since then the delegate can bind to both row and column regardless of what kind of model the view uses. In the case of a list model, the column property will always be 0. Change-Id: I1d9f11c0b7d7a5beb83198184ba12cc1e48cd100 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* tests, qquicktableview: check that the expected number of delegate items are ↵Richard Moe Gustavsen2018-05-091-0/+2
| | | | | | | created Change-Id: I96bc282a6678954d73cf5a15241ac30f43964dcb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Revert "tests, qquicktableview: add countDelegateItems()"Lars Knoll2018-05-021-2/+0
| | | | | | | | | This reverts commit 1cfd61f63609c4930db6130d2f63f678c420762d. The commit came in during a time where tests aren't run, and fails at least on some of our linux platforms. Change-Id: Idd5c68b0fdec06ca93a9bab9604ad64974ee00e3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* tests, qquicktableview: add countDelegateItems()Richard Moe Gustavsen2018-04-271-0/+2
| | | | | Change-Id: I1794a46b697467af152a6346fa7d7b5d0ce31807 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* test, TableView: add boilerplate code for testing TableViewRichard Moe Gustavsen2018-04-251-0/+87
Change-Id: I4d68e033074442c402df11f779b6875e80ec6412 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>