MCPcopy Create free account
hub / github.com/BehaviorTree/Groot / onTabCustomContextMenuRequested

Method onTabCustomContextMenuRequested

bt_editor/mainwindow.cpp:1369–1390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1367}
1368
1369void 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
1392void MainWindow::onTabRenameRequested(int tab_index, QString new_name)
1393{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected