How to stop a QTimer::singleShot
-
"QTimer::stop() ":http://doc.qt.nokia.com/4.7/qtimer.html#stop does not work?
-
[quote author="Volker" date="1301580963"]"QTimer::stop() ":http://doc.qt.nokia.com/4.7/qtimer.html#stop does not work?[/quote]
I start it with:
@
QTimer::singleShot(360000, this, SLOT(mySlot()));
@ -
[quote author="Luca" date="1301581026"]
[quote author="Volker" date="1301580963"]"QTimer::stop() ":http://doc.qt.nokia.com/4.7/qtimer.html#stop does not work?[/quote]I start it with:
@
QTimer::singleShot(360000, this, SLOT(mySlot()));
@
[/quote]If you change that to something like:
@
m_myLongTimer = new QTimer(this);
m_myLongTimer->setInterval(360000);
m_myLongTimer->setSingleShot(true);
connect(m_myLongTimer, SIGNAL(timeout()), SLOT(myslot()));
m_myLongTimer->start();
@You can use this to stop again:
@
m_myLongTimer->stop();
@Edit: added connect call to sample code