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

Function testInitialSelectionTransfer

tests/networkselectionmodeltest.cpp:209–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207 }
208
209 void testInitialSelectionTransfer()
210 {
211 QStandardItemModel serverModel;
212 FakeNetworkSelectionModel serverSelection(ServerAddress, &serverModel);
213 fillModel(&serverModel);
214 serverSelection.select(serverModel.index(3, 0), QItemSelectionModel::ClearAndSelect);
215
216 QTest::qWait(100);
217
218 QStandardItemModel clientModel;
219 fillModel(&clientModel);
220 FakeNetworkSelectionModel clientSelection(ClientAddress, &clientModel);
221 QSignalSpy clientSpy(&clientSelection, &FakeNetworkSelectionModel::selectionChanged);
222 QVERIFY(clientSpy.isValid());
223
224 clientSelection.requestSelection(); // usually called by SelectionModelClient
225
226 QCOMPARE(clientSelection.selection().size(), 1);
227 QCOMPARE(clientSelection.selection().first().topLeft(), clientModel.index(3, 0));
228 QCOMPARE(clientSpy.size(), 1);
229 }
230
231 void testCurrent()
232 {

Callers

nothing calls this directly

Calls 5

requestSelectionMethod · 0.80
selectMethod · 0.45
indexMethod · 0.45
isValidMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected