diff options
author | Luca Weiss <luca@z3ntu.xyz> | 2020-05-18 19:48:58 +0200 |
---|---|---|
committer | Luca Weiss <luca@z3ntu.xyz> | 2020-05-18 19:49:44 +0200 |
commit | b420ba136d169353204e853ccdfa2c4433a94a22 (patch) | |
tree | ffad99a8dad9c1cf02061ad8013e15f9d20dd59e | |
parent | bca9dd336065c5a12cb3e4c3b7f52fb778bb42d6 (diff) | |
download | qmenumodel-b420ba136d169353204e853ccdfa2c4433a94a22.tar.gz qmenumodel-b420ba136d169353204e853ccdfa2c4433a94a22.tar.bz2 qmenumodel-b420ba136d169353204e853ccdfa2c4433a94a22.zip |
Remove use of the deprecated QModelIndex::child function
-rw-r--r-- | tests/client/treetest.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/client/treetest.cpp b/tests/client/treetest.cpp index 81399f7..3c2827b 100644 --- a/tests/client/treetest.cpp +++ b/tests/client/treetest.cpp @@ -75,25 +75,25 @@ private Q_SLOTS: QCOMPARE(menu.rowCount(row3), 3); QCOMPARE(menu.data(row3, QMenuModel::Label).toString(), QString("menu3")); - QModelIndex row4 = row3.child(0, 0); + QModelIndex row4 = row3.model()->index(0, 0, row3); QVERIFY(row4.isValid()); QCOMPARE(menu.rowCount(row4), 0); QCOMPARE(menu.data(row4, QMenuModel::Depth).toInt(), 1); QCOMPARE(menu.data(row4, QMenuModel::Label).toString(), QString("menu4")); - QModelIndex row5 = row3.child(1, 0); + QModelIndex row5 = row3.model()->index(1, 0, row3); QVERIFY(row5.isValid()); QCOMPARE(menu.rowCount(row5), 2); QCOMPARE(menu.data(row5, QMenuModel::Depth).toInt(), 1); QCOMPARE(menu.data(row5, QMenuModel::Label).toString(), QString("menu5")); - QModelIndex row6 = row5.child(0, 0); + QModelIndex row6 = row5.model()->index(0, 0, row5); QVERIFY(row6.isValid()); QCOMPARE(menu.rowCount(row6), 0); QCOMPARE(menu.data(row6, QMenuModel::Depth).toInt(), 2); QCOMPARE(menu.data(row6, QMenuModel::Label).toString(), QString("menu6")); - QModelIndex row7 = row5.child(1, 0); + QModelIndex row7 = row5.model()->index(1, 0, row5); QVERIFY(row7.isValid()); QCOMPARE(menu.rowCount(row7), 0); QCOMPARE(menu.data(row7, QMenuModel::Depth).toInt(), 2); |