summaryrefslogtreecommitdiffstats
path: root/examples/opengl/overpainting
diff options
context:
space:
mode:
authorhjk <qthjk@ovi.com>2012-12-19 11:27:10 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-28 20:44:55 +0100
commit0136252cb2973824b7f97abad1d4c3a4d9301178 (patch)
tree2e03b3946253216d6ce3a010d4155c36f3e834b7 /examples/opengl/overpainting
parent4eac2c4728da85a5cdf91ec25170b3417f7deb68 (diff)
Polish code of some opengl examples
Change-Id: If24ae1845176fc525cf6a239a5079f4802f8df3f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'examples/opengl/overpainting')
-rw-r--r--examples/opengl/overpainting/bubble.cpp2
-rw-r--r--examples/opengl/overpainting/bubble.h12
-rw-r--r--examples/opengl/overpainting/glwidget.cpp12
-rw-r--r--examples/opengl/overpainting/glwidget.h10
-rw-r--r--examples/opengl/overpainting/main.cpp3
-rw-r--r--examples/opengl/overpainting/overpainting.pro4
6 files changed, 14 insertions, 29 deletions
diff --git a/examples/opengl/overpainting/bubble.cpp b/examples/opengl/overpainting/bubble.cpp
index 5f0e9710ea..0b3e3b8778 100644
--- a/examples/opengl/overpainting/bubble.cpp
+++ b/examples/opengl/overpainting/bubble.cpp
@@ -38,8 +38,6 @@
**
****************************************************************************/
-#include <QtWidgets>
-
#include "bubble.h"
Bubble::Bubble(const QPointF &position, qreal radius, const QPointF &velocity)
diff --git a/examples/opengl/overpainting/bubble.h b/examples/opengl/overpainting/bubble.h
index 2a3d27480b..42dedc6e8f 100644
--- a/examples/opengl/overpainting/bubble.h
+++ b/examples/opengl/overpainting/bubble.h
@@ -41,15 +41,7 @@
#ifndef BUBBLE_H
#define BUBBLE_H
-#include <QBrush>
-#include <QColor>
-#include <QPointF>
-#include <QRect>
-#include <QRectF>
-
-QT_BEGIN_NAMESPACE
-class QPainter;
-QT_END_NAMESPACE
+#include <QPainter>
class Bubble
{
@@ -72,4 +64,4 @@ private:
QColor outerColor;
};
-#endif
+#endif // BUBBLE_H
diff --git a/examples/opengl/overpainting/glwidget.cpp b/examples/opengl/overpainting/glwidget.cpp
index df546a125b..ea29325b6c 100644
--- a/examples/opengl/overpainting/glwidget.cpp
+++ b/examples/opengl/overpainting/glwidget.cpp
@@ -38,16 +38,16 @@
**
****************************************************************************/
-#include <QtWidgets>
-#include <QtOpenGL>
-#include <stdlib.h>
-
-#include <math.h>
-
#include "bubble.h"
#include "qtlogo.h"
#include "glwidget.h"
+#include <QMouseEvent>
+#include <QTime>
+
+#include <math.h>
+#include <stdlib.h>
+
#ifndef GL_MULTISAMPLE
#define GL_MULTISAMPLE 0x809D
#endif
diff --git a/examples/opengl/overpainting/glwidget.h b/examples/opengl/overpainting/glwidget.h
index ce2b29d7f3..497d5e1ac4 100644
--- a/examples/opengl/overpainting/glwidget.h
+++ b/examples/opengl/overpainting/glwidget.h
@@ -41,19 +41,11 @@
#ifndef GLWIDGET_H
#define GLWIDGET_H
-#include <QBrush>
-#include <QFont>
-#include <QImage>
-#include <QPen>
#include <QGLWidget>
#include <QTimer>
class Bubble;
class QtLogo;
-QT_BEGIN_NAMESPACE
-class QPaintEvent;
-class QWidget;
-QT_END_NAMESPACE
//! [0]
class GLWidget : public QGLWidget
@@ -108,4 +100,4 @@ private:
//! [4]
};
-#endif
+#endif // GLWIDGET_H
diff --git a/examples/opengl/overpainting/main.cpp b/examples/opengl/overpainting/main.cpp
index c4758956ba..2d40a7f76b 100644
--- a/examples/opengl/overpainting/main.cpp
+++ b/examples/opengl/overpainting/main.cpp
@@ -38,9 +38,10 @@
**
****************************************************************************/
-#include <QApplication>
#include "glwidget.h"
+#include <QApplication>
+
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
diff --git a/examples/opengl/overpainting/overpainting.pro b/examples/opengl/overpainting/overpainting.pro
index 141c8cb7ce..aecc14751b 100644
--- a/examples/opengl/overpainting/overpainting.pro
+++ b/examples/opengl/overpainting/overpainting.pro
@@ -1,10 +1,12 @@
+QT += opengl widgets
+
VPATH += ../shared
INCLUDEPATH += ../shared
-QT += opengl widgets
HEADERS = bubble.h \
glwidget.h \
qtlogo.h
+
SOURCES = bubble.cpp \
glwidget.cpp \
main.cpp \