diff options
Diffstat (limited to 'src/widgets/doc')
-rw-r--r-- | src/widgets/doc/snippets/graphicsview.cpp | 6 | ||||
-rw-r--r-- | src/widgets/doc/src/graphicsview.qdoc | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/widgets/doc/snippets/graphicsview.cpp b/src/widgets/doc/snippets/graphicsview.cpp index 371cff24a4..9578f91eec 100644 --- a/src/widgets/doc/snippets/graphicsview.cpp +++ b/src/widgets/doc/snippets/graphicsview.cpp @@ -123,5 +123,9 @@ void CustomItem::mousePressEvent(QGraphicsSceneMouseEvent *event) //! [6] QGraphicsView view(&scene); -view.setViewport(new QGLWidget(QGLFormat(QGL::SampleBuffers))); +QOpenGLWidget *gl = new QOpenGLWidget(); +QSurfaceFormat format; +format.setSamples(4); +gl->setFormat(format); +view.setViewport(gl); //! [6] diff --git a/src/widgets/doc/src/graphicsview.qdoc b/src/widgets/doc/src/graphicsview.qdoc index f1f848d6df..0489203e40 100644 --- a/src/widgets/doc/src/graphicsview.qdoc +++ b/src/widgets/doc/src/graphicsview.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. @@ -438,8 +438,8 @@ To enable OpenGL rendering, you simply set a new QOpenGLWidget as the viewport of QGraphicsView by calling QGraphicsView::setViewport(). If - you want OpenGL with antialiasing, you need OpenGL sample buffer - support (see QSurfaceFormat::samples()). + you want OpenGL with antialiasing, you need to set a QSurfaceFormat + with the needed sample count (see QSurfaceFormat::setSamples()). Example: |