aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quickcontrols2/gallery/pages
diff options
context:
space:
mode:
authorOliver Eftevaag <oliver.eftevaag@qt.io>2021-09-09 22:15:05 +0200
committerOliver Eftevaag <oliver.eftevaag@qt.io>2021-09-13 14:42:09 +0200
commit9025ea98cad57696aeee41a614cf21e9938aa527 (patch)
treefa2ca95e8ad8219e1bba0b9e9d4bcfc820c8e100 /examples/quickcontrols2/gallery/pages
parent42c13ae5ff93ce4c7c49ce32425b53d6a463a6d8 (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. Pick-to: 6.2 Fixes: QTBUG-91109 Change-Id: I5b6de8dfd11fd726e8ffdae0e46143c448985dc4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'examples/quickcontrols2/gallery/pages')
-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