From 58e2b9c01b31cef8a0fa263de3d984c22f1d7ca7 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Sat, 15 Sep 2012 13:46:14 +0200 Subject: 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 Reviewed-by: Thiago Macieira --- examples/widgets/painting/deform/pathdeform.h | 2 +- examples/widgets/painting/painterpaths/renderarea.h | 2 +- examples/widgets/painting/pathstroke/pathstroke.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/widgets/painting') diff --git a/examples/widgets/painting/deform/pathdeform.h b/examples/widgets/painting/deform/pathdeform.h index 6f0d647f4e..07f615d31e 100644 --- a/examples/widgets/painting/deform/pathdeform.h +++ b/examples/widgets/painting/deform/pathdeform.h @@ -58,7 +58,7 @@ class PathDeformRenderer : public ArthurFrame Q_PROPERTY(QString text READ text WRITE setText) public: - PathDeformRenderer(QWidget *widget, bool smallScreen = false); + explicit PathDeformRenderer(QWidget *widget, bool smallScreen = false); void paint(QPainter *painter); diff --git a/examples/widgets/painting/painterpaths/renderarea.h b/examples/widgets/painting/painterpaths/renderarea.h index 5c310fdf62..ec6c4ea291 100644 --- a/examples/widgets/painting/painterpaths/renderarea.h +++ b/examples/widgets/painting/painterpaths/renderarea.h @@ -50,7 +50,7 @@ class RenderArea : public QWidget Q_OBJECT public: - RenderArea(const QPainterPath &path, QWidget *parent = 0); + explicit RenderArea(const QPainterPath &path, QWidget *parent = 0); QSize minimumSizeHint() const; QSize sizeHint() const; diff --git a/examples/widgets/painting/pathstroke/pathstroke.h b/examples/widgets/painting/pathstroke/pathstroke.h index 743a757b0a..5e2a1ea579 100644 --- a/examples/widgets/painting/pathstroke/pathstroke.h +++ b/examples/widgets/painting/pathstroke/pathstroke.h @@ -53,7 +53,7 @@ class PathStrokeRenderer : public ArthurFrame public: enum PathMode { CurveMode, LineMode }; - PathStrokeRenderer(QWidget *parent, bool smallScreen = false); + explicit PathStrokeRenderer(QWidget *parent, bool smallScreen = false); void paint(QPainter *); void mousePressEvent(QMouseEvent *e); -- cgit v1.2.3