Bonjour,
En fait lorsque je quitte l'application elle quitte en seg fault, mais le problème est que je comprends pas trop la trace fourni par gdb.
J'ai l'impression qu'il ya un problème au niveau de l'event loop Qt mais je vois pas quoi.
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 #0 0x00007fffdfb322b1 in QVTKWidget::SetRenderWindow (this=0x92d0f0, w=0x0) #1 0x00007fffdfb326d7 in ~QVTKWidget (this=0x92d0f0, __in_chrg=<value optimized out>) #2 0x00007fffe148c9ee in qDeleteInEventHandler (o=0x92d0f0) #3 0x00007fffe148f547 in QObject::event (this=0x92d0f0, e=0x986ab0) #4 0x00007fffdfb321f1 in QVTKWidget::event (this=0x92d0f0, e=0x986ab0) #5 0x00007fffe02bd7e5 in QApplicationPrivate::notify_helper (this=0x74a080, receiver=0x92d0f0, e=0x986ab0) at kernel/qapplication.cpp:4242 #6 0x00007fffe02c01db in QApplication::notify (this=0x7fffffffd660, receiver=0x92d0f0, e=0x986ab0) at kernel/qapplication.cpp:4207 #7 0x00007fffe1478727 in QCoreApplication::notifyInternal (this=0x7fffffffd660, receiver=0x92d0f0, event=0x986ab0) at kernel/qcoreapplication.cpp:704 #8 0x00007fffe147d917 in QCoreApplication::sendEvent (receiver=0x92d0f0, event=0x986ab0) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215 #9 0x00007fffe1478cfc in QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=52, data=0x749aa0) at kernel/qcoreapplication.cpp:1345 #10 0x00007fffe147900c in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=52) at kernel/qcoreapplication.cpp:1238 #11 0x00007fffe14791b2 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:988 #12 0x00007fffe02c0218 in QApplication::exec () at kernel/qapplication.cpp:3570 ....
Je poste pas de code car je travaille sur un framework et il sera difficile poster les sources.
C'est pourquoi je cherche une idée, une suggestion qui pourrait m'aider parce que j'ai tous essayé.
Je précise que j'utilise 3 connect pour voir ce qu'il se passe :
windowClosed() : j'affiche juste que la dernière fenetre visible viens d'êttre fermée, mais quand j'affiche qApp->closeDown() il renvoie toujours 0 (donc il reste des fenêtre pas fermées ?).
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 QObject::connect(&app, SIGNAL(lastWindowClosed()), this, SLOT(windowClosed())); // appelé QObject::connect(&app, SIGNAL(aboutToQuit()), this, SLOT(exit()));// pas appelé QObject::connect(&app, SIGNAL(destroyed()), this, SLOT(printDestruction())); //pas appelé
Le signal aboutToQuit() n'a pas le temps d'être émis car la seg fault survient apres le slot(que j'ai crée) windowClosed() ou avant exit() (je sais pas trop).
Idem pour le signal destroyed().
Je precise que même avec un setAttribute(Qt::WA_QuitOnClose) ça ne marche pas.
Merci de votre aide.
Partager