summaryrefslogtreecommitdiffstats
path: root/examples/tools/undoframework
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/tools/undoframework
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/tools/undoframework')
-rw-r--r--examples/tools/undoframework/commands.h2
-rw-r--r--examples/tools/undoframework/diagramitem.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/tools/undoframework/commands.h b/examples/tools/undoframework/commands.h
index 70667e9f2d..72f61b10a6 100644
--- a/examples/tools/undoframework/commands.h
+++ b/examples/tools/undoframework/commands.h
@@ -70,7 +70,7 @@ private:
class DeleteCommand : public QUndoCommand
{
public:
- DeleteCommand(QGraphicsScene *graphicsScene, QUndoCommand *parent = 0);
+ explicit DeleteCommand(QGraphicsScene *graphicsScene, QUndoCommand *parent = 0);
void undo();
void redo();
diff --git a/examples/tools/undoframework/diagramitem.h b/examples/tools/undoframework/diagramitem.h
index 849ef2132b..91ed55be39 100644
--- a/examples/tools/undoframework/diagramitem.h
+++ b/examples/tools/undoframework/diagramitem.h
@@ -56,7 +56,7 @@ public:
enum { Type = UserType + 1 };
enum DiagramType { Box, Triangle };
- DiagramItem(DiagramType diagramType, QGraphicsItem *item = 0);
+ explicit DiagramItem(DiagramType diagramType, QGraphicsItem *item = 0);
DiagramType diagramType() const {
return polygon() == boxPolygon ? Box : Triangle;