I searched the internet but there is very little documentation available on BlackBerry 10 development. Is there something in BlackBerry 10 that allows you to run a function forever after specified intervals of time? Like there is NSTimer in iPhone/Objective-C that can run a function after every x minutes or so.
相关问题
- Timer vs. repetitive background worker
- setInterval doesn't slow down on inactive tab
- Timers not running when screen is turned off / dev
- How to set timer in an event handler?
- extra argument userinfo in call
相关文章
- Is the HPET directly accessible in Windows?
- Blinking Button for Simon Says
- Timer Label not updated after switching views (swi
- Indy TIdTCPClient receive text
- A HR timers precision study case
- Chrono Timer Not Converting Seconds Properly
- How to move several buttons throughout the screen
- How to install a draft app on a blackberry sandbox
Use QTimer.
Connect timeout signal of timer with your function.
As a more general answer, because you will likely run into the same problem again, you have to treat BB10 as a completely different operating system and development environment because it is. Unlike the old environment though, the documentation is actually quite good. For example finding information on timers is as simple as going to the Cascades documentation site, selecting API Reference and typing 'timer' into the filter text box.
You will also find a wealth of help in the form of sample applications and general documentation and guidelines.
As pointed by @Sorry_Boss, you can use QTimer on C++ code. If you want to do that in QML, you can also register it for use in QML in the constructor of your app class, like this:
Then, you can import it in your QML file:
... and use it as an attached object to another component:
Yes this can be done with QTimer
In cpp