diff options
author | Sergio Ahumada <sergio.ahumada@nokia.com> | 2012-09-15 13:46:14 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-17 22:14:25 +0200 |
commit | 58e2b9c01b31cef8a0fa263de3d984c22f1d7ca7 (patch) | |
tree | 4d554a177cd60fee123f88744fad7d5953429618 /examples/widgets/widgets | |
parent | 89b12da2efff35915a38d608279cd3a5e7578c35 (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/widgets')
-rw-r--r-- | examples/widgets/widgets/calculator/button.h | 2 | ||||
-rw-r--r-- | examples/widgets/widgets/elidedlabel/elidedlabel.h | 2 | ||||
-rw-r--r-- | examples/widgets/widgets/wiggly/dialog.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/examples/widgets/widgets/calculator/button.h b/examples/widgets/widgets/calculator/button.h index 50874ea574..d84d7e92e8 100644 --- a/examples/widgets/widgets/calculator/button.h +++ b/examples/widgets/widgets/calculator/button.h @@ -49,7 +49,7 @@ class Button : public QToolButton Q_OBJECT public: - Button(const QString &text, QWidget *parent = 0); + explicit Button(const QString &text, QWidget *parent = 0); QSize sizeHint() const; }; diff --git a/examples/widgets/widgets/elidedlabel/elidedlabel.h b/examples/widgets/widgets/elidedlabel/elidedlabel.h index 2c19589bc2..118c8c2741 100644 --- a/examples/widgets/widgets/elidedlabel/elidedlabel.h +++ b/examples/widgets/widgets/elidedlabel/elidedlabel.h @@ -55,7 +55,7 @@ class ElidedLabel : public QFrame Q_PROPERTY(bool isElided READ isElided) public: - ElidedLabel(const QString &text, QWidget *parent = 0); + explicit ElidedLabel(const QString &text, QWidget *parent = 0); void setText(const QString &text); const QString & text() const { return content; } diff --git a/examples/widgets/widgets/wiggly/dialog.h b/examples/widgets/widgets/wiggly/dialog.h index 84167d9153..e6117f8ee2 100644 --- a/examples/widgets/widgets/wiggly/dialog.h +++ b/examples/widgets/widgets/wiggly/dialog.h @@ -49,7 +49,7 @@ class Dialog : public QDialog Q_OBJECT public: - Dialog(QWidget *parent = 0, bool smallScreen = false); + explicit Dialog(QWidget *parent = 0, bool smallScreen = false); }; //! [0] |