| 32 | } |
| 33 | |
| 34 | QVariant 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 | |
| 61 | QMap<int, QVariant> ObjectMethodModel::itemData(const QModelIndex &index) const |
| 62 | { |
nothing calls this directly
no test coverage detected