QFrame overlay window moving with its parent
-
Hello,
I use a
QFramewith a combination ofToolTipandFramelessWindowHintwindow flags for displaying tutorial overlays like those:
On Linux (both X11 and Wayland) it then follows its parent QWidget as I move the window, but on macOS and Windows the overlay stays in its original position.
I tried a bunch of different combinations of window flags and double-checked that the parent is set correctly -- all to no avail. Will appreciate any ideas on how to make it work on Windows and macOS.
Thanks,
Constantine -
Hi, on Windows it has to do with the parent hWND set for the overlay window, it's probably set to empty for a "Desktiop top window".
The trick is to set it to a child window (so it follows the parent), to do that maybe you have to resort to some Win32 hackery. -
Hi,
One possible thing to check is the parent moveEvent and adjust the children position to it.
@SGaist This was my backup plan. I was intrigued by the fact it works on Linux, thought maybe I'm missing some basic configuration somewhere...
-
Hi, on Windows it has to do with the parent hWND set for the overlay window, it's probably set to empty for a "Desktiop top window".
The trick is to set it to a child window (so it follows the parent), to do that maybe you have to resort to some Win32 hackery. -
Hi, on Windows it has to do with the parent hWND set for the overlay window, it's probably set to empty for a "Desktiop top window".
The trick is to set it to a child window (so it follows the parent), to do that maybe you have to resort to some Win32 hackery.@hskoglund Thanks, that explains it. I googled a bit, and decided to take the
moveEvent()route -- not a big fan of hacky solutions. -
W Wintermute has marked this topic as solved on