diff options
author | Jan Arve Sæther <jan-arve.saether@qt.io> | 2021-06-22 14:35:25 +0200 |
---|---|---|
committer | Jan Arve Sæther <jan-arve.saether@qt.io> | 2021-06-28 10:27:17 +0200 |
commit | 0c2adb5652480f7546fadb78b652a09294c4e646 (patch) | |
tree | 1004256d08906de933c573fc2a08ca6b44b68a08 | |
parent | 51946cf0ce9f3bd1569187ea35d2df5e89d7bdbf (diff) |
Native style: Do not assert
When a component (e.g. Button) is used as a delegate in ListView, we
might get a updatePolish() before the component is completed.
Make sure we don't call polish() before we are completed.
Pick-to: 6.1 6.2
Fixes: QTBUG-93041
Change-Id: Iba5d1a4365c864f8ff8115383880500feac7bc5d
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r-- | src/quicknativestyle/items/qquickstyleitem.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/quicknativestyle/items/qquickstyleitem.cpp b/src/quicknativestyle/items/qquickstyleitem.cpp index 23f290d3..ec041d01 100644 --- a/src/quicknativestyle/items/qquickstyleitem.cpp +++ b/src/quicknativestyle/items/qquickstyleitem.cpp @@ -124,13 +124,15 @@ void QQuickStyleItem::connectToControl() const void QQuickStyleItem::markImageDirty() { m_dirty.setFlag(DirtyFlag::Image); - polish(); + if (isComponentComplete()) + polish(); } void QQuickStyleItem::markGeometryDirty() { m_dirty.setFlag(DirtyFlag::Geometry); - polish(); + if (isComponentComplete()) + polish(); } QSGNode *QQuickStyleItem::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePaintNodeData *) |