diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2018-09-12 09:33:47 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2018-09-13 04:57:01 +0000 |
commit | 00afb51baaf0b0398ba7780dec491cf144dad0d9 (patch) | |
tree | 231bc76a2c1726aaa1edd184274cdce48fea625a /src/quick/items/qquicktableview_p.h | |
parent | 22a5630d3c97709b09412dc1037d7dae959bdae5 (diff) |
QQuickTableView: sync model and delegate when ready to do so
Doing (silly) things in the delegate, like:
Component.onCompleted: TableView.view.delegate = null
will lead to a crash. The same if you change the model.
The reason is that you end up changing the model
while e.g a row is half-way loaded. Information needed for
building the row, like model size, will then be invalid.
To protect against this, we insert a "sync" phase to the
code that takes any such changes into effect at a time
when we know it's safe to do so.
Change-Id: I85a992dfc0e04ec6635b10c9768a8ddc140e09da
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quick/items/qquicktableview_p.h')
-rw-r--r-- | src/quick/items/qquicktableview_p.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/quick/items/qquicktableview_p.h b/src/quick/items/qquicktableview_p.h index 6ba91d16a1..45e20027ba 100644 --- a/src/quick/items/qquicktableview_p.h +++ b/src/quick/items/qquicktableview_p.h @@ -128,7 +128,6 @@ Q_SIGNALS: protected: void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; void viewportMoved(Qt::Orientations orientation) override; - void componentComplete() override; private: Q_DISABLE_COPY(QQuickTableView) |