summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2020-09-16 17:49:05 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-09-17 06:45:59 +0200
commitfe3bebbd68e9b0eca1b4cef8671853ed4ff630d2 (patch)
tree9f4ead4dd451e90e2604cae150b138d4eec9ce2a /tests/auto/widgets
parentb850322147250a1bd35d5c63e958dec161284244 (diff)
Fix deprecation warnings in tests
Adjust to changes to QIcon::pixmap, QMetaType::type, and QAbstractItemView::itemDelegate. Change-Id: I9eb0331ef899131afc86c33f27feeee76331ffc8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'tests/auto/widgets')
-rw-r--r--tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
index 94f3e52ff3..7a22128af3 100644
--- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
@@ -1069,7 +1069,7 @@ void tst_QTreeView::itemDelegateForColumnOrRow()
QVERIFY(!view.itemDelegateForRow(0));
QVERIFY(!view.itemDelegateForColumn(0));
- QCOMPARE(view.itemDelegate(QModelIndex()), defaultDelegate);
+ QCOMPARE(view.itemDelegateForIndex(QModelIndex()), defaultDelegate);
QStandardItemModel model;
for (int i = 0; i < 100; ++i) {
@@ -1085,26 +1085,26 @@ void tst_QTreeView::itemDelegateForColumnOrRow()
QVERIFY(!view.itemDelegateForRow(0));
QVERIFY(!view.itemDelegateForColumn(0));
- QCOMPARE(view.itemDelegate(QModelIndex()), defaultDelegate);
- QCOMPARE(view.itemDelegate(view.model()->index(0, 0)), defaultDelegate);
+ QCOMPARE(view.itemDelegateForIndex(QModelIndex()), defaultDelegate);
+ QCOMPARE(view.itemDelegateForIndex(view.model()->index(0, 0)), defaultDelegate);
QPointer<QAbstractItemDelegate> rowDelegate = new QStyledItemDelegate;
view.setItemDelegateForRow(0, rowDelegate);
QVERIFY(!rowDelegate->parent());
QCOMPARE(view.itemDelegateForRow(0), rowDelegate);
- QCOMPARE(view.itemDelegate(view.model()->index(0, 0)), rowDelegate);
- QCOMPARE(view.itemDelegate(view.model()->index(0, 1)), rowDelegate);
- QCOMPARE(view.itemDelegate(view.model()->index(1, 0)), defaultDelegate);
- QCOMPARE(view.itemDelegate(view.model()->index(1, 1)), defaultDelegate);
+ QCOMPARE(view.itemDelegateForIndex(view.model()->index(0, 0)), rowDelegate);
+ QCOMPARE(view.itemDelegateForIndex(view.model()->index(0, 1)), rowDelegate);
+ QCOMPARE(view.itemDelegateForIndex(view.model()->index(1, 0)), defaultDelegate);
+ QCOMPARE(view.itemDelegateForIndex(view.model()->index(1, 1)), defaultDelegate);
QPointer<QAbstractItemDelegate> columnDelegate = new QStyledItemDelegate;
view.setItemDelegateForColumn(1, columnDelegate);
QVERIFY(!columnDelegate->parent());
QCOMPARE(view.itemDelegateForColumn(1), columnDelegate);
- QCOMPARE(view.itemDelegate(view.model()->index(0, 0)), rowDelegate);
- QCOMPARE(view.itemDelegate(view.model()->index(0, 1)), rowDelegate); // row wins
- QCOMPARE(view.itemDelegate(view.model()->index(1, 0)), defaultDelegate);
- QCOMPARE(view.itemDelegate(view.model()->index(1, 1)), columnDelegate);
+ QCOMPARE(view.itemDelegateForIndex(view.model()->index(0, 0)), rowDelegate);
+ QCOMPARE(view.itemDelegateForIndex(view.model()->index(0, 1)), rowDelegate); // row wins
+ QCOMPARE(view.itemDelegateForIndex(view.model()->index(1, 0)), defaultDelegate);
+ QCOMPARE(view.itemDelegateForIndex(view.model()->index(1, 1)), columnDelegate);
view.setItemDelegateForRow(0, nullptr);
QVERIFY(!view.itemDelegateForRow(0));
@@ -2496,7 +2496,7 @@ void tst_QTreeView::spanningItems()
for (int i = 0; i < model.rowCount(QModelIndex()); ++i) {
if (!view.isFirstColumnSpanned(i, QModelIndex())) {
QModelIndex index = model.index(i, 0, QModelIndex());
- w = qMax(w, view.itemDelegate(index)->sizeHint(option, index).width() + view.indentation());
+ w = qMax(w, view.itemDelegateForIndex(index)->sizeHint(option, index).width() + view.indentation());
}
}
QCOMPARE(view.sizeHintForColumn(0), w);