summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2009-11-20 11:24:06 (GMT)
committerTrond Kjernåsen <trond@trolltech.com>2009-11-20 11:58:27 (GMT)
commit5cf6f6276a3a9103876937c300c1adce157eebeb (patch)
tree69c73bce09d0fc83f4050b5528844198a2802e58 /src
parentf8fb064d6b2ad55c66ce1a481e7f829278051fcb (diff)
downloadQt-5cf6f6276a3a9103876937c300c1adce157eebeb.zip
Qt-5cf6f6276a3a9103876937c300c1adce157eebeb.tar.gz
Qt-5cf6f6276a3a9103876937c300c1adce157eebeb.tar.bz2
Fixed antialiasing in the GL based QGraphicsView demos under X11.
All the examples/demos that used a QGraphicsView with a QGLWidget as a viewport, that had multisampling enabled, was broken after 7b61fbf03e170a7da37d5f57ed4053aae719ec7f. This is because the reparented QGLWidget will be forced to use the parent widget's visual, which in this case does not contain any multisample buffers. The QX11Info structure for QGLWidget is put together based on the QGLFormat that is passed into the QGLWidget constructor and will in most cases always be different from the parent widget visual. Task-number: QTBUG-5998 and QTBUG-6003 Reviewed-by: Eskil
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qwidget_x11.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget_x11.cpp b/src/gui/kernel/qwidget_x11.cpp
index 7461637..0bc9cbc 100644
--- a/src/gui/kernel/qwidget_x11.cpp
+++ b/src/gui/kernel/qwidget_x11.cpp
@@ -527,8 +527,13 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
QX11InfoData *xd = &X11->screens[qt_x11_create_desktop_on_screen];
xinfo.setX11Data(xd);
} else if (parentXinfo && (parentXinfo->screen() != xinfo.screen()
- || parentXinfo->visual() != xinfo.visual()))
+ || (parentXinfo->visual() != xinfo.visual()
+ && !q->inherits("QGLWidget"))))
{
+ // QGLWidgets have to be excluded here as they have a
+ // specially crafted QX11Info structure which can't be swapped
+ // out with the parent widgets QX11Info. The parent visual,
+ // for instance, might not even be GL capable.
xinfo = *parentXinfo;
}