forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -328,7 +328,7 @@ void GeneralHelper::storeToolState(const QString &sceneId, const QString &tool,
|
|||||||
handlePendingToolStateUpdate();
|
handlePendingToolStateUpdate();
|
||||||
QVariant theState;
|
QVariant theState;
|
||||||
// Convert JS arrays to QVariantLists for easier handling down the line
|
// 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>();
|
theState = state.value<QVariantList>();
|
||||||
else
|
else
|
||||||
theState = state;
|
theState = state;
|
||||||
|
@@ -1471,8 +1471,11 @@ void Qt5InformationNodeInstanceServer::setup3DEditView(const QList<ServerNodeIns
|
|||||||
++it;
|
++it;
|
||||||
}
|
}
|
||||||
if (toolStates.contains(helper->globalStateId())) {
|
if (toolStates.contains(helper->globalStateId())) {
|
||||||
if (toolStates[helper->globalStateId()].contains(helper->rootSizeKey()))
|
if (toolStates[helper->globalStateId()].contains(helper->rootSizeKey())) {
|
||||||
m_editView3DData.rootItem->setSize(toolStates[helper->globalStateId()][helper->rootSizeKey()].value<QSize>());
|
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()))
|
if (toolStates[helper->globalStateId()].contains(helper->lastSceneIdKey()))
|
||||||
lastSceneId = toolStates[helper->globalStateId()][helper->lastSceneIdKey()].toString();
|
lastSceneId = toolStates[helper->globalStateId()][helper->lastSceneIdKey()].toString();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user