aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-08-29 13:20:45 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-08-29 12:39:39 +0000
commitabc60b14620253f61b0c0f1dff1ca0935b18761c (patch)
treefb053a140fc5979dc3e2701d4c25014621984133 /src
parent63f2f55462f2f040cfe175ada8aa1e01168597fc (diff)
Fix a crash with ScrollView + TextArea
TextArea was not cleaning up its geometry change listener on the Flickable it was attached to. Task-number: QTBUG-62292 Change-Id: I31223d4fcf0b46235b18e8eb05bab686a32f5481 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/quicktemplates2/qquicktextarea.cpp9
-rw-r--r--src/quicktemplates2/qquicktextarea_p.h1
2 files changed, 9 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquicktextarea.cpp b/src/quicktemplates2/qquicktextarea.cpp
index 4a171603..afc2932c 100644
--- a/src/quicktemplates2/qquicktextarea.cpp
+++ b/src/quicktemplates2/qquicktextarea.cpp
@@ -256,7 +256,7 @@ void QQuickTextAreaPrivate::detachFlickable()
QObject::disconnect(flickable, &QQuickFlickable::contentXChanged, q, &QQuickItem::update);
QObject::disconnect(flickable, &QQuickFlickable::contentYChanged, q, &QQuickItem::update);
- QQuickItemPrivate::get(flickable)->updateOrRemoveGeometryChangeListener(this, QQuickGeometryChange::Size);
+ QQuickItemPrivate::get(flickable)->updateOrRemoveGeometryChangeListener(this, QQuickGeometryChange::Nothing);
QObjectPrivate::disconnect(flickable, &QQuickFlickable::contentWidthChanged, this, &QQuickTextAreaPrivate::resizeFlickableControl);
QObjectPrivate::disconnect(flickable, &QQuickFlickable::contentHeightChanged, this, &QQuickTextAreaPrivate::resizeFlickableControl);
@@ -406,6 +406,13 @@ QQuickTextArea::QQuickTextArea(QQuickItem *parent)
d, &QQuickTextAreaPrivate::readOnlyChanged);
}
+QQuickTextArea::~QQuickTextArea()
+{
+ Q_D(QQuickTextArea);
+ if (d->flickable)
+ d->detachFlickable();
+}
+
QQuickTextAreaAttached *QQuickTextArea::qmlAttachedProperties(QObject *object)
{
return new QQuickTextAreaAttached(object);
diff --git a/src/quicktemplates2/qquicktextarea_p.h b/src/quicktemplates2/qquicktextarea_p.h
index af7c1d13..87cb57bc 100644
--- a/src/quicktemplates2/qquicktextarea_p.h
+++ b/src/quicktemplates2/qquicktextarea_p.h
@@ -72,6 +72,7 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickTextArea : public QQuickTextEdit
public:
explicit QQuickTextArea(QQuickItem *parent = nullptr);
+ ~QQuickTextArea();
static QQuickTextAreaAttached *qmlAttachedProperties(QObject *object);