diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2021-08-09 15:13:11 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2021-08-09 14:00:19 +0000 |
commit | 2c7b2ad6854a354aec5108ed4595369bca7f903a (patch) | |
tree | 1a9b8ee2eb885498263f478fafd2cdd07e1c40d9 /share | |
parent | ffe03c7870ed934b01c4d2b98290117c21303f02 (diff) |
QmlPuppet: Fix incorrect initial render size/scene for edit 3D
The scene id was stored as array of QChars instead of QString, which
caused issues restoring the correct scene at puppet reset.
The intitial incorrect render size was caused by not changing the
render window size in addition to root QML item size.
Fixes: QDS-4586
Change-Id: Id6b16d778a9d886e8fdc40eab1e549d13091f8f4
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'share')
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp | 2 | ||||
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp index 39ca48b8e3..d5acb9f582 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/editor3d/generalhelper.cpp @@ -328,7 +328,7 @@ void GeneralHelper::storeToolState(const QString &sceneId, const QString &tool, handlePendingToolStateUpdate(); QVariant theState; // Convert JS arrays to QVariantLists for easier handling down the line - if (state.canConvert(QMetaType::QVariantList)) + if (state.metaType().id() != QMetaType::QString && state.canConvert(QMetaType::QVariantList)) theState = state.value<QVariantList>(); else theState = state; diff --git a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp index b48f37b07c..426cd730ea 100644 --- a/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp +++ b/share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5informationnodeinstanceserver.cpp @@ -1471,8 +1471,11 @@ void Qt5InformationNodeInstanceServer::setup3DEditView(const QList<ServerNodeIns ++it; } if (toolStates.contains(helper->globalStateId())) { - if (toolStates[helper->globalStateId()].contains(helper->rootSizeKey())) - m_editView3DData.rootItem->setSize(toolStates[helper->globalStateId()][helper->rootSizeKey()].value<QSize>()); + if (toolStates[helper->globalStateId()].contains(helper->rootSizeKey())) { + QSize size = toolStates[helper->globalStateId()][helper->rootSizeKey()].value<QSize>(); + m_editView3DData.rootItem->setSize(size); + m_editView3DData.window->setGeometry(0, 0, size.width(), size.height()); + } if (toolStates[helper->globalStateId()].contains(helper->lastSceneIdKey())) lastSceneId = toolStates[helper->globalStateId()][helper->lastSceneIdKey()].toString(); } |