MCPcopy Create free account
hub / github.com/KDE/labplot / contextMenuEvent

Method contextMenuEvent

src/3rdparty/Qt-Advanced-Docking-System/src/AutoHideTab.cpp:385–412  ·  view source on GitHub ↗

============================================================================

Source from the content-addressed store, hash-verified

383
384//============================================================================
385void CAutoHideTab::contextMenuEvent(QContextMenuEvent* ev)
386{
387 ev->accept();
388 d->saveDragStartMousePosition(ev->globalPos());
389
390 const bool isFloatable = d->DockWidget->features().testFlag(CDockWidget::DockWidgetFloatable);
391 QAction* Action;
392 QMenu Menu(this);
393
394 Action = Menu.addAction(tr("Detach"), this, SLOT(setDockWidgetFloating()));
395 Action->setEnabled(isFloatable);
396 auto IsPinnable = d->DockWidget->features().testFlag(CDockWidget::DockWidgetPinnable);
397 Action->setEnabled(IsPinnable);
398
399 auto menu = Menu.addMenu(tr("Pin To..."));
400 menu->setEnabled(IsPinnable);
401 d->createAutoHideToAction(tr("Top"), SideBarTop, menu);
402 d->createAutoHideToAction(tr("Left"), SideBarLeft, menu);
403 d->createAutoHideToAction(tr("Right"), SideBarRight, menu);
404 d->createAutoHideToAction(tr("Bottom"), SideBarBottom, menu);
405
406 Action = Menu.addAction(tr("Unpin (Dock)"), this, SLOT(unpinDockWidget()));
407 Menu.addSeparator();
408 Action = Menu.addAction(tr("Close"), this, SLOT(requestCloseDockWidget()));
409 Action->setEnabled(d->DockWidget->features().testFlag(CDockWidget::DockWidgetClosable));
410
411 Menu.exec(ev->globalPos());
412}
413
414
415//============================================================================

Callers

nothing calls this directly

Calls 7

acceptMethod · 0.80
addSeparatorMethod · 0.80
execMethod · 0.80
featuresMethod · 0.45
setEnabledMethod · 0.45

Tested by

no test coverage detected