Modal dialog over OpenGL widget: openGL surface doesn't get redrawn and a mess is left behind

  • Hello,

    I have a QGLWidget, and on top of it sometimes modal dialogs. In rare cases (depending on the Platform/settings), moving the modal dialog doesn't redraw the openGL window's content, and leaves a mess behind, in the openGL view. What can I do?
    As stated, this happens in rare cases. On Windows, Mac and Linux in works fine in 90% of tested machines.

    The paintEvent and paintGL functions are overridden, and empty (I am rendering on a regular time base). But they anyway don't get called when the modal dialog moves over it.

    Thanks for any insight!

  • Lifetime Qt Champion


    Are you using exec to show your dialog ? If so, you could try with open

  • Thank you for your reply.
    Yes, I am using exec to show the dialog, but open gives the same result.
    What else could I try? The problem is that those artifacts are not expected for a professional application, but I am at a loss in trying to find the reason and to fix it.
    Thanks again

  • Moderators

    Hi @floatingWoods,

    There are many known issues with QGLWidget. It is now deprecated, replaced with QOpenGLWidget. Try that instead, and see if it helps.

  • Thank you for your reply.
    Yes, that is probably the best to do. It will however require to switch to Qt5.4, and that is a larger endeavour. Will try that.

    Thanks again!