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

Method testDFGrab

tests/quicktexturetest.cpp:53–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51 }
52
53 void testDFGrab()
54 {
55 if (!showSource("qrc:/manual/textures.qml"))
56 return;
57
58 auto remoteView = ObjectBroker::object<RemoteViewInterface *>("com.kdab.GammaRay.ObjectInspector.texture.remoteView");
59 QVERIFY(remoteView);
60 QSignalSpy frameSpy(remoteView, &RemoteViewInterface::frameUpdated);
61 QVERIFY(frameSpy.isValid());
62 remoteView->setViewActive(true);
63
64 QQuickItem *textItem = nullptr;
65 foreach (auto item, view()->rootObject()->findChildren<QQuickItem *>()) {
66 if (strcmp(item->metaObject()->className(), "QQuickText") == 0)
67 textItem = item;
68 }
69 QVERIFY(textItem);
70 Probe::instance()->selectObject(textItem, QPoint());
71
72 QVERIFY(frameSpy.wait() || frameSpy.size() >= 1);
73 const auto last = frameSpy.size() - 1;
74 const auto frame = frameSpy.at(last).at(0).value<RemoteViewFrame>();
75 QVERIFY(frame.viewRect().height() > 0);
76 QVERIFY(frame.viewRect().width() > 0);
77 }
78
79 void testShaderEffectSourceGrab()
80 {

Callers

nothing calls this directly

Calls 7

showSourceFunction · 0.85
QPointClass · 0.85
viewRectMethod · 0.80
isValidMethod · 0.45
setViewActiveMethod · 0.45
selectObjectMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected