diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-08-17 18:16:41 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-08-18 12:01:24 +0000 |
commit | 7c07c60ff17974621fea932a18cc2e652d17ab78 (patch) | |
tree | 3644adcc9cb1f4862a0fc4d9411d38ddb219a83a /src/quicktemplates2/qquickpopup_p_p.h | |
parent | 1fbc51b4f285692206a4c0cdf132963638919e6e (diff) |
QQuickPopup: don't keep a reference to a destroyed parent
Move the itemDestroyed() listener from QQuickPopupPositioner, which is
only active while the popup is visible, to QQuickPopupPrivate instead.
This way the popup gets a notification when the parent gets destroyed
while the popup is hidden.
Task-number: QTBUG-55347
Change-Id: Ic72206cc05996c23062e814799a030c369fc6288
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickpopup_p_p.h')
-rw-r--r-- | src/quicktemplates2/qquickpopup_p_p.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quicktemplates2/qquickpopup_p_p.h b/src/quicktemplates2/qquickpopup_p_p.h index ee9c83d5..80cb8522 100644 --- a/src/quicktemplates2/qquickpopup_p_p.h +++ b/src/quicktemplates2/qquickpopup_p_p.h @@ -136,7 +136,6 @@ protected: void itemGeometryChanged(QQuickItem *, const QRectF &, const QRectF &) override; void itemParentChanged(QQuickItem *, QQuickItem *parent) override; void itemChildRemoved(QQuickItem *, QQuickItem *child) override; - void itemDestroyed(QQuickItem *item) override; private: void removeAncestorListeners(QQuickItem *item); @@ -148,7 +147,7 @@ private: QQuickPopupPrivate *m_popup; }; -class QQuickPopupPrivate : public QObjectPrivate +class QQuickPopupPrivate : public QObjectPrivate, public QQuickItemChangeListener { Q_DECLARE_PUBLIC(QQuickPopup) @@ -177,6 +176,7 @@ public: void setBottomMargin(qreal value, bool reset = false); void setWindow(QQuickWindow *window); + void itemDestroyed(QQuickItem *item) override; bool focus; bool modal; |