Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Animating an image
Harry443 last edited by
I want to display an image for certain time interval depending on a condition.It should be like flashing an image after that time interval.I am using timers for it but can anyone suggest some good idea?
thanks in advance:)
I'd say a timer is the way to go. Either a standalone QTimer, or the built-in timer functionality inherent in QObject (startTimer(), killTimer(), timerEvent(), etc.)
Do you know if QML timer is reliable ?
What's your definition of "reliable?" It should be as reliable as any other timer.
Do you know how accurate is it ?
It depends on your underlying OS. It's not going to be realtime or at a single-digit ms resolution typically.
Depends on your use case of how reliable you need. Keep in mind that other items in the event queue can also affect how often timer ticks are processed.
There are also some other threads on the forum here which have discussed QTimer resolution.
Is there as difference between the Qt C++ Timer and the QML Timer ?
QML should be using the same timer mechanism that the C++ code uses (though I haven't verified that by looking at the sources.) But I can't imagine them reinventing the wheel specifically for QML.
Where can I find the QML sources ?
bq. The source code is available as a zip (260 MB) or a tar.gz (228 MB). Or visit the repository at qt.gitorious.org/qt.
It would be under .../src/declarative (and some headers strewn about)
Just a warning... There's a lot of code involved, though.
Again, though, I ask... what is it that you're trying to accomplish? If you describe what you're trying to do, we can probably give you better feedback as to whether the timer mechanism is sufficient.