From d2f7a742b7f1e7358172f8c06fa9dd51538ec23c Mon Sep 17 00:00:00 2001 From: Ronan Le Tiec Date: Fri, 30 Mar 2018 12:56:37 +0200 Subject: [PATCH] issue 826 update the drawing after adding/removing item to group --HG-- branch : feature --- src/libs/ifc/xml/vabstractpattern.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/libs/ifc/xml/vabstractpattern.cpp b/src/libs/ifc/xml/vabstractpattern.cpp index 98c0de503..ff0b8bca0 100644 --- a/src/libs/ifc/xml/vabstractpattern.cpp +++ b/src/libs/ifc/xml/vabstractpattern.cpp @@ -2486,9 +2486,19 @@ void VAbstractPattern::AddItemToGroup(quint32 toolId, quint32 objectId, quint32 item.setAttribute(AttrObject, objectId); group.appendChild(item); + // to signalised that the pattern was changed and need to be saved modified = true; emit patternChanged(false); + + // to update the group table of the gui emit UpdateGroups(); + + // parse the groups to update the drawing, in case the item was added to an invisible group + QDomElement groups = CreateGroups(); + if (not groups.isNull()) + { + ParseGroups(groups); + } } else { @@ -2529,9 +2539,20 @@ void VAbstractPattern::RemoveItemFromGroup(quint32 toolId, quint32 objectId, qui { group.removeChild(itemNode); + // to signalised that the pattern was changed and need to be saved modified = true; emit patternChanged(false); + + // to update the group table of the gui emit UpdateGroups(); + + // parse the groups to update the drawing, in case the item was removed from an invisible group + QDomElement groups = CreateGroups(); + if (not groups.isNull()) + { + ParseGroups(groups); + } + break; } }