| 200 | |
| 201 | |
| 202 | GraphicContainer* 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 | |
| 238 | MainWindow::~MainWindow() |
| 239 | { |
nothing calls this directly
no test coverage detected