c++ - Will QTimer timeout signal be sent after stop() is called? -
i working on qt 5.5 / 4.8 now. worry whether timeout()
signal (occasionally)sent after timer explicitly stopped calling stop()
on instance?
i hope timeout()
signal sent between start()
, stop()
, truth?
my situation is: start()
, stop()
both called in main thread, , timeout()
signal connect directly connection. (i know queued connection cannot guarantee above statement.)
quick answer: no, won't called on of cases, there @ least 1 exception.
a situation when may called if have used queued connections. here may associated slots called after you've stopped if, example, qtimer::timeout
signal happens emitted before stopping timer.
in case above slots queued (but not called), may happen call qtimer::stop
before slots invoked.
if use queued connections can check qtimer::isactive()
@ beginning of slot (you'll need way access timer of course, maybe member of class).
Comments
Post a Comment