MCPcopy Create free account
hub / github.com/KDAB/GammaRay / testDelayedSelectionUpdate

Function testDelayedSelectionUpdate

tests/networkselectionmodeltest.cpp:187–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 5

applyPendingSelectionMethod · 0.80
isValidMethod · 0.45
selectMethod · 0.45
indexMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected