IS there any possible substitute of Qtimer? that maybe less developed that Qtimer thats found in 4.7 and above versions, I have QT4.6.3. from which I cannot deviate/move forward from so I wanted to know timers that would be 4.6 qt compatible?
Asked
Active
Viewed 77 times
1 Answers
2
QTimer was available even in Qt 3.x.
However if you need something more simple you can use QObject::startTimer()
for your object and reimplement the QObject::timerEvent()
event handler in your class (which must inherit QObject).
Another alternative is to use QBasicTimer.
For more info see (for Qt 4.6): http://doc.qt.digia.com/4.6/timers.html

asclepix
- 7,971
- 3
- 31
- 41
-
thanks! I'm not able to include the QTimer it says no such file or directory ,what setup I should do for that? – Naaz Jun 26 '14 at 18:54
-
@Naaz Your installation of Qt is broken, then. Qt 4.6 gives you both `QBasicTimer` and `QTimer`. But, in any case, come on, you can debug this. Look for files named `QTimer*` and `QBasicTimer*` in your Qt installation. – Kuba hasn't forgotten Monica Jun 26 '14 at 19:22
-
There's little reason to use `QObject::startTimer` since you need to retain the timer id anyway. That id is encapsulated by `QBasicTimer`, and it's the right thing to use if you want something more lightweight than a `QTimer`. Usually, the following holds: `Q_ASSERT(sizeof(QBasicTimer) == sizeof(int))`. – Kuba hasn't forgotten Monica Jun 26 '14 at 19:25
-
@KubaOber okay I was able to locate the QTimer header file but I had to copy it to my headers folder so that its now found and I make the programme successfully! – Naaz Jun 26 '14 at 20:01