src/mainwindow.cpp

changeset 174
3016b494685c
parent 170
9b655f6fe5a1
child 178
a23024fc98e0
equal deleted inserted replaced
173:8a3047468994 174:3016b494685c
197 connect(document, &Document::newStatusText, [&](const QString& newStatusText) 197 connect(document, &Document::newStatusText, [&](const QString& newStatusText)
198 { 198 {
199 this->statusBar()->showMessage(newStatusText); 199 this->statusBar()->showMessage(newStatusText);
200 }); 200 });
201 const QFileInfo fileInfo{*this->documents.modelPath(modelId)}; 201 const QFileInfo fileInfo{*this->documents.modelPath(modelId)};
202 this->ui->tabs->addTab(document, fileInfo.baseName()); 202 QString tabName = fileInfo.baseName();
203 if (tabName.isEmpty())
204 {
205 tabName = tr("<unnamed>");
206 }
207 this->ui->tabs->addTab(document, tabName);
203 this->ui->tabs->setCurrentWidget(document); 208 this->ui->tabs->setCurrentWidget(document);
204 document->restoreSplitterState(this->documentSplitterState); 209 document->restoreSplitterState(this->documentSplitterState);
205 } 210 }
206 211
207 void MainWindow::runSettingsEditor() 212 void MainWindow::runSettingsEditor()

mercurial