[Qt-interest] signals and slots, combination and execution order

hilbert at beuth-hochschule.de hilbert at beuth-hochschule.de
Wed Jun 10 01:05:25 CEST 2009


hello,

i have a QLineEdit with the signal 'editingFinished()' connected to 'slot1
()'. there is also a QPushButton with the signal 'clicked()' connected to 
another 'slot2()'. as to be expected: when the text in the QLineEdit is 
changed and the QPushButton ist clicked both slots are executed. in my 
case 'slot1()' is always called first. in some cases i need to execute a 
QMessegeBox::question(...) in 'slot1()' and wait for the return value of the 
question box. if this is the case, the QPushButton hangs (at least visually) 
in the 'pressed' state and 'slot2()' is never called. the 'clicked()'-signal 
of the QPushButton seems to be lost even when the connection is set to 
Qt::QueuedConnection. is there an easy or at least a reasonable way to solve 
this problem without tricky event-handling?

no other threads than the main-gui-thread are involved at this stage of the 
programm. i already tested a bit with an event filter. as far as i got the 
event for the button release seems to be eaten up by the modal 
QMessegeBox::question dialog. for me it would be awkward to ask for any 
QPushButton states in slot1 (and when to do this would generate further 
difficulties)...

and how could i possibly determine the order of the calls?

thanx & best regards,
andreas
--
Open WebMail Project (http://openwebmail.org)




More information about the Qt-interest-old mailing list