aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Arve Sæther <jan-arve.saether@qt.io>2021-06-22 14:35:25 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-06-28 10:39:36 +0000
commit532b3c3ab86b7ffea5da71a9048b95ab43862e05 (patch)
tree9fb596a9ab22198ed132a3a13916aec5419e5c7f
parent15532d350cbd235af0270f09145072aea3f56e71 (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. Fixes: QTBUG-93041 Change-Id: Iba5d1a4365c864f8ff8115383880500feac7bc5d Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 0c2adb5652480f7546fadb78b652a09294c4e646) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/quicknativestyle/items/qquickstyleitem.cpp6
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 *)