MCPcopy Create free account
hub / github.com/KikoPlayProject/KikoPlay / getIconRect

Method getIconRect

Extension/Script/scriptmodel.cpp:212–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

210}
211
212QRect ScriptItemDelegate::getIconRect(int type, const QStyleOptionViewItem &option, const QModelIndex &index) const
213{
214 QPoint startPos = getIconStartPos(option, index);
215 bool hasSetting = index.data(ScriptHasSettingRole).toBool();
216 bool hasMenu = index.data(ScriptHasMenuRole).toBool();
217
218 if (type == 0) // setting
219 {
220 return hasSetting ? QRect(startPos, QSize(iconSize, iconSize)) : QRect();
221 }
222 else if (type == 1) // menu
223 {
224 QPoint move{hasSetting ? iconSize + space : 0, 0};
225 return hasMenu ? QRect(startPos + move, QSize(iconSize, iconSize)) : QRect();
226 }
227 return QRect();
228}

Callers

nothing calls this directly

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected