diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-01-11 11:10:52 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-01-11 13:45:51 +0000 |
commit | 4a97498f4c20936ac61f364b74d7476097a7e8bf (patch) | |
tree | ce90fc52852af31369f657712719752f32e8787c /tests | |
parent | 0b6bf36e246dab0912b3f1de04581979a435b3df (diff) |
Add SwipeView::orientation
[ChangeLog][Controls][SwipeView] Added orientation property.
Task-number: QTBUG-56031
Change-Id: I4ed47d659ef83cb48f63b703b681bdf1b8662fe8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_swipeview.qml | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/auto/controls/data/tst_swipeview.qml b/tests/auto/controls/data/tst_swipeview.qml index d330b73c..ca4ccc86 100644 --- a/tests/auto/controls/data/tst_swipeview.qml +++ b/tests/auto/controls/data/tst_swipeview.qml @@ -40,7 +40,7 @@ import QtQuick 2.2 import QtTest 1.0 -import QtQuick.Controls 2.1 +import QtQuick.Controls 2.2 TestCase { id: testCase @@ -520,4 +520,27 @@ TestCase { compare(page.isNextItem, false); compare(page.isPreviousItem, false); } + + function test_orientation() { + var control = createTemporaryObject(swipeView, testCase, {width: 200, height: 200}) + verify(control) + + for (var i = 0; i < 3; ++i) + control.addItem(page.createObject(control, {text: i})) + + compare(control.orientation, Qt.Horizontal) + + for (i = 0; i < control.count; ++i) { + control.currentIndex = i + compare(control.itemAt(i).y, 0) + } + + control.orientation = Qt.Vertical + compare(control.orientation, Qt.Vertical) + + for (i = 0; i < control.count; ++i) { + control.currentIndex = i + compare(control.itemAt(i).x, 0) + } + } } |