From 4a8c2605c26acf575e181682f083e077b815ab4b Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 5 Apr 2018 11:06:34 +0200 Subject: TextArea: fix background parent QQuickTextAreaPrivate::attachFlickable() reparents the background from Flickable::contentItem to the Flickable itself. This avoids that the background scrolls together with the content. However, when deferred execution was enabled, attachFlickable() ended up being called before the background had been executed. If the TextArea has already been attached to a Flickable when the background gets exeuted, set the appropriate parent in setBackground(). Task-number: QTBUG-67334 Change-Id: I0847fca5861fdddeac7d47d47316b74bb31500cb Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquicktextarea.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/quicktemplates2/qquicktextarea.cpp') diff --git a/src/quicktemplates2/qquicktextarea.cpp b/src/quicktemplates2/qquicktextarea.cpp index 319f7bbe..9a076e83 100644 --- a/src/quicktemplates2/qquicktextarea.cpp +++ b/src/quicktemplates2/qquicktextarea.cpp @@ -529,7 +529,10 @@ void QQuickTextArea::setBackground(QQuickItem *background) delete d->background; d->background = background; if (background) { - background->setParentItem(this); + if (d->flickable) + background->setParentItem(d->flickable); + else + background->setParentItem(this); if (qFuzzyIsNull(background->z())) background->setZ(-1); if (isComponentComplete()) -- cgit v1.2.3