-void MainWindow::closeEvent(QCloseEvent *event){
- if(params->isCurrentProject){
- QMessageBox msgBox;
- msgBox.setText("The project has been modified.");
- msgBox.setInformativeText("Do you want to save your changes?");
- msgBox.setStandardButtons(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
- msgBox.setDefaultButton(QMessageBox::Save);
-
- int ret = msgBox.exec();
-
- switch(ret) {
- case QMessageBox::Save :
- slotSaveProject();
- slotCloseProject();
- break;
- case QMessageBox::Discard :
- slotCloseProject();
- break;
- }