QTimer from a non QThread
-
wrote on 3 Mar 2016, 16:40 last edited by
Can QTimer be called from a normal C++ main and not a QThread or a main using a QCoreApplication?
-
Can QTimer be called from a normal C++ main and not a QThread or a main using a QCoreApplication?
Can QTimer be called from
What does this mean?
A timer object will generate thetimeout()
signal at (almost) regular intervals, you can subscribe to that and do whatever you want. What do you want to call from aQTimer
instance? If you mean to useQTimer
without an event loop (i.e. withoutQCoreApplication
), well then, no you can't do that. -
Can QTimer be called from a normal C++ main and not a QThread or a main using a QCoreApplication?
@slilly said:
Can QTimer be called from a normal C++ main and not a QThread or a main using a QCoreApplication?
No. If you want to use QTimer, then you need
QCoreApplication::exec()
orQThread::exec()
.
1/3