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

Method data

plugins/textdocumentinspector/textdocumentformatmodel.cpp:54–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54QVariant TextDocumentFormatModel::data(const QModelIndex &index, int role) const
55{
56 if (!index.isValid())
57 return QVariant();
58
59 if (role == Qt::DisplayRole) {
60 const int enumValue = propertyEnum().value(index.row());
61 switch (index.column()) {
62 case 0:
63 return QString::fromLatin1(propertyEnum().key(index.row()));
64 case 1:
65 return VariantHandler::displayString(m_format.property(enumValue));
66 case 2:
67 return QString::fromLatin1(m_format.property(enumValue).typeName());
68 }
69 } else if (role == Qt::DecorationRole && index.column() == 1) {
70 const int enumValue = propertyEnum().value(index.row());
71 return VariantHandler::decoration(m_format.property(enumValue));
72 }
73
74 return QVariant();
75}
76
77QVariant TextDocumentFormatModel::headerData(int section, Qt::Orientation orientation,
78 int role) const

Callers 5

documentSelectedMethod · 0.45
documentContextMenuMethod · 0.45
documentSelectedMethod · 0.45

Calls 10

propertyEnumFunction · 0.85
displayStringFunction · 0.85
rowMethod · 0.80
columnMethod · 0.80
keyMethod · 0.80
QVariantClass · 0.50
isValidMethod · 0.45
valueMethod · 0.45
propertyMethod · 0.45
typeNameMethod · 0.45

Tested by 5

documentSelectedMethod · 0.36
documentContextMenuMethod · 0.36
documentSelectedMethod · 0.36