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. How to draw a widget on top of all other widgets on Mac (where Qt::WA_PaintOnScreen doesn't work)?
Qt 6.11 is out! See what's new in the release blog

How to draw a widget on top of all other widgets on Mac (where Qt::WA_PaintOnScreen doesn't work)?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 1.8k Views 3 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.
  • V Offline
    V Offline
    Violet Giraffe
    wrote on last edited by Violet Giraffe
    #1

    I use Qt 5.5 and I've noticed that my floating widget, which is supposed to be drawn on top of everything else, no longer works properly. I call raise() on it, but it still obscured by some widgets on the screen (while it is being painted over others as expected). More specifically, I'm having difficulties painting over a QGlWidget. Works fine on Windows, but not on Mac.

    I also used to use the Qt::WA_PaintOnScreen attribute, but that doesn't work on Mac any more. What are my options?

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

      Hi,

      Do you have an example that reproduces this ?

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

      V 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi,

        Do you have an example that reproduces this ?

        V Offline
        V Offline
        Violet Giraffe
        wrote on last edited by
        #3

        @SGaist, I do now! Here it is.

        By moving the splitter left or right you can observe that my widget is painted over QTextEdit no problem, but cannot be painted over QGLWidget. I'll be very happy if you can figure out how to paint my widget on top of EVERYTHING!

        ValentinMicheletV 1 Reply Last reply
        0
        • V Violet Giraffe

          @SGaist, I do now! Here it is.

          By moving the splitter left or right you can observe that my widget is painted over QTextEdit no problem, but cannot be painted over QGLWidget. I'll be very happy if you can figure out how to paint my widget on top of EVERYTHING!

          ValentinMicheletV Offline
          ValentinMicheletV Offline
          ValentinMichelet
          wrote on last edited by ValentinMichelet
          #4

          @Violet-Giraffe
          For what it's worth, it's working on Ubuntu 14.04, with Unity, using Qt 5.3.0.

          V 1 Reply Last reply
          1
          • ValentinMicheletV ValentinMichelet

            @Violet-Giraffe
            For what it's worth, it's working on Ubuntu 14.04, with Unity, using Qt 5.3.0.

            V Offline
            V Offline
            Violet Giraffe
            wrote on last edited by
            #5

            @ValentinMichelet, the project where I need this to work doesn't run on Linux so I wouldn't know, but it works on Windows and does not work on OS X with Qt 5.5.1.

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

              Might be related to the OpenGL handling on OS X since it works fine when you have two QWidgets.

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

              1 Reply Last reply
              0

              • Login

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