forked from qt-creator/qt-creator
QmlDesigner: Handle active scene id change properly on edit 3D view
The scene id shown on the corner of edit 3D view is updated and toolstates are also stored under the new id. Change-Id: Ib3ac2f2bb829a5d908e22932c313c76bd4143592 Fixes: QDS-2277 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -141,6 +141,14 @@ Item {
|
|||||||
_generalHelper.enableItemUpdate(editView, (scene && scene === activeScene));
|
_generalHelper.enableItemUpdate(editView, (scene && scene === activeScene));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleActiveSceneIdChange(newId)
|
||||||
|
{
|
||||||
|
if (sceneId !== newId) {
|
||||||
|
sceneId = newId;
|
||||||
|
storeCurrentToolStates();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function fitToView()
|
function fitToView()
|
||||||
{
|
{
|
||||||
if (editView) {
|
if (editView) {
|
||||||
|
@@ -1253,12 +1253,26 @@ void Qt5InformationNodeInstanceServer::changeIds(const ChangeIdsCommand &command
|
|||||||
{
|
{
|
||||||
Qt5NodeInstanceServer::changeIds(command);
|
Qt5NodeInstanceServer::changeIds(command);
|
||||||
|
|
||||||
|
#ifdef QUICK3D_MODULE
|
||||||
|
ServerNodeInstance sceneInstance = active3DSceneInstance();
|
||||||
if (m_active3DSceneUpdatePending) {
|
if (m_active3DSceneUpdatePending) {
|
||||||
ServerNodeInstance sceneInstance = active3DSceneInstance();
|
|
||||||
const QString sceneId = sceneInstance.id();
|
const QString sceneId = sceneInstance.id();
|
||||||
if (!sceneId.isEmpty())
|
if (!sceneId.isEmpty())
|
||||||
updateActiveSceneToEditView3D();
|
updateActiveSceneToEditView3D();
|
||||||
|
} else {
|
||||||
|
qint32 sceneInstanceId = sceneInstance.instanceId();
|
||||||
|
const QVector<IdContainer> ids = command.ids();
|
||||||
|
for (const auto &id : ids) {
|
||||||
|
if (sceneInstanceId == id.instanceId()) {
|
||||||
|
QMetaObject::invokeMethod(m_editView3DRootItem, "handleActiveSceneIdChange",
|
||||||
|
Qt::QueuedConnection,
|
||||||
|
Q_ARG(QVariant, QVariant(sceneInstance.id())));
|
||||||
|
render3DEditView();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Qt5InformationNodeInstanceServer::changeState(const ChangeStateCommand &command)
|
void Qt5InformationNodeInstanceServer::changeState(const ChangeStateCommand &command)
|
||||||
|
Reference in New Issue
Block a user