diff --git a/tests/units/presentation/availablesourcesmodeltest.cpp b/tests/units/presentation/availablesourcesmodeltest.cpp --- a/tests/units/presentation/availablesourcesmodeltest.cpp +++ b/tests/units/presentation/availablesourcesmodeltest.cpp @@ -200,14 +200,14 @@ // Not overly efficient way of signaling the change, but doesn't happen often QCOMPARE(spy.count(), 4); - QCOMPARE(spy.at(0).at(0).value(), source1Index); - QCOMPARE(spy.at(0).at(1).value(), source1Index); - QCOMPARE(spy.at(1).at(0).value(), source3Index); - QCOMPARE(spy.at(1).at(1).value(), source3Index); - QCOMPARE(spy.at(2).at(0).value(), source4Index); - QCOMPARE(spy.at(2).at(1).value(), source4Index); - QCOMPARE(spy.at(3).at(0).value(), source2Index); - QCOMPARE(spy.at(3).at(1).value(), source2Index); + QCOMPARE(spy.at(0).at(0).toModelIndex(), source1Index); + QCOMPARE(spy.at(0).at(1).toModelIndex(), source1Index); + QCOMPARE(spy.at(1).at(0).toModelIndex(), source3Index); + QCOMPARE(spy.at(1).at(1).toModelIndex(), source3Index); + QCOMPARE(spy.at(2).at(0).toModelIndex(), source4Index); + QCOMPARE(spy.at(2).at(1).toModelIndex(), source4Index); + QCOMPARE(spy.at(3).at(0).toModelIndex(), source2Index); + QCOMPARE(spy.at(3).at(1).toModelIndex(), source2Index); QVERIFY(sourceQueriesMock(&Domain::DataSourceQueries::changeDefaultSource).when(source4).exactly(1)); } diff --git a/tests/units/presentation/querytreemodeltest.cpp b/tests/units/presentation/querytreemodeltest.cpp --- a/tests/units/presentation/querytreemodeltest.cpp +++ b/tests/units/presentation/querytreemodeltest.cpp @@ -284,11 +284,11 @@ // THEN QCOMPARE(aboutToBeInsertedSpy.size(), 1); - QCOMPARE(aboutToBeInsertedSpy.first().at(0).value(), QModelIndex()); + QCOMPARE(aboutToBeInsertedSpy.first().at(0).toModelIndex(), QModelIndex()); QCOMPARE(aboutToBeInsertedSpy.first().at(1).toInt(), 0); QCOMPARE(aboutToBeInsertedSpy.first().at(2).toInt(), 0); QCOMPARE(insertedSpy.size(), 1); - QCOMPARE(insertedSpy.first().at(0).value(), QModelIndex()); + QCOMPARE(insertedSpy.first().at(0).toModelIndex(), QModelIndex()); QCOMPARE(insertedSpy.first().at(1).toInt(), 0); QCOMPARE(insertedSpy.first().at(2).toInt(), 0); } @@ -353,11 +353,11 @@ // THEN QCOMPARE(aboutToBeInsertedSpy.size(), 1); - QCOMPARE(aboutToBeInsertedSpy.first().at(0).value(), model.index(0, 0)); + QCOMPARE(aboutToBeInsertedSpy.first().at(0).toModelIndex(), model.index(0, 0)); QCOMPARE(aboutToBeInsertedSpy.first().at(1).toInt(), 1); QCOMPARE(aboutToBeInsertedSpy.first().at(2).toInt(), 1); QCOMPARE(insertedSpy.size(), 1); - QCOMPARE(insertedSpy.first().at(0).value(), model.index(0, 0)); + QCOMPARE(insertedSpy.first().at(0).toModelIndex(), model.index(0, 0)); QCOMPARE(insertedSpy.first().at(1).toInt(), 1); QCOMPARE(insertedSpy.first().at(2).toInt(), 1); } @@ -438,27 +438,27 @@ QCOMPARE(removedSpy.size(), 4); for (int i = 0; i < aboutToBeRemovedSpy.size(); i++) { if (i != 3) - QCOMPARE(aboutToBeRemovedSpy.at(i).at(0).value(), removeIndex); + QCOMPARE(aboutToBeRemovedSpy.at(i).at(0).toModelIndex(), removeIndex); else - QCOMPARE(aboutToBeRemovedSpy.at(i).at(0).value(), QModelIndex()); + QCOMPARE(aboutToBeRemovedSpy.at(i).at(0).toModelIndex(), QModelIndex()); QCOMPARE(aboutToBeRemovedSpy.at(i).at(1).toInt(), 0); QCOMPARE(aboutToBeRemovedSpy.at(i).at(2).toInt(), 0); if (i != 3) - QCOMPARE(removedSpy.at(i).at(0).value(), removeIndex); + QCOMPARE(removedSpy.at(i).at(0).toModelIndex(), removeIndex); else - QCOMPARE(removedSpy.at(i).at(0).value(), QModelIndex()); + QCOMPARE(removedSpy.at(i).at(0).toModelIndex(), QModelIndex()); QCOMPARE(removedSpy.at(i).at(1).toInt(), 0); QCOMPARE(removedSpy.at(i).at(2).toInt(), 0); } QCOMPARE(aboutToBeInsertedSpy.size(), 3); QCOMPARE(insertedSpy.size(), 3); for (int i = 0; i < aboutToBeInsertedSpy.size(); i++) { - QCOMPARE(aboutToBeInsertedSpy.at(i).at(0).value(), QModelIndex()); + QCOMPARE(aboutToBeInsertedSpy.at(i).at(0).toModelIndex(), QModelIndex()); QCOMPARE(aboutToBeInsertedSpy.at(i).at(1).toInt(), i + 3); QCOMPARE(aboutToBeInsertedSpy.at(i).at(2).toInt(), i + 3); - QCOMPARE(insertedSpy.at(i).at(0).value(), QModelIndex()); + QCOMPARE(insertedSpy.at(i).at(0).toModelIndex(), QModelIndex()); QCOMPARE(insertedSpy.at(i).at(1).toInt(), i + 3); QCOMPARE(insertedSpy.at(i).at(1).toInt(), i + 3); } @@ -528,10 +528,10 @@ // THEN QCOMPARE(dataChangedSpy.size(), 2); - QCOMPARE(dataChangedSpy.first().at(0).value(), model.index(2, 0)); - QCOMPARE(dataChangedSpy.first().at(1).value(), model.index(2, 0)); - QCOMPARE(dataChangedSpy.last().at(0).value(), model.index(2, 0, model.index(0, 0))); - QCOMPARE(dataChangedSpy.last().at(1).value(), model.index(2, 0, model.index(0, 0))); + QCOMPARE(dataChangedSpy.first().at(0).toModelIndex(), model.index(2, 0)); + QCOMPARE(dataChangedSpy.first().at(1).toModelIndex(), model.index(2, 0)); + QCOMPARE(dataChangedSpy.last().at(0).toModelIndex(), model.index(2, 0, model.index(0, 0))); + QCOMPARE(dataChangedSpy.last().at(1).toModelIndex(), model.index(2, 0, model.index(0, 0))); } void shouldAllowEditsAndChecks() diff --git a/tests/units/presentation/tasklistmodeltest.cpp b/tests/units/presentation/tasklistmodeltest.cpp --- a/tests/units/presentation/tasklistmodeltest.cpp +++ b/tests/units/presentation/tasklistmodeltest.cpp @@ -112,11 +112,11 @@ // THEN QCOMPARE(aboutToBeInsertedSpy.size(), 1); - QCOMPARE(aboutToBeInsertedSpy.first().at(0).value(), QModelIndex()); + QCOMPARE(aboutToBeInsertedSpy.first().at(0).toModelIndex(), QModelIndex()); QCOMPARE(aboutToBeInsertedSpy.first().at(1).toInt(), 1); QCOMPARE(aboutToBeInsertedSpy.first().at(2).toInt(), 1); QCOMPARE(insertedSpy.size(), 1); - QCOMPARE(insertedSpy.first().at(0).value(), QModelIndex()); + QCOMPARE(insertedSpy.first().at(0).toModelIndex(), QModelIndex()); QCOMPARE(insertedSpy.first().at(1).toInt(), 1); QCOMPARE(insertedSpy.first().at(2).toInt(), 1); } @@ -141,11 +141,11 @@ // THEN QCOMPARE(aboutToBeRemovedSpy.size(), 1); - QCOMPARE(aboutToBeRemovedSpy.first().at(0).value(), QModelIndex()); + QCOMPARE(aboutToBeRemovedSpy.first().at(0).toModelIndex(), QModelIndex()); QCOMPARE(aboutToBeRemovedSpy.first().at(1).toInt(), 0); QCOMPARE(aboutToBeRemovedSpy.first().at(2).toInt(), 0); QCOMPARE(removedSpy.size(), 1); - QCOMPARE(removedSpy.first().at(0).value(), QModelIndex()); + QCOMPARE(removedSpy.first().at(0).toModelIndex(), QModelIndex()); QCOMPARE(removedSpy.first().at(1).toInt(), 0); QCOMPARE(removedSpy.first().at(2).toInt(), 0); } @@ -170,8 +170,8 @@ // THEN QCOMPARE(dataChangedSpy.size(), 1); - QCOMPARE(dataChangedSpy.first().at(0).value(), model.index(2)); - QCOMPARE(dataChangedSpy.first().at(1).value(), model.index(2)); + QCOMPARE(dataChangedSpy.first().at(0).toModelIndex(), model.index(2)); + QCOMPARE(dataChangedSpy.first().at(1).toModelIndex(), model.index(2)); } void shouldAllowEditsAndChecks()