In the documentation it says about QWidget ::activateWindow():
"On Windows, if you are calling this when the application is not currently the active one then it will not make it the active window. It will change the color of the taskbar entry to indicate that the window has changed in some way. This is because Microsoft does not allow an application to interrupt what the user is currently doing in another application."
One could add to the documentation that there is a workaround to this problem. Namely changing the following registry keys will result in the desired behaviour
ForegroundFlashCount = REG_DWORD 0x00000003
ForegroundLockTimeout = REG_DWORD 0x00000000
After changing the registry keys a restart of the computer (or log-off and relog-on of the user) is required to make this workaround work.