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
Regular Contributor
dlacerte
Posts: 68
Registered: ‎03-12-2013
My Device: BB Z10
My Carrier: Rogers

QTimer using start(0) stops getting events after a while!

I am using a QTimer with the special case of start(0) which is supposed to call the timer callback whenever the event queue is empty. This timer runs constantly (i.e. I start it and don't stop it until shutdown). My application runs fine for quite a while but then sometimes this timer stops getting called. The application continues to run and the UI is responsive but this timer no longer fires (I set a breakpoint in the timer routine and the logging verifies this).

 

QTimer GuiTaskQueue::s_timer;  // static timer for our class

 

GuiTaskQueue::GuiTaskQueue() : super(NULL)
{

  connect(&s_timer, SIGNAL(timeout()), this, SLOT(onTimer()));

  s_timer.start(0); // special case, we get called whenever the event queue is empty
}

Please use plain text.