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

Method metaData

core/objectmethodmodel.cpp:34–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34QVariant ObjectMethodModel::metaData(const QModelIndex &index, const QMetaMethod &method,
35 int role) const
36{
37 if (role == Qt::DisplayRole && index.column() == 0) {
38 return Util::prettyMethodSignature(method);
39 } else if (role == ObjectMethodModelRole::MetaMethod) {
40 return QVariant::fromValue(method);
41 } else if (role == ObjectMethodModelRole::MetaMethodType && index.column() == 1) {
42 return QVariant::fromValue(method.methodType());
43 } else if (role == ObjectMethodModelRole::MethodAccess && index.column() == 2) {
44 return QVariant::fromValue(method.access());
45 } else if (role == ObjectMethodModelRole::MethodSignature && index.column() == 0) {
46 return method.methodSignature();
47 } else if (role == ObjectMethodModelRole::MethodTag && index.column() == 0 && qstrlen(method.tag())) {
48 return method.tag();
49 } else if (role == ObjectMethodModelRole::MethodRevision && index.column() == 0) {
50 return method.revision();
51 } else if (role == ObjectMethodModelRole::MethodIssues && index.column() == 0) {
52 const QMetaObject *mo = m_metaObject;
53 while (mo->methodOffset() > index.row())
54 mo = mo->superClass();
55 const auto r = QMetaObjectValidator::checkMethod(mo, method);
56 return r == QMetaObjectValidatorResult::NoIssue ? QVariant() : QVariant::fromValue(r);
57 }
58 return QVariant();
59}
60
61QMap<int, QVariant> ObjectMethodModel::itemData(const QModelIndex &index) const
62{

Callers

nothing calls this directly

Calls 5

columnMethod · 0.80
revisionMethod · 0.80
rowMethod · 0.80
superClassMethod · 0.80
QVariantClass · 0.70

Tested by

no test coverage detected