MCPcopy Create free account
hub / github.com/cc20110101/RedisView / showTabRightMenu

Method showTabRightMenu

src/RedisView/AppView/MainWidget.cpp:522–541  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520}
521
522void MainWidget::showTabRightMenu(const QPoint &pos) {
523 _tabIndex = _tabBar->tabAt(pos);
524 if(_tabIndex == -1)
525 return;
526
527 _tabMenu->clear();
528 QWidget *tabPage = ui->_tabWidget->widget(_tabIndex);
529 int index = _tabPage.indexOf(tabPage);
530 if(index == 0) {
531 _tabMenu->addAction(_closeView);
532 } else if(index == 1) {
533 _tabMenu->addAction(_closeCmd);
534 } else if(index == 2){
535 _tabMenu->addAction(_closeMsg);
536 } else {
537 return;
538 }
539 _tabMenu->move(_tabBar->cursor().pos());
540 _tabMenu->show();
541}
542
543void MainWidget::closeView() {
544 _displayViewTab = false;

Callers

nothing calls this directly

Calls 2

moveMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected