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

Method editorEvent

Extension/Script/scriptmodel.cpp:171–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171bool ScriptItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index)
172{
173 QMouseEvent *pEvent = static_cast<QMouseEvent *> (event);
174 switch (event->type())
175 {
176 case QEvent::MouseMove:
177 {
178 mousePos = pEvent->pos();
179 break;
180 }
181 case QEvent::MouseButtonPress:
182 {
183 if (pEvent->button() == Qt::LeftButton && !(pEvent->modifiers()&Qt::ControlModifier) && !(pEvent->modifiers()&Qt::ShiftModifier))
184 {
185 QRect settingRect(getIconRect(0, option, index)), menuRect(getIconRect(1, option, index));
186 if (settingRect.isValid() && settingRect.contains(pEvent->pos()))
187 emit settingClicked(index);
188 else if (menuRect.isValid() && menuRect.contains(pEvent->pos()))
189 emit menuClicked(index);
190 }
191 break;
192 }
193 default:
194 break;
195 }
196 return KTreeviewItemDelegate::editorEvent(event,model,option,index);
197}
198
199QPoint ScriptItemDelegate::getIconStartPos(const QStyleOptionViewItem &option, const QModelIndex &index) const
200{

Callers

nothing calls this directly

Calls 3

typeMethod · 0.45
isValidMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected