============================================================================
| 383 | |
| 384 | //============================================================================ |
| 385 | void 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 | //============================================================================ |
nothing calls this directly
no test coverage detected