| 43 | QmlTypeTab::~QmlTypeTab() = default; |
| 44 | |
| 45 | void QmlTypeTab::contextMenu(QPoint pos) |
| 46 | { |
| 47 | // TODO share this with PropertiesTab |
| 48 | const auto idx = ui->typeView->indexAt(pos); |
| 49 | if (!idx.isValid()) |
| 50 | return; |
| 51 | |
| 52 | const auto actions = idx.data(PropertyModel::ActionRole).toInt(); |
| 53 | const auto objectId = idx.data(PropertyModel::ObjectIdRole).value<ObjectId>(); |
| 54 | ContextMenuExtension ext(objectId); |
| 55 | const bool canShow = actions != PropertyModel::NoAction |
| 56 | || ext.discoverPropertySourceLocation(ContextMenuExtension::GoTo, idx); |
| 57 | |
| 58 | if (!canShow) |
| 59 | return; |
| 60 | |
| 61 | QMenu contextMenu; |
| 62 | ext.populateMenu(&contextMenu); |
| 63 | contextMenu.exec(ui->typeView->viewport()->mapToGlobal(pos)); |
| 64 | } |
nothing calls this directly
no test coverage detected