[Qt-qml] background timers in QML ?

103 views
Skip to first unread message

Sivan Greenberg

unread,
Dec 30, 2011, 1:44:18 PM12/30/11
to qt-...@trolltech.com
Hi all,

I am wondering if there's a recommended way to have background
timersin Qt Quick apps? My primary use case is an app that reminds me
to do stuff at periodical times, and for that I thought to install a
timer per each item that need be reminded, but I wanted to try and see
if there's a better way or a standard way for that?

Also, it would be nice to have just the timer running firing the app
only when the reminder needs to happen.

Share you experience if you've done this before, and open source code
to learn from would be greatly appreciated :)

Merry Xmas and soon to be Happy New Year,

Thanks!

--
-Sivan
_______________________________________________
Qt-qml mailing list
Qt-...@qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-qml

Bo Thorsen

unread,
Dec 31, 2011, 3:40:36 AM12/31/11
to qt-...@qt.nokia.com
Den 30-12-2011 19:44, Sivan Greenberg skrev:
> Hi all,
>
> I am wondering if there's a recommended way to have background
> timersin Qt Quick apps? My primary use case is an app that reminds me
> to do stuff at periodical times, and for that I thought to install a
> timer per each item that need be reminded, but I wanted to try and see
> if there's a better way or a standard way for that?
>
> Also, it would be nice to have just the timer running firing the app
> only when the reminder needs to happen.
>
> Share you experience if you've done this before, and open source code
> to learn from would be greatly appreciated :)

Remember that QML children have access to parent objects. So if you have
a top of the tree, you can place the timer there and access it from all
the other objects by id name. Personally, I really don't like this, but
it's an option for you.

Another would be to do this in C++ and expose the object by name so it's
available to all of them.

Bo Thorsen,
Fionia Software.

--

Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk

Reply all
Reply to author
Forward
0 new messages