aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2020-05-08 13:27:31 +0200
committerMitch Curtis <mitch.curtis@qt.io>2020-05-11 11:48:01 +0200
commit7c873b0a5866802afce6d6562c37f227a258d2fe (patch)
tree96e418a74630fa3b8a8d5bb0d5fa2f9dbca848af /tests/auto
parente16408a19325456f7dc25f84e8863116cd2ca918 (diff)
Container: remove deprecated removeItem(var) overload
[ChangeLog][Controls][Container] The deprecated removeItem(var) function was removed. removeItem(Item) or takeItem(int) can be used instead. Change-Id: Ibc693a9216cd039fc11cb4e5182f74a96f493796 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/controls/data/tst_container.qml6
-rw-r--r--tests/auto/controls/data/tst_splitview.qml4
-rw-r--r--tests/auto/controls/data/tst_swipeview.qml14
-rw-r--r--tests/auto/controls/data/tst_tabbar.qml22
4 files changed, 20 insertions, 26 deletions
diff --git a/tests/auto/controls/data/tst_container.qml b/tests/auto/controls/data/tst_container.qml
index 134dbb38..c04a3402 100644
--- a/tests/auto/controls/data/tst_container.qml
+++ b/tests/auto/controls/data/tst_container.qml
@@ -212,11 +212,5 @@ TestCase {
compare(control.count, 1)
wait(1)
verify(item3)
-
- // deprecated removeItem(int) does not destroy
- control.removeItem(0)
- compare(control.count, 0)
- wait(1)
- verify(item3)
}
}
diff --git a/tests/auto/controls/data/tst_splitview.qml b/tests/auto/controls/data/tst_splitview.qml
index ae8179b2..d78ef95a 100644
--- a/tests/auto/controls/data/tst_splitview.qml
+++ b/tests/auto/controls/data/tst_splitview.qml
@@ -1609,7 +1609,7 @@ TestCase {
verify(control)
while (control.count > 0)
- var itemToRemove = control.removeItem(0)
+ var itemToRemove = control.removeItem(control.itemAt(0))
// Shouldn't crash.
}
@@ -1940,7 +1940,7 @@ TestCase {
verify(firstHandle.SplitHandle.pressed)
// Then, remove it by removing the first item.
- control.removeItem(0)
+ control.removeItem(control.itemAt(0))
handles = findHandles(control)
firstHandle = null
compare(handles.length, 1)
diff --git a/tests/auto/controls/data/tst_swipeview.qml b/tests/auto/controls/data/tst_swipeview.qml
index 5775491c..41826117 100644
--- a/tests/auto/controls/data/tst_swipeview.qml
+++ b/tests/auto/controls/data/tst_swipeview.qml
@@ -224,7 +224,7 @@ TestCase {
compare(control.itemAt(3).text, "2")
compare(control.itemAt(4).text, "5")
- control.removeItem(control.count - 1)
+ control.removeItem(control.itemAt(control.count - 1))
compare(control.count, 4)
compare(control.currentIndex, 3)
compare(control.currentItem.text, "2")
@@ -233,7 +233,7 @@ TestCase {
compare(control.itemAt(2).text, "3")
compare(control.itemAt(3).text, "2")
- control.removeItem(0)
+ control.removeItem(control.itemAt(0))
compare(control.count, 3)
compare(control.currentIndex, 2)
compare(control.currentItem.text, "2")
@@ -241,7 +241,7 @@ TestCase {
compare(control.itemAt(1).text, "3")
compare(control.itemAt(2).text, "2")
- control.removeItem(1)
+ control.removeItem(control.itemAt(1))
compare(control.count, 2)
compare(control.currentIndex, 1)
compare(control.currentItem.text, "2")
@@ -250,14 +250,14 @@ TestCase {
currentItemChangedSpy.clear()
- control.removeItem(1)
+ control.removeItem(control.itemAt(1))
compare(control.count, 1)
compare(control.currentIndex, 0)
compare(currentItemChangedSpy.count, 1)
compare(control.currentItem.text, "1")
compare(control.itemAt(0).text, "1")
- control.removeItem(0)
+ control.removeItem(control.itemAt(0))
compare(control.count, 0)
compare(control.currentIndex, -1)
compare(currentItemChangedSpy.count, 2)
@@ -302,7 +302,7 @@ TestCase {
verify(compareObjectNames(control.contentData, ["object", "page1", "timer", "page2", "", "page3", "page4"]))
verify(compareObjectNames(control.contentChildren, ["page4", "page2", "page1", "page3"]))
- control.removeItem(0)
+ control.removeItem(control.itemAt(0))
verify(compareObjectNames(control.contentData, ["object", "page1", "timer", "page2", "", "page3"]))
verify(compareObjectNames(control.contentChildren, ["page2", "page1", "page3"]))
}
@@ -538,7 +538,7 @@ TestCase {
compare(page.isNextItem, false);
compare(page.isPreviousItem, false);
- control.removeItem(0);
+ control.removeItem(control.itemAt(0));
compare(control.count, 0);
compare(page.parent, null);
compare(page.view, null);
diff --git a/tests/auto/controls/data/tst_tabbar.qml b/tests/auto/controls/data/tst_tabbar.qml
index 42e767f2..ce42632f 100644
--- a/tests/auto/controls/data/tst_tabbar.qml
+++ b/tests/auto/controls/data/tst_tabbar.qml
@@ -230,7 +230,7 @@ TestCase {
compare(control.itemAt(4).text, "5")
compare(contentChildrenSpy.count, 7)
- control.removeItem(control.count - 1)
+ control.removeItem(control.itemAt(control.count - 1))
compare(control.count, 4)
compare(control.currentIndex, 3)
compare(control.currentItem.text, "2")
@@ -240,7 +240,7 @@ TestCase {
compare(control.itemAt(3).text, "2")
compare(contentChildrenSpy.count, 8)
- control.removeItem(0)
+ control.removeItem(control.itemAt(0))
compare(control.count, 3)
compare(control.currentIndex, 2)
compare(control.currentItem.text, "2")
@@ -249,7 +249,7 @@ TestCase {
compare(control.itemAt(2).text, "2")
compare(contentChildrenSpy.count, 9)
- control.removeItem(1)
+ control.removeItem(control.itemAt(1))
compare(control.count, 2)
compare(control.currentIndex, 1)
compare(control.currentItem.text, "2")
@@ -257,14 +257,14 @@ TestCase {
compare(control.itemAt(1).text, "2")
compare(contentChildrenSpy.count, 10)
- control.removeItem(1)
+ control.removeItem(control.itemAt(1))
compare(control.count, 1)
compare(control.currentIndex, 0)
compare(control.currentItem.text, "1")
compare(control.itemAt(0).text, "1")
compare(contentChildrenSpy.count, 11)
- control.removeItem(0)
+ control.removeItem(control.itemAt(0))
compare(control.count, 0)
compare(control.currentIndex, -1)
compare(contentChildrenSpy.count, 12)
@@ -280,15 +280,15 @@ TestCase {
compare(control.count, 3)
compare(control.currentIndex, 1)
- control.removeItem(1)
+ control.removeItem(control.itemAt(1))
compare(control.count, 2)
compare(control.currentIndex, 0)
- control.removeItem(0)
+ control.removeItem(control.itemAt(0))
compare(control.count, 1)
compare(control.currentIndex, 0)
- control.removeItem(0)
+ control.removeItem(control.itemAt(0))
compare(control.count, 0)
compare(control.currentIndex, -1)
}
@@ -338,7 +338,7 @@ TestCase {
verify(compareObjectNames(control.contentChildren, ["button4", "button2", "button1", "button3"]))
compare(contentChildrenSpy.count, 4)
- control.removeItem(0)
+ control.removeItem(control.itemAt(0))
verify(compareObjectNames(control.contentData, ["object", "button1", "timer", "button2", "", "button3"]))
verify(compareObjectNames(control.contentChildren, ["button2", "button1", "button3"]))
compare(contentChildrenSpy.count, 5)
@@ -705,7 +705,7 @@ TestCase {
compare(tab1.index, 3)
// remove from the beginning
- control.removeItem(0)
+ control.removeItem(control.itemAt(0))
compare(tab2.index, -1)
compare(tab2.tabBar, null)
compare(tab2.position, TabBar.Header)
@@ -715,7 +715,7 @@ TestCase {
compare(tab1.index, 2)
// remove from the middle
- control.removeItem(1)
+ control.removeItem(control.itemAt(1))
compare(tab3.index, -1)
compare(tab3.tabBar, null)
compare(tab3.position, TabBar.Header)