aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2020-05-08 13:41:53 +0200
committerMitch Curtis <mitch.curtis@qt.io>2020-05-11 11:48:06 +0200
commite0b356af9e747171dbdfc0d2935336ef14b4839d (patch)
tree65c05b70cc3f272ba7ddf0bc82a8a7e8efa7d6fa /tests
parent0d18bfe6b33afc38b65f23996f1e9ffb4fba6e69 (diff)
Menu: remove deprecated removeItem(var) overload
[ChangeLog][Controls][Menu] The deprecated removeItem(var) function was removed. removeItem(Item) or takeItem(int) can be used instead. Change-Id: I79757c22b4f81e1b380798623bd1f15eb09c1647 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/controls/data/tst_menuitem.qml4
-rw-r--r--tests/auto/qquickmenu/data/removeTakeItem.qml4
-rw-r--r--tests/auto/qquickmenu/tst_qquickmenu.cpp6
3 files changed, 2 insertions, 12 deletions
diff --git a/tests/auto/controls/data/tst_menuitem.qml b/tests/auto/controls/data/tst_menuitem.qml
index 27c23ae5..ef074d1d 100644
--- a/tests/auto/controls/data/tst_menuitem.qml
+++ b/tests/auto/controls/data/tst_menuitem.qml
@@ -182,11 +182,11 @@ TestCase {
compare(item1.menu, control)
compare(item2.menu, control)
- control.removeItem(1)
+ control.removeItem(control.itemAt(1))
compare(item1.menu, control)
compare(item2.menu, null)
- control.removeItem(0)
+ control.removeItem(control.itemAt(0))
compare(item1.menu, null)
compare(item2.menu, null)
}
diff --git a/tests/auto/qquickmenu/data/removeTakeItem.qml b/tests/auto/qquickmenu/data/removeTakeItem.qml
index 8352bffd..7e930812 100644
--- a/tests/auto/qquickmenu/data/removeTakeItem.qml
+++ b/tests/auto/qquickmenu/data/removeTakeItem.qml
@@ -72,10 +72,6 @@ ApplicationWindow {
menu.removeItem(null)
}
- function removeFirstIndex() {
- menu.removeItem(0)
- }
-
Menu {
id: menu
MenuItem {
diff --git a/tests/auto/qquickmenu/tst_qquickmenu.cpp b/tests/auto/qquickmenu/tst_qquickmenu.cpp
index 22aece0c..54a5d9f4 100644
--- a/tests/auto/qquickmenu/tst_qquickmenu.cpp
+++ b/tests/auto/qquickmenu/tst_qquickmenu.cpp
@@ -1013,12 +1013,6 @@ void tst_QQuickMenu::removeTakeItem()
QCOMPARE(menuItem3->menu(), menu);
QCoreApplication::sendPostedEvents(menuItem3, QEvent::DeferredDelete);
QVERIFY(!menuItem3.isNull());
-
- // deprecated removeItem(int) does not destroy
- QVERIFY(QMetaObject::invokeMethod(window, "removeFirstIndex"));
- QVERIFY(!menuItem3->menu());
- QCoreApplication::sendPostedEvents(menuItem3, QEvent::DeferredDelete);
- QVERIFY(!menuItem3.isNull());
}
void tst_QQuickMenu::subMenuMouse_data()