diff options
author | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-05-15 23:09:31 (GMT) |
---|---|---|
committer | Rohan McGovern <rohan.mcgovern@nokia.com> | 2011-05-15 23:09:31 (GMT) |
commit | 5aa1cbcdacd19b2e526e358eddac1b7d55a994b5 (patch) | |
tree | 4aba78405e3d98081662fcb934f673acd1b79d42 /examples/tools | |
parent | 8592bcc80b7ec245b485fa54f8bd41c4484e93e0 (diff) | |
parent | 7e4a9187bb11b794e45d95d2e9fae026d6b0d07d (diff) | |
download | Qt-5aa1cbcdacd19b2e526e358eddac1b7d55a994b5.zip Qt-5aa1cbcdacd19b2e526e358eddac1b7d55a994b5.tar.gz Qt-5aa1cbcdacd19b2e526e358eddac1b7d55a994b5.tar.bz2 |
Merge remote branch 'origin/4.8' into qa-review-master
Conflicts:
tests/auto/qaccessibility/tst_qaccessibility.cpp
tests/auto/qsslsocket/tst_qsslsocket.cpp
Diffstat (limited to 'examples/tools')
-rw-r--r-- | examples/tools/undoframework/commands.cpp | 6 | ||||
-rw-r--r-- | examples/tools/undoframework/commands.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/examples/tools/undoframework/commands.cpp b/examples/tools/undoframework/commands.cpp index 9e81c3e..ff7b0b7 100644 --- a/examples/tools/undoframework/commands.cpp +++ b/examples/tools/undoframework/commands.cpp @@ -136,6 +136,12 @@ AddCommand::AddCommand(DiagramItem::DiagramType addType, } //! [7] +AddCommand::~AddCommand() +{ + if (!myDiagramItem->scene()) + delete myDiagramItem; +} + //! [8] void AddCommand::undo() { diff --git a/examples/tools/undoframework/commands.h b/examples/tools/undoframework/commands.h index ba27e2d..a4e4ab9 100644 --- a/examples/tools/undoframework/commands.h +++ b/examples/tools/undoframework/commands.h @@ -87,6 +87,7 @@ class AddCommand : public QUndoCommand public: AddCommand(DiagramItem::DiagramType addType, QGraphicsScene *graphicsScene, QUndoCommand *parent = 0); + ~AddCommand(); void undo(); void redo(); |