Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

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



  • 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?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

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



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


Log in to reply