diff options
author | Trond Kjernåsen <trond@trolltech.com> | 2009-09-02 10:06:03 (GMT) |
---|---|---|
committer | Trond Kjernåsen <trond@trolltech.com> | 2009-09-02 13:52:47 (GMT) |
commit | 7f455eed3f38153db169697ca08250a396e3207c (patch) | |
tree | 7a48a54dbe579c0720884ef660f5e6edaabecb77 /src/opengl | |
parent | c3cb191e2565f21090aa64df92946ac4fa9ab2d0 (diff) | |
download | Qt-7f455eed3f38153db169697ca08250a396e3207c.zip Qt-7f455eed3f38153db169697ca08250a396e3207c.tar.gz Qt-7f455eed3f38153db169697ca08250a396e3207c.tar.bz2 |
Fixed a system clip issue in the GL 2 engine.
QGraphicsView can set the system clip in order to handle clipping
of QGraphicsView children, and we have to take that into account
in the GL 2 engine, as we did in the GL 1 engine.
Reviewed-by: Samuel
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 7271740..ad22366 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1662,10 +1662,16 @@ void QGL2PaintEngineExPrivate::systemStateChanged() { Q_Q(QGL2PaintEngineEx); - if (q->paintDevice()->devType() == QInternal::Widget) + if (systemClip.isEmpty()) { use_system_clip = false; - else - use_system_clip = !systemClip.isEmpty(); + } else { + if (q->paintDevice()->devType() == QInternal::Widget && currentClipWidget) { + QWidgetPrivate *widgetPrivate = qt_widget_private(currentClipWidget->window()); + use_system_clip = widgetPrivate->extra && widgetPrivate->extra->inRenderWithPainter; + } else { + use_system_clip = true; + } + } glDisable(GL_DEPTH_TEST); q->state()->depthTestEnabled = false; |