aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_swipedelegate.qml18
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();
+ }
}