summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Strømme <christian.stromme@theqtcompany.com>2015-06-09 17:15:45 +0200
committerJani Heikkinen <jani.heikkinen@theqtcompany.com>2015-06-10 03:59:45 +0000
commitb4dc4a98d5deffbbb30f7011f6c0d3d10f430b98 (patch)
tree9d4c935f4da305305caf2099fb39ed24ec895374
parent298bb1966b959df04bbc43e230db41451f8ad96f (diff)
downloadqtquickcontrols-5.5.0.tar.gz
Fix crash caused by wrongly asserting in the scene position listener.v5.5.0-rc1v5.5.05.5.0
When clicking the back button in a textfield we would wrongly trigger two different asserts. One because the items parent changed, which is possible, and another when both item and child/parent item was null. Task-number: QTBUG-46573 Change-Id: Ia5fae95d31919de81a81ab6ef1304ea1e5ae9d60 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
-rw-r--r--src/controls/Private/qquicksceneposlistener.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/controls/Private/qquicksceneposlistener.cpp b/src/controls/Private/qquicksceneposlistener.cpp
index d6155fe1..6bcc1deb 100644
--- a/src/controls/Private/qquicksceneposlistener.cpp
+++ b/src/controls/Private/qquicksceneposlistener.cpp
@@ -128,8 +128,6 @@ void QQuickScenePosListener::itemGeometryChanged(QQuickItem *, const QRectF &, c
void QQuickScenePosListener::itemParentChanged(QQuickItem *, QQuickItem *parent)
{
- Q_ASSERT(m_item == parent);
-
addAncestorListeners(parent);
}
@@ -165,7 +163,8 @@ void QQuickScenePosListener::updateScenePos()
*/
void QQuickScenePosListener::removeAncestorListeners(QQuickItem *item)
{
- Q_ASSERT(item != m_item);
+ if (item == m_item)
+ return;
QQuickItem *p = item;
while (p != 0) {
@@ -181,7 +180,8 @@ void QQuickScenePosListener::removeAncestorListeners(QQuickItem *item)
*/
void QQuickScenePosListener::addAncestorListeners(QQuickItem *item)
{
- Q_ASSERT(item != m_item);
+ if (item == m_item)
+ return;
QQuickItem *p = item;
while (p != 0) {