| 1367 | } |
| 1368 | |
| 1369 | void MainWindow::onTabCustomContextMenuRequested(const QPoint &pos) |
| 1370 | { |
| 1371 | int tab_index = ui->tabWidget->tabBar()->tabAt( pos ); |
| 1372 | |
| 1373 | QMenu menu(this); |
| 1374 | QAction* rename = menu.addAction("Rename"); |
| 1375 | |
| 1376 | connect( rename, &QAction::triggered, this, [this, tab_index]() |
| 1377 | { |
| 1378 | onTabRenameRequested(tab_index); |
| 1379 | } ); |
| 1380 | |
| 1381 | QAction* set_main = menu.addAction("Set as main tree"); |
| 1382 | |
| 1383 | connect( set_main, &QAction::triggered, this, [this, tab_index]() |
| 1384 | { |
| 1385 | onTabSetMainTree(tab_index); |
| 1386 | } ); |
| 1387 | |
| 1388 | QPoint globalPos = ui->tabWidget->tabBar()->mapToGlobal(pos); |
| 1389 | menu.exec(globalPos); |
| 1390 | } |
| 1391 | |
| 1392 | void MainWindow::onTabRenameRequested(int tab_index, QString new_name) |
| 1393 | { |
nothing calls this directly
no outgoing calls
no test coverage detected