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

Method data

plugins/quickinspector/quickoverlaylegend.cpp:114–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112 }
113
114 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
115 {
116 if (hasIndex(index.row(), index.column(), index.parent())) {
117 const Item &item(m_items[index.row()]);
118
119 switch (role) {
120 // Return a pixmap so the view will draw it at the given size instead of the view icon size
121 case Qt::DecorationRole:
122 return item.pixmap;
123 case Qt::ForegroundRole:
124 return item.pen.brush();
125 case Qt::DisplayRole:
126 return LegendModel::tr(item.label.constData());
127 case Qt::SizeHintRole:
128 return QSize(-1, (item.pixmap.height() / item.pixmap.devicePixelRatio()) + (2 * 2));
129 }
130 }
131
132 return QVariant();
133 }
134
135 void setSettings(const QuickDecorationsSettings &settings)
136 {

Callers 1

setOverlaySettingsMethod · 0.45

Calls 5

QSizeClass · 0.85
rowMethod · 0.80
columnMethod · 0.80
QVariantClass · 0.50
parentMethod · 0.45

Tested by

no test coverage detected