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

Method testInvokeMethod

tests/methodmodeltest.cpp:124–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 }
123
124 void testInvokeMethod()
125 {
126 auto iface = ObjectBroker::object<MethodsExtensionInterface *>("com.kdab.GammaRay.ObjectInspector.methodsExtension");
127 auto model = ObjectBroker::model("com.kdab.GammaRay.ObjectInspector.methods");
128 auto selModel = ObjectBroker::selectionModel(model);
129
130 static_cast<MethodsExtension *>(iface)->setQObject(this);
131
132 QVERIFY(model->rowCount() > 0);
133
134 auto idx = searchContainsIndex(model, "bumpI()");
135 QVERIFY(idx.isValid());
136
137 selModel->select(idx, QItemSelectionModel::Rows | QItemSelectionModel::ClearAndSelect);
138
139 iface->activateMethod();
140 iface->invokeMethod(Qt::AutoConnection);
141
142 QCOMPARE(i, 1);
143 }
144};
145
146QTEST_MAIN(MethodModelTest)

Callers

nothing calls this directly

Calls 6

setQObjectMethod · 0.45
rowCountMethod · 0.45
isValidMethod · 0.45
selectMethod · 0.45
activateMethodMethod · 0.45
invokeMethodMethod · 0.45

Tested by

no test coverage detected