forked from qt-creator/qt-creator
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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user