software/final/alf_gui/src/mainwindow.cpp
void MainWindow::closeEvent(QCloseEvent *event) {

    QMessageBox::StandardButton resBtn = QMessageBox::question(this, "ALF", tr("Are you sure to quit?"));

    if (resBtn != QMessageBox::Yes) {

        event->ignore();

    } else {
        closeFlag = false;
        disConServer();
        event->accept();

    }
}
/**
 * close the main window
 *
 * @param event: QCloseEvent*
 */
close the main window
@param event: QCloseEvent
close the main window @param event : QCloseEvent
void MainWindow::closeEvent(QCloseEvent *event) {
    QMessageBox::StandardButton resBtn = QMessageBox::question(this, "ALF", tr("Are you sure to quit?"));
    if (resBtn != QMessageBox::Yes) {
        event->ignore();
    } else {
        closeFlag = false;
        disConServer();
        event->accept();
    }
}
void MainWindow :: closeEvent ( QCloseEvent * event ) { QMessageBox :: StandardButton resBtn = QMessageBox :: question ( this , " " , tr ( " " ) ) ; if ( resBtn != QMessageBox :: Yes ) { event -> ignore ( ) ; } else { closeFlag = false ; disConServer ( ) ; event -> accept ( ) ; } }
close the main window
 @param event: QCloseEvent
close the main window @param event : QCloseEvent