Important: Please read the Qt Code of Conduct -

Flickering when setting 'setContentsMargins(0,0,0,0);'

  • Hi,
    I'm trying to make a OpenGL application with Qt in which you can select an object in the scene and get more info on it in a pop-up window with a double-click.

          If I create the QGLWidget directly, I got flickering when I double-click to have the pop-up window. If I have an intermediate QWidget with a layout and put the QGLWidget in it, the flickering disappears. Problem is, I now have an annoying border. If I put 'setContentsMargins(0,0,0,0);' the flickering comes back (like if there is no intermediate with layout). The best I can do is to put 'setContentsMargins(1,0,0,0);'  because in that case I get only a thin (but still annoying) left white border of 1 pixel. I don't understand why I get flickering as soon I put all borders to 0. Is this is normal (or is it a Qt bug)? Is there any workaround? Thanks.

Log in to reply