From 557b8573d8f001b7e68eee7c9df3f3937bd3280c Mon Sep 17 00:00:00 2001 From: Denes Matetelki Date: Wed, 22 Jun 2011 16:56:02 +0200 Subject: [PATCH] mainwindow::closeevent handles all the quit events --- mainwindow.cpp | 11 ++--------- mainwindow.h | 1 - 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 5442d52..fb71c21 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -25,8 +25,9 @@ MainWindow::MainWindow(QWidget *parent) : this, SLOT(closeFile())); connect(m_ui->actionExport, SIGNAL(activated()), this, SLOT(exportScene())); + connect(m_ui->actionQuit, SIGNAL(activated()), - this, SLOT(quit())); + QApplication::instance(), SLOT(quit())); connect(m_ui->actionAbout_QtMindMap, SIGNAL(activated()), this, SLOT(about())); @@ -208,14 +209,6 @@ void MainWindow::exportScene() } } -void MainWindow::quit() -{ - if (m_contentChanged && !closeFile()) - return; - - QApplication::instance()->quit(); -} - void MainWindow::keys() { QMessageBox msgBox(this); diff --git a/mainwindow.h b/mainwindow.h index 319ad74..43472a3 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -30,7 +30,6 @@ public slots: bool saveFileAs(); bool closeFile(); void exportScene(); - void quit(); void keys(); void about();