diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2021-08-06 15:58:03 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2021-08-06 13:43:27 +0000 |
commit | 7211b7abf206927a316e0ffbfc20ecdb530c8a65 (patch) | |
tree | 0c0bf4260778ef1cd753d04376eb73f678d7d9e1 /share | |
parent | fec3ef202f620808fdd5de5697c68bba88edd601 (diff) |
QmlPuppet: Fix crash on active scene change
Active scene change involves deleting and recreating the View3D
instance of the 3D editor that imports the actual shown scene.
In Qt 5 it was necessary to mark the deleted View3D instance as having
no content, so it wouldn't receive any more updates. This hack no
longer appears to be necessary and causes this crash instead, so it
was removed.
Fixes: QDS-4786
Change-Id: I848ac78dc2f951ba7e1bf4d3d6aa4244b1443309
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Diffstat (limited to 'share')
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/mockfiles/qt6/EditView3D.qml | 10 | ||||
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp | 5 |
2 files changed, 3 insertions, 12 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/mockfiles/qt6/EditView3D.qml b/share/qtcreator/qml/qmlpuppet/mockfiles/qt6/EditView3D.qml index 83e3705040..d79f1c0f5f 100644 --- a/share/qtcreator/qml/qmlpuppet/mockfiles/qt6/EditView3D.qml +++ b/share/qtcreator/qml/qmlpuppet/mockfiles/qt6/EditView3D.qml @@ -105,8 +105,6 @@ Item { function updateActiveScene() { if (editView) { - // Destroy is async, so make sure we don't get any more updates for the old editView - _generalHelper.enableItemUpdate(editView, false); editView.visible = false; editView.destroy(); } @@ -157,14 +155,6 @@ Item { updateActiveScene(); } - // Disables edit view update if scene doesn't match current activeScene. - // If it matches, updates are enabled. - function enableEditViewUpdate(scene) - { - if (editView) - _generalHelper.enableItemUpdate(editView, (scene && scene === activeScene)); - } - function handleActiveSceneIdChange(newId) { if (sceneId !== newId) { diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index 94f71cd52f..b48f37b07c 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -642,12 +642,13 @@ void Qt5InformationNodeInstanceServer::updateActiveSceneToEditView3D() if (!m_editView3DSetupDone) return; + QVariant activeSceneVar = objectToVariant(m_active3DScene); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // Active scene change handling on qml side is async, so a deleted importScene would crash // editView when it updates next. Disable/enable edit view update synchronously to avoid this. - QVariant activeSceneVar = objectToVariant(m_active3DScene); QMetaObject::invokeMethod(m_editView3DData.rootItem, "enableEditViewUpdate", Q_ARG(QVariant, activeSceneVar)); - +#endif ServerNodeInstance sceneInstance = active3DSceneInstance(); const QString sceneId = sceneInstance.id(); |