diff options
Diffstat (limited to 'tests/auto/quick/qquicktextedit/data/resizeTextEditPolish.qml')
-rw-r--r-- | tests/auto/quick/qquicktextedit/data/resizeTextEditPolish.qml | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicktextedit/data/resizeTextEditPolish.qml b/tests/auto/quick/qquicktextedit/data/resizeTextEditPolish.qml new file mode 100644 index 0000000000..44819a0de9 --- /dev/null +++ b/tests/auto/quick/qquicktextedit/data/resizeTextEditPolish.qml @@ -0,0 +1,42 @@ +import QtQuick +import QtQuick.Controls + +Item { + width: 400 + height: 150 + + TextEdit { + id: textEdit + anchors { + top: parent.top + left: parent.left + right: parent.right + } + readOnly: true + wrapMode: Text.WordWrap + verticalAlignment: Text.AlignVCenter + text: "Lorem ipsum dolor sit amet, consectetur adipisicing" + states: [ + State { + name: "multi-line" + when: textEdit.lineCount > 1 + AnchorChanges { + target: textEdit + anchors.bottom: undefined + } + PropertyChanges { + target: textEdit + height: undefined + } + }, + State { + name: "single-line" + when: true + AnchorChanges { + target: textEdit + anchors.bottom: { return textEdit.parent.bottom } + } + } + ] + } +} |