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

Method sizeHint

Extension/Script/scriptmodel.cpp:157–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157QSize ScriptItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
158{
159 if (index.column() == static_cast<int>(ScriptModel::Columns::OPERATE))
160 {
161 int totalWidth = iconSize + space * 2;
162 if (index.data(ScriptHasSettingRole).toBool()) totalWidth += space + iconSize;
163 if (index.data(ScriptHasMenuRole).toBool()) totalWidth += space + iconSize;
164
165 return QSize(totalWidth, iconSize + space * 2);
166
167 }
168 return KTreeviewItemDelegate::sizeHint(option, index);
169}
170
171bool ScriptItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index)
172{

Callers 1

setviewMethod · 0.45

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected