Commit ba409190 authored by Alex Diev's avatar Alex Diev Committed by Guenter Schwann
Browse files

IVE: Undo actions performed after entering/leaving nested view mess up the scene

parent 44ccf3b6
Pipeline #5732 passed with stage
in 14 minutes and 13 seconds
......@@ -655,7 +655,7 @@ void InterfaceDocument::onItemDoubleClicked(const shared::Id &id)
if (entity->isFunction()) {
if (auto fn = entity->as<ivm::IVFunction *>()) {
if (fn->hasNestedChildren()) {
d->objectsModel->setRootObject(id);
d->itemsModel->changeRootItem(id);
return;
}
}
......
......@@ -58,6 +58,15 @@ IVFunctionGraphicsItem::IVFunctionGraphicsItem(ivm::IVFunction *entity, QGraphic
IVFunctionGraphicsItem::~IVFunctionGraphicsItem() { }
void IVFunctionGraphicsItem::init()
{
IVFunctionTypeGraphicsItem::init();
if (auto dataObj = entity()) {
connect(dataObj, &ivm::IVFunction::childAdded, this, [this](){ update(); });
connect(dataObj, &ivm::IVFunction::childRemoved, this, [this](){ update(); });
}
}
ivm::IVFunction *IVFunctionGraphicsItem::entity() const
{
return qobject_cast<ivm::IVFunction *>(m_dataObject);
......
......@@ -45,6 +45,8 @@ public:
Type = UserType + static_cast<int>(ivm::IVObject::Type::Function)
};
void init() override;
ivm::IVFunction *entity() const override;
int type() const override { return Type; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment