diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2018-04-05 11:06:34 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2018-04-05 12:31:44 +0000 |
commit | d3c628fbd7b7d7f2a83e3e77d9318bb930b8b3b6 (patch) | |
tree | 02e022afdd87578d610659e946a5be0d2e92bbc5 | |
parent | 068ca8ece0b345afd36bd846c1772fc6aa56fe21 (diff) |
-rw-r--r-- | src/quicktemplates2/qquicktextarea.cpp | 5 | ||||
-rw-r--r-- | tests/auto/controls/data/tst_textarea.qml | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/quicktemplates2/qquicktextarea.cpp b/src/quicktemplates2/qquicktextarea.cpp index 500e7bba..6b492ff2 100644 --- a/src/quicktemplates2/qquicktextarea.cpp +++ b/src/quicktemplates2/qquicktextarea.cpp @@ -483,7 +483,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()) diff --git a/tests/auto/controls/data/tst_textarea.qml b/tests/auto/controls/data/tst_textarea.qml index 7c47aa25..2de82d85 100644 --- a/tests/auto/controls/data/tst_textarea.qml +++ b/tests/auto/controls/data/tst_textarea.qml @@ -212,6 +212,9 @@ TestCase { var textArea = control.TextArea.flickable verify(textArea) + if (textArea.background) + compare(textArea.background.parent, control) + for (var i = 1; i <= 100; ++i) textArea.text += "line\n" + i |