Poll method for QMainWindow
-
You can use "QCoreApplication::hasPendingEvents":http://doc.qt.nokia.com/4.7/qcoreapplication.html#hasPendingEvents to check if the application is idle.
-
[quote author="avidamic" date="1309357224"]I think the QTimer with 0 interval is what I need to do. Basically I need to have a method in my QMainWindow subclass to get called every frame. thanks.[/quote]
What do you mean by frame? This timer only calls you, when there is nothing else to do.
-
MFC also does not talk of frames. The event loop (also in MFC) is just a while loop that waits for messages in a queue. In MFC there is afaik no method that is called each time, the loop is executed (not by default).
Every tick would be really fast as tick is typically processor dependent... And if you want to have it each loop, that is overwriting QCoreApplication::notify or installing an event Filkter on the application object. But that would only be called, if there is an event to process.
like in standard windows:
@
while(GetMessage(msg))
{
TranslateMessage(msg);
DispatchMessage(msg);
}
@You would hang in line 3, so if there is no methode --> no call.