QmlDesigner: Fix issues with MouseArea3D deactivation detection

Existing mouse grab is now released when MouseArea3D is deactivated
or set to no longer grab the mouse. Various gizmos were also set
to follow MouseArea3D's dragging property instead of keeping track
of drag themselves.

Change-Id: I49f968f20b26eb222fc8635b943e9144073fb164
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Miikka Heikkinen
2019-11-18 15:44:33 +02:00
parent 3dd5e089b1
commit dbfdacecf4
4 changed files with 17 additions and 9 deletions

View File

@@ -123,6 +123,13 @@ void MouseArea3D::setGrabsMouse(bool grabsMouse)
return;
m_grabsMouse = grabsMouse;
if (!m_grabsMouse && s_mouseGrab == this) {
setDragging(false);
setHovering(false);
s_mouseGrab = nullptr;
}
emit grabsMouseChanged();
}
@@ -132,6 +139,13 @@ void MouseArea3D::setActive(bool active)
return;
m_active = active;
if (!m_active && s_mouseGrab == this) {
setDragging(false);
setHovering(false);
s_mouseGrab = nullptr;
}
emit activeChanged();
}