Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.9.2
-
None
-
Qt 5.9.2
Mac OS X Sierra(10.12)
Description
When you have a timer and a hidden window on Mac using the QtWidgets/QApplication(I guess that QGuiApplication should be also affected) the timers are fired with delay of seconds.
Here is exactly my case. I have a QApplication based app with setQuitOnLastWindowClosed(false). On startup the application creates a hidden QDialog and starts listening for events based on shared memory. I use QBasicTimer to check the shared memory every 100ms and if needed I bring up the QDialog(non-modal). However after several seconds the timerEvents starts to dispatch with a delay of more than 5 seconds. If the QDialog is visible there is no issues. I did hit the pause button and it seems that the code is stuck somewhere in QCocoaEventDispatcher:: processEvents().
This bug is not present if I use QCoreApplication but I see that it's event loop is not based on QCocoaEventDispatcher.
Update: I have attached a sample project that reproduce the bug. Just run it and wait about 30-40 seconds. The timer will begin to fire much slower.