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. QOpenGLWidget turns black when mouse exits view area, on macOS.

QOpenGLWidget turns black when mouse exits view area, on macOS.

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 390 Views
  • 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.
  • T Offline
    T Offline
    tysonj
    wrote on last edited by
    #1

    On macOS, whenever the mouse exists the view area of the QOpenGLWidget, the view turns black. If I trigger a repaint, it is visible again, until the mouse exits.

    On Windows, the application behaves correctly.

    I have no idea what is going on. I am certainly not doing anything whenever the mouse enters or exits the view.

    I have tried 5.9.1 and 5.10.1

    Does anybody have any ideas?

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

      Hi and welcome to devnet,

      Can you provide a minimal compilable example that shows that behaviour ?

      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
      • T Offline
        T Offline
        tysonj
        wrote on last edited by
        #3

        I solved this. It was happening because I was calling

        QApplication::setAttribute(Qt::AA_NativeWindows);
        

        This was required on Windows for the QOpenglWidget to play nicely with QDockWidgets. The opposite is true on macOS.

        1 Reply Last reply
        1

        • Login

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