QmlDesigner: Update selection box on parent change

Selection box geometry update sets explicit global transform for
selection box root. The transform depends on the target node
parent, so if the parent changes, the box needs to be updated.

Change-Id: Iccf8b7e863bcfe541bbb4f60a4094739a7513e8d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Miikka Heikkinen
2019-12-09 15:46:46 +02:00
parent f26d770322
commit 128c7a34af

View File

@@ -98,6 +98,10 @@ void SelectionBoxGeometry::setTargetNode(QQuick3DNode *targetNode)
QObject::connect(model, &QQuick3DModel::geometryChanged, QObject::connect(model, &QQuick3DModel::geometryChanged,
this, &SelectionBoxGeometry::update, Qt::QueuedConnection); this, &SelectionBoxGeometry::update, Qt::QueuedConnection);
} }
if (m_targetNode) {
QObject::connect(m_targetNode, &QQuick3DNode::parentChanged,
this, &SelectionBoxGeometry::update, Qt::QueuedConnection);
}
emit targetNodeChanged(); emit targetNodeChanged();
update(); update();