diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2019-09-11 16:39:47 +0000 |
---|---|---|
committer | Konstantin Ritt <ritt.ks@gmail.com> | 2019-09-19 14:36:25 +0300 |
commit | a89c3bc67ea6c76bfc89d64f235ebf5cb4b0fca4 (patch) | |
tree | 7603c1f914b70ab9b8ad41daf97f38f609692f8f | |
parent | d41362ed752031fdd798e4838b3a56fbb2717f3f (diff) |
Revert "QQuickTextArea: prevent changing size of background recursively"
This reverts commit da06da57002b64cf4bcde0ca708b3275a5f919ae.
Reason for revert: the change removes symptoms leaving a cause unfixed
Change-Id: I0a91409230c521da73ed53e2a00a4ccd8dca7335
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r-- | src/quicktemplates2/qquicktextarea.cpp | 10 | ||||
-rw-r--r-- | tests/auto/qquickmaterialstyle/data/tst_material.qml | 35 |
2 files changed, 3 insertions, 42 deletions
diff --git a/src/quicktemplates2/qquicktextarea.cpp b/src/quicktemplates2/qquicktextarea.cpp index e24844d8..7fdc8f0a 100644 --- a/src/quicktemplates2/qquicktextarea.cpp +++ b/src/quicktemplates2/qquicktextarea.cpp @@ -517,11 +517,8 @@ void QQuickTextAreaPrivate::executeBackground(bool complete) if (!background || complete) quickBeginDeferred(q, backgroundName(), background); - if (complete) { + if (complete) quickCompleteDeferred(q, backgroundName(), background); - if (background) - QQuickControlPrivate::addImplicitSizeListener(background, this, QQuickControlPrivate::ImplicitSizeChanges | QQuickItemPrivate::Geometry); - } } void QQuickTextAreaPrivate::itemImplicitWidthChanged(QQuickItem *item) @@ -641,10 +638,9 @@ void QQuickTextArea::setBackground(QQuickItem *background) d->extra.value().hasBackgroundWidth = p->widthValid; d->extra.value().hasBackgroundHeight = p->heightValid; } - if (isComponentComplete()) { + if (isComponentComplete()) d->resizeBackground(); - QQuickControlPrivate::addImplicitSizeListener(background, d, QQuickControlPrivate::ImplicitSizeChanges | QQuickItemPrivate::Geometry); - } + QQuickControlPrivate::addImplicitSizeListener(background, d, QQuickControlPrivate::ImplicitSizeChanges | QQuickItemPrivate::Geometry); } if (!qFuzzyCompare(oldImplicitBackgroundWidth, implicitBackgroundWidth())) diff --git a/tests/auto/qquickmaterialstyle/data/tst_material.qml b/tests/auto/qquickmaterialstyle/data/tst_material.qml index 45bc0dab..9f2456b8 100644 --- a/tests/auto/qquickmaterialstyle/data/tst_material.qml +++ b/tests/auto/qquickmaterialstyle/data/tst_material.qml @@ -715,39 +715,4 @@ TestCase { control.destroy() } - - Component { - id: testResizeBackground - Item { - width: 200 - height: 200 - property alias textArea: textArea - ScrollView { - anchors.fill: parent - ScrollBar.horizontal.policy: ScrollBar.AlwaysOff - TextArea { - id: textArea - wrapMode : TextEdit.WordWrap - readOnly: false - selectByMouse: true - focus: true - text: "test message" - } - } - } - } - - function test_resize_background() { - var control = testCase.createTemporaryObject(testResizeBackground, testCase) - compare(control.textArea.background.height, 1) - compare(control.textArea.background.width, control.width) - control.width = 400 - control.height = 400 - compare(control.textArea.background.height, 1) - compare(control.textArea.background.width, control.width) - control.width = 200 - control.height = 200 - compare(control.textArea.background.height, 1) - compare(control.textArea.background.width, control.width) - } } |