summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2020-03-18 19:56:40 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2020-03-20 22:27:29 +0100
commitbd75c87e0e76b328827a2aad1077f89e50e36d9d (patch)
tree6581e30e0531b9a95744956fe9f46bb3a64966f1 /src
parent580e9eedf783ccbdcb67baa3d1a9dcdd53922f86 (diff)
Doc: replace deprecated references to QGLWidget
Remove references to the deprecated QGLWidget and replace it with QOpenGLWidget. Change-Id: Ia31df42ab61c25e9ce46f4491267d2c64910f55c Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/gui/painting/qpaintengine.cpp2
-rw-r--r--src/widgets/doc/snippets/graphicsview.cpp6
-rw-r--r--src/widgets/doc/src/graphicsview.qdoc8
-rw-r--r--src/widgets/graphicsview/qgraphicsproxywidget.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.cpp2
-rw-r--r--src/widgets/graphicsview/qgraphicsview.cpp8
6 files changed, 16 insertions, 12 deletions
diff --git a/src/gui/painting/qpaintengine.cpp b/src/gui/painting/qpaintengine.cpp
index 315bf0daf2..6b34911c15 100644
--- a/src/gui/painting/qpaintengine.cpp
+++ b/src/gui/painting/qpaintengine.cpp
@@ -158,7 +158,7 @@ QFont QTextItem::font() const
X11 and \macos, it is the backend for painting on QImage and it is
used as a fallback for paint engines that do not support a certain
capability. In addition we provide QPaintEngine implementations for
- OpenGL (accessible through QGLWidget) and printing (which allows using
+ OpenGL (accessible through QOpenGLWidget) and printing (which allows using
QPainter to draw on a QPrinter object).
If one wants to use QPainter to draw to a different backend,
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 33f480b0bf..94c824c2ed 100644
--- a/src/widgets/doc/src/graphicsview.qdoc
+++ b/src/widgets/doc/src/graphicsview.qdoc
@@ -117,7 +117,7 @@
of a scene. You can attach several views to the same scene, to provide
several viewports into the same data set. The view widget is a scroll
area, and provides scroll bars for navigating through large scenes. To
- enable OpenGL support, you can set a QGLWidget as the viewport by
+ enable OpenGL support, you can set a QOpenGLWidget as the viewport by
calling QGraphicsView::setViewport().
\snippet graphicsview.cpp 1
@@ -436,10 +436,10 @@
\section2 OpenGL Rendering
- To enable OpenGL rendering, you simply set a new QGLWidget as the
+ 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 QGLFormat::sampleBuffers()).
+ you want OpenGL with antialiasing, you need to set a QSurfaceFormat
+ with the needed sample count (see QSurfaceFormat::setSamples()).
Example:
diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp
index fe3475e6bb..45720802d3 100644
--- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp
+++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp
@@ -581,7 +581,7 @@ QGraphicsProxyWidget::~QGraphicsProxyWidget()
Note that widgets with the Qt::WA_PaintOnScreen widget attribute
set and widgets that wrap an external application or controller
- cannot be embedded. Examples are QGLWidget and QAxWidget.
+ cannot be embedded. Examples are QOpenGLWidget and QAxWidget.
\sa widget()
*/
diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp
index b669b0fe61..38c68b8fa5 100644
--- a/src/widgets/graphicsview/qgraphicsscene.cpp
+++ b/src/widgets/graphicsview/qgraphicsscene.cpp
@@ -2904,7 +2904,7 @@ QGraphicsSimpleTextItem *QGraphicsScene::addSimpleText(const QString &text, cons
Note that widgets with the Qt::WA_PaintOnScreen widget attribute
set and widgets that wrap an external application or controller
- are not supported. Examples are QGLWidget and QAxWidget.
+ are not supported. Examples are QOpenGLWidget and QAxWidget.
\sa addEllipse(), addLine(), addPixmap(), addPixmap(), addRect(),
addText(), addSimpleText(), addItem()
diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp
index 17c13e47d6..90bddf6e84 100644
--- a/src/widgets/graphicsview/qgraphicsview.cpp
+++ b/src/widgets/graphicsview/qgraphicsview.cpp
@@ -89,8 +89,8 @@ static const int QGRAPHICSVIEW_PREALLOC_STYLE_OPTIONS = 503; // largest prime <
By default, QGraphicsView provides a regular QWidget for the viewport
widget. You can access this widget by calling viewport(), or you can
replace it by calling setViewport(). To render using OpenGL, simply call
- setViewport(new QGLWidget). QGraphicsView takes ownership of the viewport
- widget.
+ setViewport(new QOpenGLWidget). QGraphicsView takes ownership of the
+ viewport widget.
QGraphicsView supports affine transformations, using QTransform. You can
either pass a matrix to setTransform(), or you can call one of the
@@ -159,8 +159,8 @@ static const int QGRAPHICSVIEW_PREALLOC_STYLE_OPTIONS = 503; // largest prime <
fastest when QGraphicsView spends more time figuring out what to draw than
it would spend drawing (e.g., when very many small items are repeatedly
updated). This is the preferred update mode for viewports that do not
- support partial updates, such as QGLWidget, and for viewports that need to
- disable scroll optimization.
+ support partial updates, such as QOpenGLWidget, and for viewports that
+ need to disable scroll optimization.
\value MinimalViewportUpdate QGraphicsView will determine the minimal
viewport region that requires a redraw, minimizing the time spent drawing