diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-01-11 15:49:36 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-06 04:13:08 +0100 |
commit | 5b9e19ff591f9460adc7a85fa9fe822c05ab3b41 (patch) | |
tree | 782ede165cbb84db62ae85cf5cf46087fe9a1a13 /tests/auto/qtquick2/qquicktext/data/fontSizeMode.qml | |
parent | 0323a56a04dd4d858eb0c98955d179b8418c1ed7 (diff) |
Add support for resizing fonts to fit Text dimensions.
This adds a mode where if the content of a Text item doesn't fit
within its bounds the font size is reduced during layout until it
does or a minimum font size is reached.
Task-number: QTBUG-22832
Change-Id: I6198ef03899e2f21b32e313548966ef4b0e3bff1
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
Diffstat (limited to 'tests/auto/qtquick2/qquicktext/data/fontSizeMode.qml')
-rw-r--r-- | tests/auto/qtquick2/qquicktext/data/fontSizeMode.qml | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/qtquick2/qquicktext/data/fontSizeMode.qml b/tests/auto/qtquick2/qquicktext/data/fontSizeMode.qml new file mode 100644 index 0000000000..20f7535365 --- /dev/null +++ b/tests/auto/qtquick2/qquicktext/data/fontSizeMode.qml @@ -0,0 +1,24 @@ +import QtQuick 2.0 + +Item { + width: 300 + height: 200 + + Rectangle { + anchors.fill: myText + border.width: 1 + } + + Text { + id: myText + objectName: "myText" + width: 250 + height: 41 + minimumPointSize: 8 + minimumPixelSize: 8 + font.pixelSize: 30 + font.family: "Helvetica" + } + + TextInput { focus: true; objectName: "input" } +} |