| 185 | } |
| 186 | |
| 187 | void testDelayedSelectionUpdate() |
| 188 | { |
| 189 | QStandardItemModel serverModel; |
| 190 | FakeNetworkSelectionModel serverSelection(ServerAddress, &serverModel); |
| 191 | fillModel(&serverModel); |
| 192 | |
| 193 | QStandardItemModel clientModel; |
| 194 | FakeNetworkSelectionModel clientSelection(ClientAddress, &clientModel); |
| 195 | QSignalSpy clientSpy(&clientSelection, &FakeNetworkSelectionModel::selectionChanged); |
| 196 | QVERIFY(clientSpy.isValid()); |
| 197 | QVERIFY(!clientSelection.hasSelection()); |
| 198 | |
| 199 | serverSelection.select(serverModel.index(4, 0), QItemSelectionModel::ClearAndSelect); |
| 200 | QTest::qWait(100); |
| 201 | fillModel(&clientModel); |
| 202 | clientSelection.applyPendingSelection(); // usually triggered by SelectionModelClient |
| 203 | |
| 204 | QCOMPARE(clientSelection.selection().size(), 1); |
| 205 | QCOMPARE(clientSelection.selection().first().topLeft(), clientModel.index(4, 0)); |
| 206 | QCOMPARE(clientSpy.size(), 1); |
| 207 | } |
| 208 | |
| 209 | void testInitialSelectionTransfer() |
| 210 | { |
nothing calls this directly
no test coverage detected