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

Method createTab

bt_editor/mainwindow.cpp:202–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200
201
202GraphicContainer* MainWindow::createTab(const QString &name)
203{
204 if( _tab_info.count(name) > 0)
205 {
206 throw std::runtime_error(std::string("There is already a Tab named ") + name.toStdString() );
207 }
208 GraphicContainer* ti = new GraphicContainer( _model_registry, this );
209 _tab_info.insert( {name, ti } );
210
211 ti->scene()->setLayout( _current_layout );
212
213 ui->tabWidget->addTab( ti->view(), name );
214
215 ti->scene()->createNodeAtPos( "Root", "Root", QPointF(-30,-30) );
216 ti->zoomHomeView();
217
218 //--------------------------------
219
220 connect( ti, &GraphicContainer::undoableChange,
221 this, &MainWindow::onPushUndo );
222
223 connect( ti, &GraphicContainer::undoableChange,
224 this, &MainWindow::onSceneChanged );
225
226 connect( ti, &GraphicContainer::requestSubTreeExpand,
227 this, &MainWindow::onRequestSubTreeExpand );
228
229 connect( ti, &GraphicContainer::requestSubTreeCreate,
230 this, &MainWindow::onCreateAbsBehaviorTree);
231
232 connect( ti, &GraphicContainer::addNewModel,
233 this, &MainWindow::onAddToModelRegistry);
234
235 return ti;
236}
237
238MainWindow::~MainWindow()
239{

Callers

nothing calls this directly

Calls 5

setLayoutMethod · 0.80
sceneMethod · 0.80
viewMethod · 0.80
zoomHomeViewMethod · 0.80
QPointFClass · 0.50

Tested by

no test coverage detected