diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-07-11 14:51:16 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2016-07-12 09:21:21 +0000 |
commit | f06db0f1c6538305d226311044cca367fc031195 (patch) | |
tree | 5c93e7c24a875498c9ad7e4a930da1a4c0f8a34f /tests/auto/controls | |
parent | 6a8513909cf3aaad6be41a325129cf22f61842bf (diff) |
SwipeDelegate: reposition contentItem, background on width changes
Change-Id: I6af4f1a4517e79f2e34b0bbca401b0eefd0c6ff4
Task-number: QTBUG-54660
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/auto/controls')
-rw-r--r-- | tests/auto/controls/data/tst_swipedelegate.qml | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_swipedelegate.qml b/tests/auto/controls/data/tst_swipedelegate.qml index f89893c3..42ea3542 100644 --- a/tests/auto/controls/data/tst_swipedelegate.qml +++ b/tests/auto/controls/data/tst_swipedelegate.qml @@ -910,4 +910,22 @@ TestCase { control.destroy(); } + + // When the width of a SwipeDelegate changes (as it does upon portrait => landscape + // rotation, for example), the positions of the contentItem and background items + // should be updated accordingly. + function test_contentItemPosOnWidthChanged() { + var control = swipeDelegateComponent.createObject(testCase); + verify(control); + + swipe(control, 0.0, 1.0); + + var oldContentItemX = control.contentItem.x; + var oldBackgroundX = control.background.x; + control.width += 100; + compare(control.contentItem.x, oldContentItemX + 100); + compare(control.background.x, oldBackgroundX + 100); + + control.destroy(); + } } |