| 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 | |
| 146 | QTEST_MAIN(MethodModelTest) |
nothing calls this directly
no test coverage detected