aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorOliver Eftevaag <oliver.eftevaag@qt.io>2021-09-09 22:15:05 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-09-13 15:22:38 +0000
commit4945ce45181f8d67e42801fbb3064b7435d3e3da (patch)
tree407c2b6203b46a8b092f10c774fda18571a55e9f /examples
parent7c6d9d8bf07c34186f96ec1cde74961358f567ec (diff)
Gallery example: remove binding loop from TextArea page
The width binding for the TextArea was didn't make a lot of sense. It used to be limited by the panes availableWidth / 3, but if the implicitWidth was less, the text would move towards the center, since the anchors are centering the TextArea horizontally. Setting the width to just always be the panes availableWidth / 3, simplifies the binding, removes the binding loop, and doesn't move the visible text towards the center when the implicitWidth is less than 1/3 of the panes availableWidth. Note that this doesn't directly fix QTBUG-91109, because QTBUG-91109 isn't really a bug to begin with. Fixes: QTBUG-91109 Change-Id: I5b6de8dfd11fd726e8ffdae0e46143c448985dc4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 9025ea98cad57696aeee41a614cf21e9938aa527) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'examples')
-rw-r--r--examples/quickcontrols2/gallery/pages/TextAreaPage.qml2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/quickcontrols2/gallery/pages/TextAreaPage.qml b/examples/quickcontrols2/gallery/pages/TextAreaPage.qml
index 91ecb16e41..c3a2bf94ac 100644
--- a/examples/quickcontrols2/gallery/pages/TextAreaPage.qml
+++ b/examples/quickcontrols2/gallery/pages/TextAreaPage.qml
@@ -66,7 +66,7 @@ ScrollablePage {
}
TextArea {
- width: Math.max(implicitWidth, Math.min(implicitWidth * 3, pane.availableWidth / 3))
+ width: pane.availableWidth / 3
anchors.horizontalCenter: parent.horizontalCenter
wrapMode: TextArea.Wrap