forked from qt-creator/qt-creator
QmlDesigner: Fix mouse cursor state handling in 3D view
Mouse cursor state is always reported separately and it should not affect other tool state handling, so handle it first and don't do any default handling if the key is missing. Fixes: QDS-15342 Change-Id: I190713b3b97707749f3503ebd9058c72e0b401e5 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -128,6 +128,13 @@ void Edit3DView::renderImage3DChanged(const QImage &img)
|
||||
|
||||
void Edit3DView::updateActiveScene3D(const QVariantMap &sceneState)
|
||||
{
|
||||
const QString mouseCursorKey = QStringLiteral("mouseCursor");
|
||||
if (sceneState.contains(mouseCursorKey)) {
|
||||
setMouseCursor(sceneState[mouseCursorKey].toInt());
|
||||
// Mouse cursor state is always reported separately, as we never want to persist this state
|
||||
return;
|
||||
}
|
||||
|
||||
const QString activeViewportKey = QStringLiteral("activeViewport");
|
||||
if (sceneState.contains(activeViewportKey)) {
|
||||
setActiveViewport(sceneState[activeViewportKey].toInt());
|
||||
@@ -139,15 +146,6 @@ void Edit3DView::updateActiveScene3D(const QVariantMap &sceneState)
|
||||
setActiveViewport(0);
|
||||
}
|
||||
|
||||
const QString mouseCursorKey = QStringLiteral("mouseCursor");
|
||||
if (sceneState.contains(mouseCursorKey)) {
|
||||
setMouseCursor(sceneState[mouseCursorKey].toInt());
|
||||
if (sceneState.size() == 1)
|
||||
return;
|
||||
} else {
|
||||
setMouseCursor(-1);
|
||||
}
|
||||
|
||||
const QString sceneKey = QStringLiteral("sceneInstanceId");
|
||||
const QString selectKey = QStringLiteral("selectionMode");
|
||||
const QString transformKey = QStringLiteral("transformMode");
|
||||
|
Reference in New Issue
Block a user