Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
New Developer
Posts: 7
Registered: ‎05-09-2013
My Device: Blackberry z10
My Carrier: mobilink
Accepted Solution

Can qtimer run forever in blackberry 10?

Is there a way to run the qtimer forever so that it calls a function after a specified interval of time?

Developer
Posts: 1,524
Registered: ‎12-18-2012
My Device: Z30, Z10 LE, DevAlpha C, PlayBook

Re: Can qtimer run forever in blackberry 10?

Sure:

QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
timer->start(1000);

 update() slot will be called every second.

 

QTimer docs have more samples & information:

http://qt-project.org/doc/qt-4.8/qtimer.html

 

 

 


Andrey Fidrya, @zmeyc on twitter