aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2018-06-05 15:27:52 +0200
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2018-06-09 16:58:44 +0000
commit6b77f0eb99a33b46000ac66ec297082527009d5d (patch)
tree2baa5ddc9fc57a0feb5fc1ebb6ed08e6d580294f /src/quick
parent7d55fb4029f4cc9bc5e5b4cef7ef5a456d42f83f (diff)
TableView: invalidate the table upon model changes
Even if fine-grained support for model changes is not implemented yet, there is no need to set/unset the model. An invalidate is enough, which will silently trigger a rebuild of the table without emitting signals etc. Change-Id: Id1bed9e0707f8afc3fbc6b457c39686774ff7e82 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquicktableview.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp
index 0db8d69501..8c092c5894 100644
--- a/src/quick/items/qquicktableview.cpp
+++ b/src/quick/items/qquicktableview.cpp
@@ -1218,16 +1218,9 @@ void QQuickTableViewPrivate::modelUpdated(const QQmlChangeSet &changeSet, bool r
{
Q_UNUSED(changeSet);
Q_UNUSED(reset);
- Q_Q(QQuickTableView);
-
- if (!q->isComponentComplete())
- return;
- // Rudimentary solution for now until support for
- // more fine-grained updates and transitions are implemented.
- auto modelVariant = q->model();
- q->setModel(QVariant());
- q->setModel(modelVariant);
+ // TODO: implement fine-grained support for model changes
+ invalidateTable();
}
QQuickTableView::QQuickTableView(QQuickItem *parent)