| 142 | } |
| 143 | |
| 144 | void ComponentLibTreeView::contextMenuEvent(QContextMenuEvent *event) |
| 145 | { |
| 146 | if (!_editMode) |
| 147 | return; |
| 148 | |
| 149 | const QModelIndex &index = indexAt(event->pos()); |
| 150 | if (!index.isValid()) |
| 151 | return; |
| 152 | |
| 153 | const QModelIndex &indexFile = _sortProxy->mapToSource(index); |
| 154 | if (!indexFile.isValid()) |
| 155 | return; |
| 156 | |
| 157 | QMenu menu; |
| 158 | menu.addAction(_removeAction); |
| 159 | menu.exec(event->globalPos()); |
| 160 | } |
| 161 | |
| 162 | ComponentLibItemModel *ComponentLibTreeView::model() const |
| 163 | { |