QTimer is slow on mac if application is running in background
I created a simple timer application.
timer = new QTimer(this);
It runs accurately on Windows and Mac according to my tests.
However, if I put the application in background (such as placing another application window on top of it), the timer is slower by about 30% or more.
This doesn't happen on Windows whether the application is on top or not.
Any ideas to fix it?
Hi and welcome to devnet,
You should provide a minimal compilable example that shows the behavior so it can be tested.
Also, which version of Qt and OS X are you using ?
I have read your post on "another thread":http://qt-project.org/forums/viewthread/37750, in which you suggested
defaults write <app domain name> NSAppSleepDisabled -bool YES
However, I am wondering if there is a way to build this configuration into a Qt app, so that users don't have to do this themselves?
About the source code, I have put it on "github":https://github.com/codelol/QtTimer. I have also upload binaries in "release". Please try it :)
Versions: Qt 5.3, Mac OS 10.9.4 64bit.