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

Method testWidget

tests/modelinspectortest.cpp:318–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316 }
317
318 void testWidget()
319 {
320 createProbe();
321
322 std::unique_ptr<QStringListModel> targetModel(new QStringListModel);
323 targetModel->setObjectName("targetModel");
324 targetModel->setStringList(QStringList() << "item1"
325 << "item2"
326 << "item3");
327 QTest::qWait(1); // trigger model inspector plugin loading
328
329 ClientToolManager mgr;
330 mgr.requestAvailableTools();
331 auto widget = mgr.widgetForId("gammaray_modelinspector");
332 QVERIFY(widget);
333 widget->show();
334
335 const auto views = widget->findChildren<QAbstractItemView *>();
336 for (auto view : views) {
337 QVERIFY(view->model());
338 }
339 }
340};
341
342QTEST_MAIN(ModelInspectorTest)

Callers

nothing calls this directly

Calls 3

widgetForIdMethod · 0.80
requestAvailableToolsMethod · 0.45
modelMethod · 0.45

Tested by

no test coverage detected