aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2020-09-10 14:35:00 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-09-15 10:40:27 +0000
commit50f3c1b5551228d932f302a06580c70a3a77c336 (patch)
tree5ca2291182a949d02dd84699d01f18b96dc29448
parent454ca2f441ae3d400255471a7ebe850c6779ad0e (diff)
Unregister the accessible observer before deleting the private object
By unregistering it in the destructor of the control and not the private object ensures that it does not react to any accessibility changes. This prevents any problems arising due to changes coming when the private object is deleted. Change-Id: Icce0cc0cff54ce35ddf6be74e32bb0bdeff6d0fc Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 60d798f2a445552165fae3e622129f5356f61a0b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/quicktemplates2/qquickcontrol.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/quicktemplates2/qquickcontrol.cpp b/src/quicktemplates2/qquickcontrol.cpp
index 64260401..bbbd0e62 100644
--- a/src/quicktemplates2/qquickcontrol.cpp
+++ b/src/quicktemplates2/qquickcontrol.cpp
@@ -158,9 +158,6 @@ QQuickControlPrivate::QQuickControlPrivate()
QQuickControlPrivate::~QQuickControlPrivate()
{
-#if QT_CONFIG(accessibility)
- QAccessible::removeActivationObserver(this);
-#endif
}
void QQuickControlPrivate::init()
@@ -968,6 +965,9 @@ QQuickControl::~QQuickControl()
Q_D(QQuickControl);
d->removeImplicitSizeListener(d->background, QQuickControlPrivate::ImplicitSizeChanges | QQuickItemPrivate::Geometry);
d->removeImplicitSizeListener(d->contentItem);
+#if QT_CONFIG(accessibility)
+ QAccessible::removeActivationObserver(d);
+#endif
}
void QQuickControl::itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &value)