summaryrefslogtreecommitdiffstats
path: root/examples/widgets/graphicsview
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/widgets/graphicsview
parent89b12da2efff35915a38d608279cd3a5e7578c35 (diff)
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/widgets/graphicsview')
-rw-r--r--examples/widgets/graphicsview/boxes/glbuffers.h4
-rw-r--r--examples/widgets/graphicsview/boxes/roundedbox.h2
-rw-r--r--examples/widgets/graphicsview/chip/view.h2
-rw-r--r--examples/widgets/graphicsview/diagramscene/diagramscene.h2
-rw-r--r--examples/widgets/graphicsview/embeddeddialogs/customproxy.h2
-rw-r--r--examples/widgets/graphicsview/padnavigator/flippablepad.h2
6 files changed, 7 insertions, 7 deletions
diff --git a/examples/widgets/graphicsview/boxes/glbuffers.h b/examples/widgets/graphicsview/boxes/glbuffers.h
index 2b91915e8e..b3b1777f81 100644
--- a/examples/widgets/graphicsview/boxes/glbuffers.h
+++ b/examples/widgets/graphicsview/boxes/glbuffers.h
@@ -99,7 +99,7 @@ class GLTexture2D : public GLTexture
{
public:
GLTexture2D(int width, int height);
- GLTexture2D(const QString& fileName, int width = 0, int height = 0);
+ explicit GLTexture2D(const QString& fileName, int width = 0, int height = 0);
void load(int width, int height, QRgb *data);
virtual void bind();
virtual void unbind();
@@ -120,7 +120,7 @@ class GLTextureCube : public GLTexture
{
public:
GLTextureCube(int size);
- GLTextureCube(const QStringList& fileNames, int size = 0);
+ explicit GLTextureCube(const QStringList& fileNames, int size = 0);
void load(int size, int face, QRgb *data);
virtual void bind();
virtual void unbind();
diff --git a/examples/widgets/graphicsview/boxes/roundedbox.h b/examples/widgets/graphicsview/boxes/roundedbox.h
index 3edfb69fa8..0ab6766af3 100644
--- a/examples/widgets/graphicsview/boxes/roundedbox.h
+++ b/examples/widgets/graphicsview/boxes/roundedbox.h
@@ -65,7 +65,7 @@ class GLRoundedBox : public GLTriangleMesh<P3T2N3Vertex, unsigned short>
{
public:
// 0 < r < 0.5, 0 <= n <= 125
- GLRoundedBox(float r = 0.25f, float scale = 1.0f, int n = 10);
+ explicit GLRoundedBox(float r = 0.25f, float scale = 1.0f, int n = 10);
};
diff --git a/examples/widgets/graphicsview/chip/view.h b/examples/widgets/graphicsview/chip/view.h
index 7753efff55..c688506d42 100644
--- a/examples/widgets/graphicsview/chip/view.h
+++ b/examples/widgets/graphicsview/chip/view.h
@@ -68,7 +68,7 @@ class View : public QFrame
{
Q_OBJECT
public:
- View(const QString &name, QWidget *parent = 0);
+ explicit View(const QString &name, QWidget *parent = 0);
QGraphicsView *view() const;
diff --git a/examples/widgets/graphicsview/diagramscene/diagramscene.h b/examples/widgets/graphicsview/diagramscene/diagramscene.h
index 9f65eba890..53a34b050d 100644
--- a/examples/widgets/graphicsview/diagramscene/diagramscene.h
+++ b/examples/widgets/graphicsview/diagramscene/diagramscene.h
@@ -63,7 +63,7 @@ class DiagramScene : public QGraphicsScene
public:
enum Mode { InsertItem, InsertLine, InsertText, MoveItem };
- DiagramScene(QMenu *itemMenu, QObject *parent = 0);
+ explicit DiagramScene(QMenu *itemMenu, QObject *parent = 0);
QFont font() const
{ return myFont; }
QColor textColor() const
diff --git a/examples/widgets/graphicsview/embeddeddialogs/customproxy.h b/examples/widgets/graphicsview/embeddeddialogs/customproxy.h
index c85bbaccd3..12de414d11 100644
--- a/examples/widgets/graphicsview/embeddeddialogs/customproxy.h
+++ b/examples/widgets/graphicsview/embeddeddialogs/customproxy.h
@@ -49,7 +49,7 @@ class CustomProxy : public QGraphicsProxyWidget
{
Q_OBJECT
public:
- CustomProxy(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
+ explicit CustomProxy(QGraphicsItem *parent = 0, Qt::WindowFlags wFlags = 0);
QRectF boundingRect() const;
void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option,
diff --git a/examples/widgets/graphicsview/padnavigator/flippablepad.h b/examples/widgets/graphicsview/padnavigator/flippablepad.h
index e0d1fe24e5..ce49ef1a59 100644
--- a/examples/widgets/graphicsview/padnavigator/flippablepad.h
+++ b/examples/widgets/graphicsview/padnavigator/flippablepad.h
@@ -51,7 +51,7 @@
class FlippablePad : public RoundRectItem
{
public:
- FlippablePad(const QSize &size, QGraphicsItem *parent = 0);
+ explicit FlippablePad(const QSize &size, QGraphicsItem *parent = 0);
RoundRectItem *iconAt(int column, int row) const;