bonjour ,
je bloque sur un petit problème tout bête mais pourtant je ne comprend pas mon erreur.
J'ai crée un messageBox personnalisé afin de quitter mon application si aucun fichier n'est sélectionné.
mes fênetres se ferment bien mais mon processus tourne toujours . J'ai donc essayé qApp.quit() mais rien ne marche et franchement je voit pas pourquoi.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 QMessageBox msgBoxQuestionFermeture; msgBoxQuestionFermeture.setIcon(QMessageBox::Question); msgBoxQuestionFermeture.setText("voulez-vous quitter l'application ?"); msgBoxQuestionFermeture.setWindowTitle("Aucune sélection"); QPushButton *btnFermetureOui = msgBoxQuestionFermeture.addButton("Oui",QMessageBox::YesRole); QPushButton *btnFermetureNon = msgBoxQuestionFermeture.addButton("Non",QMessageBox::NoRole); msgBoxQuestionFermeture.exec(); if(msgBoxQuestionFermeture.clickedButton() == btnFermetureOui){ // QObject::connect(btnFermetureOui,SIGNAL(clicked()),qApp,SLOT(quit())); close(); // QApplication::setQuitOnLastWindowClosed(true); // qApp->quit(); // qApp->quitOnLastWindowClosed(); } else if(msgBoxQuestionFermeture.clickedButton() == btnFermetureNon) { rechercheFichier(); }
pourriez vous m'aidez svp merci beaucoup
Bonne journée
Partager