summaryrefslogtreecommitdiff
path: root/examples/opengl
diff options
context:
space:
mode:
authorSergio Ahumada <sergio.ahumada@nokia.com>2012-09-15 13:46:14 +0200
committerQt by Nokia <qt-info@nokia.com>2012-09-17 22:14:25 +0200
commit58e2b9c01b31cef8a0fa263de3d984c22f1d7ca7 (patch)
tree4d554a177cd60fee123f88744fad7d5953429618 /examples/opengl
parent89b12da2efff35915a38d608279cd3a5e7578c35 (diff)
downloadqtbase-58e2b9c01b31cef8a0fa263de3d984c22f1d7ca7.tar.gz
examples: Mark ctor's as explicit
Make C++ class constructors that can be used with only one required argument 'explicit' to minimize wrong use of the class. Change-Id: Ida9f9c2f0c8608c35b0137b2512a6747afd69515 Reviewed-by: Mitch Curtis <mitch.curtis@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'examples/opengl')
-rw-r--r--examples/opengl/hellowindow/hellowindow.h2
-rw-r--r--examples/opengl/pbuffers/cube.h4
-rw-r--r--examples/opengl/shared/qtlogo.h2
-rw-r--r--examples/opengl/textures/glwidget.h2
4 files changed, 5 insertions, 5 deletions
diff --git a/examples/opengl/hellowindow/hellowindow.h b/examples/opengl/hellowindow/hellowindow.h
index 0a88a0d75e..ea59b3f127 100644
--- a/examples/opengl/hellowindow/hellowindow.h
+++ b/examples/opengl/hellowindow/hellowindow.h
@@ -55,7 +55,7 @@ class Renderer : public QObject
{
Q_OBJECT
public:
- Renderer(const QSurfaceFormat &format, Renderer *share = 0, QScreen *screen = 0);
+ explicit Renderer(const QSurfaceFormat &format, Renderer *share = 0, QScreen *screen = 0);
QSurfaceFormat format() const { return m_format; }
diff --git a/examples/opengl/pbuffers/cube.h b/examples/opengl/pbuffers/cube.h
index ad56e43e49..81e82637cb 100644
--- a/examples/opengl/pbuffers/cube.h
+++ b/examples/opengl/pbuffers/cube.h
@@ -95,7 +95,7 @@ class TileBuilder
{
public:
enum { bl, br, tr, tl };
- TileBuilder(Geometry *, qreal depth = 0.0f, qreal size = 1.0f);
+ explicit TileBuilder(Geometry *, qreal depth = 0.0f, qreal size = 1.0f);
Tile *newTile(const QVector3D &loc = QVector3D()) const;
void setColor(QColor c) { color = c; }
protected:
@@ -140,7 +140,7 @@ private:
class CubeBuilder : public TileBuilder
{
public:
- CubeBuilder(Geometry *, qreal depth = 0.0f, qreal size = 1.0f);
+ explicit CubeBuilder(Geometry *, qreal depth = 0.0f, qreal size = 1.0f);
Cube *newCube(const QVector3D &loc = QVector3D()) const;
private:
mutable int ix;
diff --git a/examples/opengl/shared/qtlogo.h b/examples/opengl/shared/qtlogo.h
index d55fb0834c..3f608180c2 100644
--- a/examples/opengl/shared/qtlogo.h
+++ b/examples/opengl/shared/qtlogo.h
@@ -51,7 +51,7 @@ struct Geometry;
class QtLogo : public QObject
{
public:
- QtLogo(QObject *parent, int d = 64, qreal s = 1.0);
+ explicit QtLogo(QObject *parent, int d = 64, qreal s = 1.0);
~QtLogo();
void setColor(QColor c);
void draw() const;
diff --git a/examples/opengl/textures/glwidget.h b/examples/opengl/textures/glwidget.h
index be120e02d0..9dccd339fe 100644
--- a/examples/opengl/textures/glwidget.h
+++ b/examples/opengl/textures/glwidget.h
@@ -51,7 +51,7 @@ class GLWidget : public QGLWidget
Q_OBJECT
public:
- GLWidget(QWidget *parent = 0, QGLWidget *shareWidget = 0);
+ explicit GLWidget(QWidget *parent = 0, QGLWidget *shareWidget = 0);
~GLWidget();
QSize minimumSizeHint() const;