@ -296,6 +296,11 @@ void MainWindow::about()
msgBox.exec();
}
void MainWindow::closeEvent(QCloseEvent * event)
{
m_contentChanged && !closeFile() ? event->ignore() : event->accept();
void MainWindow::setTitle(const QString &title)
if (title.isEmpty())
@ -35,6 +35,9 @@ public slots:
void keys();
void about();
protected:
void closeEvent(QCloseEvent * event);
private:
void setTitle(const QString &title);