MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / editorEvent

Method editorEvent

src/plugins/binarytools/models/toolitemdelegate.cpp:75–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75bool ToolItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *model,
76 const QStyleOptionViewItem &option,
77 const QModelIndex &index)
78{
79 if (event->type() == QEvent::MouseButtonRelease || event->type() == QEvent::MouseButtonDblClick) {
80 QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event);
81 const QRect arRect = arrowRect(option.rect);
82 if (arRect.contains(mouseEvent->pos())) {
83 if (view()->isExpanded(index)) {
84 view()->collapse(index);
85 } else {
86 view()->expand(index);
87 }
88 return true;
89 }
90 }
91
92 return false;
93}
94
95QTreeView *ToolItemDelegate::view() const
96{

Callers

nothing calls this directly

Calls 3

typeMethod · 0.45
containsMethod · 0.45
expandMethod · 0.45

Tested by

no test coverage detected