From 5edc2414260d3b79a442a66a0b85b96fbf4948fd Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 8 Feb 2017 11:06:17 +0200 Subject: [PATCH] Fix corruption a pattern after using Union Details tool. --HG-- branch : develop --- src/libs/vtools/tools/nodeDetails/vabstractnode.cpp | 13 +++++++++++++ src/libs/vtools/tools/nodeDetails/vabstractnode.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/src/libs/vtools/tools/nodeDetails/vabstractnode.cpp b/src/libs/vtools/tools/nodeDetails/vabstractnode.cpp index a8e2f433c..1fecba190 100644 --- a/src/libs/vtools/tools/nodeDetails/vabstractnode.cpp +++ b/src/libs/vtools/tools/nodeDetails/vabstractnode.cpp @@ -142,6 +142,19 @@ void VAbstractNode::GroupVisibility(quint32 object, bool visible) Q_UNUSED(visible) } +//--------------------------------------------------------------------------------------------------------------------- +void VAbstractNode::ToolCreation(const Source &typeCreation) +{ + if (typeCreation == Source::FromGui || typeCreation == Source::FromTool) + { + AddToFile(); + } + else + { + RefreshDataInFile(); + } +} + //--------------------------------------------------------------------------------------------------------------------- /** * @brief AddToModeling add tag to modeling tag current pattern peace. diff --git a/src/libs/vtools/tools/nodeDetails/vabstractnode.h b/src/libs/vtools/tools/nodeDetails/vabstractnode.h index 666eaa19c..3bb25bbc8 100644 --- a/src/libs/vtools/tools/nodeDetails/vabstractnode.h +++ b/src/libs/vtools/tools/nodeDetails/vabstractnode.h @@ -67,6 +67,8 @@ public: protected: ParentType parentType; + + virtual void ToolCreation(const Source &typeCreation) Q_DECL_OVERRIDE; protected: /** @brief idNodenode id. */ quint32 idNode;