aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2018-04-10 15:19:11 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2018-04-10 18:25:28 +0000
commitcea175fca9e07d4b8bbb47508c49a8dac554797b (patch)
treeabc6bb31a43047be8a7bf84b6c0ddd4aa5674231 /tests/auto
parent26f0a9d599baa1093e8ed26111fea7407e6c3f09 (diff)
SwipeView: add contentWidth and contentHeight
[ChangeLog][Controls][SwipeView] Added contentWidth and contentHeight properties. Change-Id: I9c37583cb5fcfb1af2d98d5d3753277e17e82608 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/controls/data/tst_swipeview.qml31
1 files changed, 24 insertions, 7 deletions
diff --git a/tests/auto/controls/data/tst_swipeview.qml b/tests/auto/controls/data/tst_swipeview.qml
index 39311877..1f92bba4 100644
--- a/tests/auto/controls/data/tst_swipeview.qml
+++ b/tests/auto/controls/data/tst_swipeview.qml
@@ -85,43 +85,60 @@ TestCase {
compare(control.currentIndex, -1)
compare(control.currentItem, null)
- control.addItem(page.createObject(control, {text: "0"}))
+ var item0 = page.createObject(control, {text: "0"})
+ control.addItem(item0)
compare(control.count, 1)
compare(control.currentIndex, 0)
compare(control.currentItem.text, "0")
compare(currentItemChangedSpy.count, 1);
+ compare(control.contentWidth, item0.implicitWidth)
+ compare(control.contentHeight, item0.implicitHeight)
- control.addItem(page.createObject(control, {text: "1"}))
+ var item1 = page.createObject(control, {text: "11"})
+ control.addItem(item1)
compare(control.count, 2)
compare(control.currentIndex, 0)
compare(control.currentItem.text, "0")
compare(currentItemChangedSpy.count, 1);
+ compare(control.contentWidth, item0.implicitWidth)
+ compare(control.contentHeight, item0.implicitHeight)
- control.addItem(page.createObject(control, {text: "2"}))
+ var item2 = page.createObject(control, {text: "222"})
+ control.addItem(item2)
compare(control.count, 3)
compare(control.currentIndex, 0)
compare(control.currentItem.text, "0")
compare(currentItemChangedSpy.count, 1);
+ compare(control.contentWidth, item0.implicitWidth)
+ compare(control.contentHeight, item0.implicitHeight)
control.currentIndex = 1
compare(control.currentIndex, 1)
- compare(control.currentItem.text, "1")
+ compare(control.currentItem.text, "11")
compare(currentItemChangedSpy.count, 2);
+ compare(control.contentWidth, item1.implicitWidth)
+ compare(control.contentHeight, item1.implicitHeight)
control.currentIndex = 2
compare(control.currentIndex, 2)
- compare(control.currentItem.text, "2")
+ compare(control.currentItem.text, "222")
compare(currentItemChangedSpy.count, 3);
+ compare(control.contentWidth, item2.implicitWidth)
+ compare(control.contentHeight, item2.implicitHeight)
control.decrementCurrentIndex()
compare(control.currentIndex, 1)
- compare(control.currentItem.text, "1")
+ compare(control.currentItem.text, "11")
compare(currentItemChangedSpy.count, 4);
+ compare(control.contentWidth, item1.implicitWidth)
+ compare(control.contentHeight, item1.implicitHeight)
control.incrementCurrentIndex()
compare(control.currentIndex, 2)
- compare(control.currentItem.text, "2")
+ compare(control.currentItem.text, "222")
compare(currentItemChangedSpy.count, 5);
+ compare(control.contentWidth, item2.implicitWidth)
+ compare(control.contentHeight, item2.implicitHeight)
}
Component {