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

Method testModel

tests/methodmodeltest.cpp:73–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71 }
72
73 static void testModel()
74 {
75 ObjectMethodModel srcModel;
76 ClientMethodModel model;
77 model.setSourceModel(&srcModel);
78
79 srcModel.setMetaObject(&staticMetaObject);
80
81 QVERIFY(model.rowCount() > 0);
82
83 auto idx = searchContainsIndex(&model, "deleteLater()");
84 QVERIFY(idx.isValid());
85 QVERIFY(idx.data(ObjectMethodModelRole::MethodSignature).toString().startsWith(QLatin1String("deleteLater")));
86 QCOMPARE(idx.sibling(idx.row(), 1).data().toString(), QLatin1String("Slot"));
87 QVERIFY(idx.sibling(idx.row(), 1).data(ObjectMethodModelRole::MethodSignature).isNull());
88 QCOMPARE(idx.sibling(idx.row(), 2).data().toString(), QLatin1String("Public"));
89 QCOMPARE(idx.sibling(idx.row(), 3).data().toString(), QLatin1String("QObject"));
90
91 srcModel.setMetaObject(nullptr);
92 QCOMPARE(model.rowCount(), 0);
93 }
94
95 static void testToolTip_data()
96 {

Callers

nothing calls this directly

Calls 7

rowMethod · 0.80
setSourceModelMethod · 0.45
setMetaObjectMethod · 0.45
rowCountMethod · 0.45
isValidMethod · 0.45
dataMethod · 0.45
isNullMethod · 0.45

Tested by

no test coverage detected