issue 826 pattern modified when group modified
--HG-- branch : feature
This commit is contained in:
parent
5b181cc3b8
commit
5fba6b797b
|
@ -2486,6 +2486,8 @@ void VAbstractPattern::AddItemToGroup(quint32 toolId, quint32 objectId, quint32
|
||||||
item.setAttribute(AttrObject, objectId);
|
item.setAttribute(AttrObject, objectId);
|
||||||
group.appendChild(item);
|
group.appendChild(item);
|
||||||
|
|
||||||
|
modified = true;
|
||||||
|
emit patternChanged(false);
|
||||||
emit UpdateGroups();
|
emit UpdateGroups();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2526,6 +2528,9 @@ void VAbstractPattern::RemoveItemFromGroup(quint32 toolId, quint32 objectId, qui
|
||||||
if(toolIdIterate == toolId && objectIdIterate == objectId)
|
if(toolIdIterate == toolId && objectIdIterate == objectId)
|
||||||
{
|
{
|
||||||
group.removeChild(itemNode);
|
group.removeChild(itemNode);
|
||||||
|
|
||||||
|
modified = true;
|
||||||
|
emit patternChanged(false);
|
||||||
emit UpdateGroups();
|
emit UpdateGroups();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -149,8 +149,14 @@ void VDrawTool::ContextMenu(QGraphicsSceneContextMenuEvent *event, quint32 itemI
|
||||||
GOType itemType = GOType::Unknown;
|
GOType itemType = GOType::Unknown;
|
||||||
if(itemId != NULL_ID)
|
if(itemId != NULL_ID)
|
||||||
{
|
{
|
||||||
const auto obj = data.GetGObject(itemId);
|
try
|
||||||
itemType = obj->getType();
|
{
|
||||||
|
itemType = data.GetGObject(itemId)->getType();
|
||||||
|
}
|
||||||
|
catch (const VExceptionBadId &e)
|
||||||
|
{ // Possible case. Parent was deleted, but the node object is still here.
|
||||||
|
qWarning() << qUtf8Printable(e.ErrorMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qCDebug(vTool, "Creating tool context menu.");
|
qCDebug(vTool, "Creating tool context menu.");
|
||||||
|
|
Loading…
Reference in New Issue
Block a user