Main window's close event is cought and handled due to content change

master
Denes Matetelki 14 years ago
parent edad97d19a
commit 165842b1fd

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

@ -35,6 +35,9 @@ public slots:
void keys(); void keys();
void about(); void about();
protected:
void closeEvent(QCloseEvent * event);
private: private:
void setTitle(const QString &title); void setTitle(const QString &title);

Loading…
Cancel
Save