[Interest] General QTimer question

Jason Kretzer Jason at gocodigo.com
Thu Dec 12 13:57:22 CET 2013


Good Morning!

This is more a general question about the behavior of QTimer followed by a more specific instance of the question.

What can make a QTimer not timeout()?  In a general sense, what can make it miss its firing?

That was the general question.  My specific situation:

I display 3 QWebViews.  They are to be displayed on different parts of a screen for 20 seconds.  The 20 seconds is arbitrary, they could have different durations.  I have a QTimer that fires every second.  During any given second any of the three QWebViews can be triggered to start to display.  During each timeout of the QTimer, a slot is called which does the following
{
ALL content(html) that is supposed to start during this second are pulled from a QMultiMap.  There can be several - up to 3.
A for loop is used to iterate over them and show them as below.
They are loaded into a QWebView, geometry is set on the QWebView.
QWebView is shown
A SingleShot timer is set up to deleteLater the QWebView after the duration has expired.
}

In the case where durations for the content are all the same - lets say 20seconds - the QWebViews are basically synched up where they all start and stop on the same second.  Then the second right after they stop, they all three start up again.

Here is where the weirdness starts:  exactly every 1 minute, the QTimer which is supposed to fire every 1 second stops firing for 20-22seconds.  At the beginning of that time, the three QWebViews finish their previous time and leave as expected.  Then, nothing for 20-22 seconds.  The screen where they are supposed to be is blank.  I put qDebugs in the firing slot so I could see when it was being called but nothing.  I don't see qDebug messages from anywhere else either during that time.  Like clockwork though, after the 20-22seconds of nothing, the QTimer starts firing again and repeats.

So, generally, what can keep a QTimer from firing like that?  I don't have any processes that run every 1 minute like that.  Also, I am asking the QTimer to fire every 1 second - it is not like I am trying to get 10ms precision here.

If it makes any difference, this is a win7 pro OS.

Ideas?  I was intentionally a bit vague above as I am just asking for things to look for so that I can discover the answer on my own instead of just being given the answer.

Thanks!

-Jason

- - - - - - - - - - - - - - - - - - - - - - -
Jason R. Kretzer

Application Developer
Google # 606-887-9011
Cell # 606-792-0079
Jason at gocodigo.com<mailto:Jason at gocodigo.com>

"quidquid latine dictum sit altum videtur"

[cid:image001.png at 01CEF70B.C82CC040]


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131212/638d2061/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 13452 bytes
Desc: image001.png
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131212/638d2061/attachment.png>


More information about the Interest mailing list