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

Method getIconStartPos

Extension/Script/scriptmodel.cpp:199–210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199QPoint ScriptItemDelegate::getIconStartPos(const QStyleOptionViewItem &option, const QModelIndex &index) const
200{
201 int totalWidth = 0;
202 bool hasSetting = index.data(ScriptHasSettingRole).toBool();
203 bool hasMenu = index.data(ScriptHasMenuRole).toBool();
204 if (hasSetting) totalWidth += space + iconSize;
205 if (hasMenu) totalWidth += space + iconSize;
206
207 int x = (option.rect.width() - totalWidth) / 2 + option.rect.x();
208 int y = (option.rect.height() - iconSize) / 2 + option.rect.y();
209 return QPoint(x, y);
210}
211
212QRect ScriptItemDelegate::getIconRect(int type, const QStyleOptionViewItem &option, const QModelIndex &index) const
213{

Callers

nothing calls this directly

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected