I’m trying to implement a system of windows in which there are two windows. When each of the respective windows is active, it can be displayed over the other window. However, only a single window should be shown in the task manager (when the user presses alt-tab only one window should be shown for my application).
I have tried to approach this from a few different angles:
I have tried having two parentless windows and giving one of them the Qt::Tool flag. This approach works until alt-tab is pressed. Once this happens, the tool window disappears, although it is still considered “visible” by the API (when the isVisible() method is called, it returns true even though the window is not visible).
I have also tried parenting one window (call it window B) to the other window (call it window A) and then switched the parenting by invoking the setParent() method whenever the current parent window becomes active. This allows the active window to be rendered over the inactive window. This approach causes both windows to momentarily close each time another window becomes active, causing the windows to “blink.”
Is there any simpler/better way to approach this problem?
↧