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/animation | |
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/animation')
-rw-r--r-- | examples/widgets/animation/stickman/node.h | 2 | ||||
-rw-r--r-- | examples/widgets/animation/sub-attaq/boat_p.h | 10 | ||||
-rw-r--r-- | examples/widgets/animation/sub-attaq/states.h | 4 | ||||
-rw-r--r-- | examples/widgets/animation/sub-attaq/submarine_p.h | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/examples/widgets/animation/stickman/node.h b/examples/widgets/animation/stickman/node.h index ae6e2a3ed0..ca04d7813b 100644 --- a/examples/widgets/animation/stickman/node.h +++ b/examples/widgets/animation/stickman/node.h @@ -47,7 +47,7 @@ class Node: public QGraphicsObject { Q_OBJECT public: - Node(const QPointF &pos, QGraphicsItem *parent = 0); + explicit Node(const QPointF &pos, QGraphicsItem *parent = 0); ~Node(); QRectF boundingRect() const; diff --git a/examples/widgets/animation/sub-attaq/boat_p.h b/examples/widgets/animation/sub-attaq/boat_p.h index 38be985777..03f7df2835 100644 --- a/examples/widgets/animation/sub-attaq/boat_p.h +++ b/examples/widgets/animation/sub-attaq/boat_p.h @@ -139,7 +139,7 @@ private: class MoveStateRight : public QState { public: - MoveStateRight(Boat *boat,QState *parent = 0) : QState(parent), boat(boat) + explicit MoveStateRight(Boat *boat,QState *parent = 0) : QState(parent), boat(boat) { } protected: @@ -156,7 +156,7 @@ private: class MoveStateLeft : public QState { public: - MoveStateLeft(Boat *boat,QState *parent = 0) : QState(parent), boat(boat) + explicit MoveStateLeft(Boat *boat,QState *parent = 0) : QState(parent), boat(boat) { } protected: @@ -173,7 +173,7 @@ private: class StopState : public QState { public: - StopState(Boat *boat,QState *parent = 0) : QState(parent), boat(boat) + explicit StopState(Boat *boat,QState *parent = 0) : QState(parent), boat(boat) { } protected: @@ -191,7 +191,7 @@ private: class LaunchStateRight : public QState { public: - LaunchStateRight(Boat *boat,QState *parent = 0) : QState(parent), boat(boat) + explicit LaunchStateRight(Boat *boat,QState *parent = 0) : QState(parent), boat(boat) { } protected: @@ -212,7 +212,7 @@ private: class LaunchStateLeft : public QState { public: - LaunchStateLeft(Boat *boat,QState *parent = 0) : QState(parent), boat(boat) + explicit LaunchStateLeft(Boat *boat,QState *parent = 0) : QState(parent), boat(boat) { } protected: diff --git a/examples/widgets/animation/sub-attaq/states.h b/examples/widgets/animation/sub-attaq/states.h index e43370302c..98799ddd94 100644 --- a/examples/widgets/animation/sub-attaq/states.h +++ b/examples/widgets/animation/sub-attaq/states.h @@ -59,7 +59,7 @@ QT_END_NAMESPACE class PlayState : public QState { public: - PlayState(GraphicsScene *scene, QState *parent = 0); + explicit PlayState(GraphicsScene *scene, QState *parent = 0); ~PlayState(); protected: @@ -96,7 +96,7 @@ private : class PauseState : public QState { public: - PauseState(GraphicsScene *scene, QState *parent = 0); + explicit PauseState(GraphicsScene *scene, QState *parent = 0); protected: void onEntry(QEvent *); diff --git a/examples/widgets/animation/sub-attaq/submarine_p.h b/examples/widgets/animation/sub-attaq/submarine_p.h index f24487aa17..c9b9829eb6 100644 --- a/examples/widgets/animation/sub-attaq/submarine_p.h +++ b/examples/widgets/animation/sub-attaq/submarine_p.h @@ -67,7 +67,7 @@ class MovementState : public QAnimationState { Q_OBJECT public: - MovementState(SubMarine *submarine, QState *parent = 0) : QAnimationState(parent) + explicit MovementState(SubMarine *submarine, QState *parent = 0) : QAnimationState(parent) { movementAnimation = new QPropertyAnimation(submarine, "pos"); connect(movementAnimation,SIGNAL(valueChanged(const QVariant &)),this,SLOT(onAnimationMovementValueChanged(const QVariant &))); @@ -106,7 +106,7 @@ private: class ReturnState : public QAnimationState { public: - ReturnState(SubMarine *submarine, QState *parent = 0) : QAnimationState(parent) + explicit ReturnState(SubMarine *submarine, QState *parent = 0) : QAnimationState(parent) { returnAnimation = new QPropertyAnimation(submarine->rotation(), "angle"); returnAnimation->setDuration(500); |