summaryrefslogtreecommitdiffstats
path: root/examples/opengl
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2023-05-16 10:44:34 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2023-06-01 09:09:49 +0200
commitda4de6b6e361879993f834ed4c157d5bdba2c050 (patch)
treecb45136d2de1607cbebc3f52779accbd31946a66 /examples/opengl
parent3c6c3eccd1f91bd1ae0a518318ef264f8eff63f5 (diff)
Polish forward decl in vulkan and opengl examples
Pick-to: 6.5 Change-Id: I9f05aedc7649ab7e248b7332c04a6664e85182d8 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'examples/opengl')
-rw-r--r--examples/opengl/hellogl2/window.h6
-rw-r--r--examples/opengl/hellogles3/glwindow.h12
-rw-r--r--examples/opengl/openglwindow/openglwindow.h8
3 files changed, 9 insertions, 17 deletions
diff --git a/examples/opengl/hellogl2/window.h b/examples/opengl/hellogl2/window.h
index f9e0607903..2099bc119a 100644
--- a/examples/opengl/hellogl2/window.h
+++ b/examples/opengl/hellogl2/window.h
@@ -6,10 +6,8 @@
#include <QWidget>
-QT_BEGIN_NAMESPACE
-class QSlider;
-class QPushButton;
-QT_END_NAMESPACE
+QT_FORWARD_DECLARE_CLASS(QSlider)
+QT_FORWARD_DECLARE_CLASS(QPushButton)
class GLWidget;
class MainWindow;
diff --git a/examples/opengl/hellogles3/glwindow.h b/examples/opengl/hellogles3/glwindow.h
index fc2a0e487e..54bc531af8 100644
--- a/examples/opengl/hellogles3/glwindow.h
+++ b/examples/opengl/hellogles3/glwindow.h
@@ -9,14 +9,10 @@
#include <QVector3D>
#include "../hellogl2/logo.h"
-QT_BEGIN_NAMESPACE
-
-class QOpenGLTexture;
-class QOpenGLShaderProgram;
-class QOpenGLBuffer;
-class QOpenGLVertexArrayObject;
-
-QT_END_NAMESPACE
+QT_FORWARD_DECLARE_CLASS(QOpenGLTexture)
+QT_FORWARD_DECLARE_CLASS(QOpenGLShaderProgram)
+QT_FORWARD_DECLARE_CLASS(QOpenGLBuffer)
+QT_FORWARD_DECLARE_CLASS(QOpenGLVertexArrayObject)
class GLWindow : public QOpenGLWindow
{
diff --git a/examples/opengl/openglwindow/openglwindow.h b/examples/opengl/openglwindow/openglwindow.h
index 579f9eede4..41bcbab9c4 100644
--- a/examples/opengl/openglwindow/openglwindow.h
+++ b/examples/opengl/openglwindow/openglwindow.h
@@ -7,11 +7,9 @@
#include <QWindow>
#include <QOpenGLFunctions>
-QT_BEGIN_NAMESPACE
-class QPainter;
-class QOpenGLContext;
-class QOpenGLPaintDevice;
-QT_END_NAMESPACE
+QT_FORWARD_DECLARE_CLASS(QPainter)
+QT_FORWARD_DECLARE_CLASS(QOpenGLContext)
+QT_FORWARD_DECLARE_CLASS(QOpenGLPaintDevice)
//! [1]
class OpenGLWindow : public QWindow, protected QOpenGLFunctions