Skip to content
  • Laszlo Agocs's avatar
    Fix QOpenGLWidget on Cocoa when used as viewport · ebc835c2
    Laszlo Agocs authored
    
    
    Having a QOpenGLWidget as a graphics view viewport was not functioning
    on OS X: it was showing incomplete content due to accessing the texture
    attached to the framebuffer object before the rendering is complete.
    
    On the normal path, when rendering is done via paintGL(), the flush was
    there. When used as a viewport however, this path is not used. The missing
    flush is now added for the other case too. For performance reasons, we will
    not flush on every paint engine end(). Instead, the flush is deferred until
    composition starts.
    
    QGLWidget also featured a weird on-by-default autoFillBackground concept. To
    maintain compatibility with apps that used QGLWidget as the viewport for
    QGraphicsView, we will now do the same for QOpenGLWidget, but only when it
    is used as a viewport. For regular QOpenGLWidgets autoFillBackground defaults
    to false, like for any other widget. The docs are extended with a small section
    about differences between QGLWidget and QOpenGLWidget.
    
    Task-number: QTBUG-41046
    Change-Id: I42c2033fdd2ef5815783fd640fe11373761061e0
    Reviewed-by: default avatarJørgen Lind <jorgen.lind@digia.com>
    ebc835c2