aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/nativestyle/TextAreas.qml
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2020-12-14 15:27:35 +0100
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2021-01-13 15:33:59 +0100
commit67bc10c0e163fc1ca5b24a6e8a610a153b0cf021 (patch)
tree78d942d96509e5e6d8c2b1f7c6a8058f5133fcc6 /tests/manual/nativestyle/TextAreas.qml
parenta6f2bcd4e9d39e4f7b5c919fc46378884f7b4a98 (diff)
Manual test, nativestyle: fix frame size
A Frame will will set it's own content size to be the same size as the implicit size of the child. But for some controls (TextEdit / TextArea), the implicit size is either read only, or should not be changed. For such controls, you need to set contentWidth/height explicitly on the Frame instead. Otherwise the frame will wrap around the implicit size of the item, and not it's actual size. For a TextEdit, the implicitWidth can sometimes be slightly smaller that the actual width, since the text is not drawn all the way to edge before it wraps to the next line. The result is that the Frame around it ends up smaller than it should. Pick-to: 6.0 Change-Id: Ibf800373d4424ffdb3e95475d9638503c2e99572 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'tests/manual/nativestyle/TextAreas.qml')
-rw-r--r--tests/manual/nativestyle/TextAreas.qml7
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/manual/nativestyle/TextAreas.qml b/tests/manual/nativestyle/TextAreas.qml
index e3911992..d8d49c02 100644
--- a/tests/manual/nativestyle/TextAreas.qml
+++ b/tests/manual/nativestyle/TextAreas.qml
@@ -86,9 +86,14 @@ ControlContainer {
spacing: container.rowSpacing
Frame {
+ id: frame
+ contentWidth: textArea.width
+ contentHeight: textArea.height
+
TextArea {
- id: area1
+ id: textArea
width: 200
+ height: 80
wrapMode: TextEdit.WrapAnywhere
selectByMouse: true
text: "Inside frame - Lorem ipsum dolor sit amet, consectetur adipiscing elit, "