An active window is a window that currently accepts keyboard focus, and therefore is also a window to which keyboard events are sent.
During the resize / move operation, the active window does not register keyboard events (regardless of whether they are sent or not). Given this, it can be argued that the window should still be considered active during such operations.
Qt4 and Qt5 differ in how they deal with this. Qt4 does not report window activation changes (or focus changes) during resizing / moving on any platform (although I actually tested only on X11 and Windows). The same is true for Qt5 - except when it comes to X11.
In X11, Qt5 reports a change in window activation (and focus change) at the beginning and end of all resize / move operations. That is, isActiveWindow() returns False when the operation starts and True when it ends (and the corresponding FocusIn/FocusOut events are also FocusIn/FocusOut , as well as WindowActivate/WindowDeactivate , etc.).
It can be argued that the behavior of Qt5 on X11 is the only one that is accurate. However, it is incompatible with other platforms supported by Qt5, and therefore, from the point of view of the developer, it should be considered erroneous (or at least inconvenient).
Although the behavior on Qt4 is perhaps less acccurate, it is at least consistent across all supported platforms (that is, exactly what the developer expects from cross-platform toolkit).
Unfortunately, resize / move events only start after a window's activation changes, so there seems to be no obvious way to filter out unwanted activation events in Qt5.
source share