From 27c18e488cd826365b1def7fb449fbd381c42bac Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 13 Sep 2019 10:17:40 +0200 Subject: Blacklist tst_focus::policy on OpenSUSE 15.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-78261 Change-Id: I5373ffbb21f70f4fc9f18a7574165f383f55d899 Reviewed-by: Tony Sarajärvi --- tests/auto/focus/BLACKLIST | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 tests/auto/focus/BLACKLIST (limited to 'tests/auto') diff --git a/tests/auto/focus/BLACKLIST b/tests/auto/focus/BLACKLIST new file mode 100644 index 00000000..730d3844 --- /dev/null +++ b/tests/auto/focus/BLACKLIST @@ -0,0 +1,3 @@ +# QTBUG-78261 +[policy] +opensuse-leap -- cgit v1.2.3 From a89c3bc67ea6c76bfc89d64f235ebf5cb4b0fca4 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Wed, 11 Sep 2019 16:39:47 +0000 Subject: 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 --- .../auto/qquickmaterialstyle/data/tst_material.qml | 35 ---------------------- 1 file changed, 35 deletions(-) (limited to 'tests/auto') 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) - } } -- cgit v1.2.3 From 6815f353e5a73c0dcf39fbfc91c6a2c1b0784324 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Wed, 11 Sep 2019 21:54:53 +0300 Subject: TextArea: prevent changing size of background recursively When the x/y position of background depends on the height/width of background and these values are not constant, the if statement in the method resizeBackground() will always pass. And since `resizingBackground` guard wasn't checked, any geometry change will always call resizeBackground() and then call themself recursively (via the change listener), that means the height/width of background will always be reset, no matter what value you set. Another part of the issue was in determining the extra bits too late: in case the background gets parented by the flickable, the new child caused the flickable to re-calculate its metrics and thus resize the background *prior* to remembering if it has w/h set. As a side effect, this fix also brings the possibility to reset previously set w/h to get the default background sizing behavior. Inspired by da06da57002b64cf4bcde0ca708b3275a5f919ae [ChangeLog][QtQuick][QQuickTextArea] prevent changing size of background recursively in construction Fixes: QTBUG-76369 Change-Id: Ide51ec1ebab63605ae3bfcc10a76a28be960ef36 Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_textarea.qml | 68 +++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) (limited to 'tests/auto') diff --git a/tests/auto/controls/data/tst_textarea.qml b/tests/auto/controls/data/tst_textarea.qml index ee40c9b7..1e455ffc 100644 --- a/tests/auto/controls/data/tst_textarea.qml +++ b/tests/auto/controls/data/tst_textarea.qml @@ -688,4 +688,72 @@ TestCase { compare(control.background.width, 100) compare(control.background.height, 100) } + + // QTBUG-76369 + Component { + id: testResizeBackground + Item { + width: 200 + height: 200 + property alias textArea: textArea + ScrollView { + anchors.fill: parent + ScrollBar.horizontal.policy: ScrollBar.AlwaysOff + TextArea { + id: textArea + // workaround test failing due to default insets on Imagine + topInset: undefined + leftInset: undefined + rightInset: undefined + bottomInset: undefined + wrapMode : TextEdit.WordWrap + readOnly: false + selectByMouse: true + focus: true + text: "test message" + + background: Rectangle { + y: parent.height - height - textArea.bottomPadding / 2 + implicitWidth: 120 + height: textArea.activeFocus ? 2 : 1 + } + } + } + } + } + + function test_resize_background() { + var control = createTemporaryObject(testResizeBackground, testCase) + + compare(control.textArea.background.width, control.width) + compare(control.textArea.background.height, 1) + control.width = 400 + control.height = 400 + compare(control.textArea.background.width, control.width) + compare(control.textArea.background.height, 1) + control.width = 200 + control.height = 200 + compare(control.textArea.background.width, control.width) + compare(control.textArea.background.height, 1) + + // hasBackgroundWidth=true + control.textArea.background.width = 1 + compare(control.textArea.background.width, 1) + compare(control.textArea.background.height, 1) + control.width = 400 + control.height = 400 + compare(control.textArea.background.width, 1) + compare(control.textArea.background.height, 1) + // hasBackgroundHeight=false + control.textArea.background.height = undefined + compare(control.textArea.background.width, 1) + compare(control.textArea.background.height, 0) + control.textArea.background.y = 0 + compare(control.textArea.background.width, 1) + compare(control.textArea.background.height, control.height) + control.width = 200 + control.height = 200 + compare(control.textArea.background.width, 1) + compare(control.textArea.background.height, control.height) + } } -- cgit v1.2.3