MCPcopy Create free account
hub / github.com/KDE/kdevelop / data

Method data

kdevplatform/language/classmodel/classmodel.cpp:97–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97QVariant ClassModel::data(const QModelIndex& index, int role) const
98{
99 if (!index.isValid())
100 return QVariant();
101
102 Node* node = static_cast<Node*>(index.internalPointer());
103
104 if (role == Qt::DisplayRole)
105 return node->displayName();
106
107 if (role == Qt::DecorationRole) {
108 QIcon icon = node->cachedIcon();
109 return icon.isNull() ? QVariant() : icon;
110 }
111
112 return QVariant();
113}
114
115QVariant ClassModel::headerData(int, Qt::Orientation, int role) const
116{

Callers 1

declarationMethod · 0.45

Calls 5

displayNameMethod · 0.80
cachedIconMethod · 0.80
isNullMethod · 0.80
QVariantClass · 0.50
isValidMethod · 0.45

Tested by

no test coverage detected