aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_textarea.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/controls/data/tst_textarea.qml')
-rw-r--r--tests/auto/controls/data/tst_textarea.qml27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_textarea.qml b/tests/auto/controls/data/tst_textarea.qml
index 1e455ffc..ff4b76bb 100644
--- a/tests/auto/controls/data/tst_textarea.qml
+++ b/tests/auto/controls/data/tst_textarea.qml
@@ -75,6 +75,19 @@ TestCase {
}
Component {
+ id: flickableCustomBackground
+ Flickable {
+ width: 200
+ height: 200
+ TextArea.flickable: TextArea {
+ background: Rectangle {
+ color: "green"
+ }
+ }
+ }
+ }
+
+ Component {
id: signalSpy
SignalSpy { }
}
@@ -306,6 +319,20 @@ TestCase {
compare(textArea.cursorPosition, center) // no change
}
+ function test_flickableCustomBackground() {
+ // Test that the TextArea background item is parented out of the
+ // TextArea and into the Flicable, and that it has the same size
+ // as the flickable.
+ var flickable = createTemporaryObject(flickableCustomBackground, testCase)
+ verify(flickable)
+
+ var textArea = flickable.TextArea.flickable
+ verify(textArea)
+ verify(textArea.background)
+ compare(textArea.background.width, flickable.width)
+ compare(textArea.background.height, flickable.height)
+ }
+
function test_warning() {
ignoreWarning(Qt.resolvedUrl("tst_textarea.qml") + ":55:1: QML TestCase: TextArea must be attached to a Flickable")
testCase.TextArea.flickable = null