Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QFrame overlay window moving with its parent

QFrame overlay window moving with its parent

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 3 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Wintermute
    wrote on last edited by
    #1

    Hello,

    I use a QFrame with a combination of ToolTip and FramelessWindowHint window flags for displaying tutorial overlays like those:

    13ea0cd1-7597-41c6-9663-97218f6516e5-image.png

    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

    1 Reply Last reply
    0
    • hskoglundH Offline
      hskoglundH Offline
      hskoglund
      wrote on last edited by
      #4

      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.

      W 1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        Hi,

        One possible thing to check is the parent moveEvent and adjust the children position to it.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        W 1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          One possible thing to check is the parent moveEvent and adjust the children position to it.

          W Offline
          W Offline
          Wintermute
          wrote on last edited by
          #3

          @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...

          1 Reply Last reply
          0
          • hskoglundH Offline
            hskoglundH Offline
            hskoglund
            wrote on last edited by
            #4

            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.

            W 1 Reply Last reply
            1
            • hskoglundH hskoglund

              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.

              W Offline
              W Offline
              Wintermute
              wrote on last edited by
              #5

              @hskoglund Thanks, that explains it. I googled a bit, and decided to take the moveEvent() route -- not a big fan of hacky solutions.

              1 Reply Last reply
              0
              • W Wintermute has marked this topic as solved on

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved