[Qt-interest] QTimer still fires after stop() AND delete

Josiah Bryan jbryan at productiveconcepts.com
Fri Oct 16 23:08:20 CEST 2009


Hi All -

I think I'm going crazy, but this really seems to be what is happening:

I've got a QTimer that I set to trigger changing of a widget label. The 
user can also trigger the widget label using a button in the form. If 
the user changes the label before the timer times out, then my code 
calls the stop() method on the timer. However, the slot that is connect 
to the timer is STILL CALLED even after stop is called.

Okay, I thought it was just my mind playing tricks. So, instead of just 
calling stop(), I stop(); disconnect(timer,0,this,0); delete timer; 
timer=0; ... and the slot connect to the timer is STILL called.

I know its the timer because the slot being called is ONLY connected to 
that timer. Additionally, the gdb stack dump reports Qtimer::timerEvent 
and QTimer::timeout in the stack that calls the slot.

How can that possibly be? Why is the slot being called even though I've 
stopped the timer?

Thanks!
-josiah

-- 

-=-=-=-=-=-=-=-=-=-=-=-=-
Josiah Bryan
Productive Concepts, Inc.
jbryan at pciint.com
(765) 964-6009, ext. 224




More information about the Qt-interest-old mailing list