From: CHEMIN Sebastien Date: Thu, 7 Mar 2024 11:37:36 +0000 (+0100) Subject: zoom by Shift button X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6b10a2baf5869f30f320623824d1a4faae089f70;p=modules%2Fgui.git zoom by Shift button --- diff --git a/src/GraphicsView/GraphicsView_ViewPort.cxx b/src/GraphicsView/GraphicsView_ViewPort.cxx index 326cd2d8a..af16efdaa 100644 --- a/src/GraphicsView/GraphicsView_ViewPort.cxx +++ b/src/GraphicsView/GraphicsView_ViewPort.cxx @@ -172,6 +172,9 @@ void GraphicsView_ViewPort::mousePressEvent(QMouseEvent *event) void GraphicsView_ViewPort::mouseMoveEvent(QMouseEvent *event) { + if ((event->modifiers() & Qt::ShiftModifier) && (event->buttons() & Qt::LeftButton)) + activateZoomAction(); + if (zooming && (event->buttons() & Qt::LeftButton)) { QPoint currentPos = event->pos(); @@ -230,11 +233,13 @@ void GraphicsView_ViewPort::clearActions() void GraphicsView_ViewPort::activateZoomAction() { zooming = true; + fittingArea = false; setCursor(*zoomCursor); } void GraphicsView_ViewPort::activateFitAreaAction() { fittingArea = true; + zooming = false; setCursor(Qt::PointingHandCursor); }