115 this->updateRecentlyOpenedDocumentsMenu(); |
115 this->updateRecentlyOpenedDocumentsMenu(); |
116 } |
116 } |
117 |
117 |
118 void MainWindow::openModelForEditing(const QString& modelName) |
118 void MainWindow::openModelForEditing(const QString& modelName) |
119 { |
119 { |
120 Document* document = new Document{this->documents.findModelByName(modelName)}; |
120 Document* document = new Document{this->documents.findModelByName(modelName), &this->documents}; |
121 this->ui->tabs->addTab(document, modelName); |
121 this->ui->tabs->addTab(document, modelName); |
122 this->ui->tabs->setCurrentWidget(document); |
122 this->ui->tabs->setCurrentWidget(document); |
123 document->restoreSplitterState(this->documentSplitterState); |
123 document->restoreSplitterState(this->documentSplitterState); |
124 connect(document, &Document::splitterChanged, this, &MainWindow::handleDocumentSplitterChange); |
124 connect(document, &Document::splitterChanged, this, &MainWindow::handleDocumentSplitterChange); |
125 } |
125 } |