Suppose, after I made a call to QTimer::singleShort, application logic requires cancellation of this operation. I don' see a way to cancel it, is it possible to do?
Thanks!
Suppose, after I made a call to QTimer::singleShort, application logic requires cancellation of this operation. I don' see a way to cancel it, is it possible to do?
Thanks!
No, you have no access to the actual timer created by the static call.
You can create a single shot (zero time) timer explicitly and you should be able to stop() or delete that object before it fires.
Alternatively, track whether a single-shot timer is needed separately in a bool variable. Then, just before returning control to the event loop, create the single shot timer if required.
TorAn (3rd April 2016)
Bookmarks