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
New Contributor
iOsBoy
Posts: 7
Registered: ‎05-09-2013
My Device: Blackberry z10
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
Zmey
Posts: 1,512
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

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