diff options
author | Liang Qi <liang.qi@qt.io> | 2016-08-03 07:58:19 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-08-03 10:23:11 +0200 |
commit | e9855d8ac8afed5371330f4f83f7b7dd51d9026f (patch) | |
tree | c1f70cbc64d9fe5d07911601880c571b4d3cd8f0 /tests/auto/controls/data/tst_textarea.qml | |
parent | 508bb6ddde831fb0d0b7065b39d99be01b4e4771 (diff) | |
parent | 1b7b2d7ddb6a02fd2ccd1f29a431005b9e693723 (diff) |
Merge remote-tracking branch 'origin/5.7' into dev
Also update expected line numbers in tst_swipedelegate.
Conflicts:
.qmake.conf
src/quicktemplates2/qquicktextarea.cpp
src/quicktemplates2/qquicktextarea_p.h
tests/auto/controls/data/tst_swipedelegate.qml
Change-Id: I36323e3a633c1c750d23014e56a7c881963a1a30
Diffstat (limited to 'tests/auto/controls/data/tst_textarea.qml')
-rw-r--r-- | tests/auto/controls/data/tst_textarea.qml | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/auto/controls/data/tst_textarea.qml b/tests/auto/controls/data/tst_textarea.qml index 1c5c5cc8..5d3e8d55 100644 --- a/tests/auto/controls/data/tst_textarea.qml +++ b/tests/auto/controls/data/tst_textarea.qml @@ -154,7 +154,7 @@ TestCase { } function test_flickable() { - var control = flickable.createObject(testCase, {text:"line0"}) + var control = flickable.createObject(testCase, {text:"line0", selectByMouse: true}) verify(control) var textArea = control.TextArea.flickable @@ -169,6 +169,28 @@ TestCase { compare(control.contentWidth, textArea.contentWidth + textArea.leftPadding + textArea.rightPadding) compare(control.contentHeight, textArea.contentHeight + textArea.topPadding + textArea.bottomPadding) + compare(textArea.cursorPosition, 0) + + var center = textArea.positionAt(control.width / 2, control.height / 2) + verify(center > 0) + mouseClick(textArea, control.width / 2, control.height / 2) + compare(textArea.cursorPosition, center) + + // click inside text area, but below flickable + var below = textArea.positionAt(control.width / 2, control.height + 1) + verify(below > center) + mouseClick(textArea, control.width / 2, control.height + 1) + compare(textArea.cursorPosition, center) // no change + + // scroll down + control.contentY = -(control.contentHeight - control.height) / 2 + + // click inside textarea, but above flickable + var above = textArea.positionAt(control.width / 2, textArea.topPadding) + verify(above > 0 && above < center) + mouseClick(textArea, control.width / 2, 0) + compare(textArea.cursorPosition, center) // no change + control.destroy() } |