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.
|For Gerrit Dashboard: QTBUG-14062|
|142635,5||QtPlatformHeaders/Windows: Add function to set window activation behavior.||5.7||qt/qtbase||Status: MERGED||+2||0|
|230927,5||Fix QWindowsNativeInterface::platformFunction()||5.11||qt/qtbase||Status: MERGED||+2||0|
|231527,2||Fix QWindowsWindow::requestActivateWindow()||5.11||qt/qtbase||Status: MERGED||+2||0|