From 38bb2244d5238093af1134d92b92bf34c43d32ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=8B=D1=87=D0=BA=D0=BE=D0=B2=20=D0=90=D0=BD=D0=B4?= =?UTF-8?q?=D1=80=D0=B5=D0=B9?= Date: Thu, 30 Aug 2018 12:39:48 +0000 Subject: [PATCH] git-svn-id: svn://db.shs.com.ru/libs@420 a8b55f48-bf90-11e4-a774-851b48703e85 --- qad/blockview/blockview.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/qad/blockview/blockview.cpp b/qad/blockview/blockview.cpp index eb2394a..07ef3c3 100644 --- a/qad/blockview/blockview.cpp +++ b/qad/blockview/blockview.cpp @@ -258,7 +258,7 @@ bool BlockView::eventFilter(QObject * o, QEvent * e) { mm_drag = moved = false; screen_point = me->screenPos(); scene_point = me->scenePos(); - if (me->button() == Qt::MidButton) { + if ((me->button() == Qt::MidButton) || (me->button() == Qt::RightButton)) { thumbShow(); restartTimer(timer_thumb, thumb_hide_delay); return true; @@ -493,7 +493,7 @@ bool BlockView::eventFilter(QObject * o, QEvent * e) { if (me->buttons().testFlag(Qt::RightButton)) btncnt++; if (me->buttons().testFlag(Qt::MidButton)) btncnt++; mm_cancel = btncnt > 0; - if (mm_cancel || me->button() == Qt::MidButton) { + if (mm_cancel || (me->button() == Qt::MidButton) || (me->button() == Qt::RightButton)) { mm_ci = 0; return true; } @@ -650,7 +650,12 @@ void BlockView::wheelEvent(QWheelEvent * e) { void BlockView::mousePressEvent(QMouseEvent * event) { press_point = event->pos(); - if (event->buttons().testFlag(Qt::MidButton)) setCursor(Qt::ClosedHandCursor); + if (event->buttons().testFlag(Qt::MidButton) || event->buttons().testFlag(Qt::RightButton)) { + setCursor(Qt::ClosedHandCursor); + sel_rect.hide(); + if (sel_rect.scene()) + scene_->removeItem(&sel_rect); + } QGraphicsView::mousePressEvent(event); } @@ -663,7 +668,7 @@ void BlockView::mouseReleaseEvent(QMouseEvent * event) { void BlockView::mouseMoveEvent(QMouseEvent * event) { if (navigation) { - if (event->buttons().testFlag(Qt::MidButton)) { + if (event->buttons().testFlag(Qt::MidButton) || event->buttons().testFlag(Qt::RightButton)) { QPoint dp = (press_point - event->pos()); horizontalScrollBar()->setValue(horizontalScrollBar()->value() + dp.x()); verticalScrollBar()->setValue(verticalScrollBar()->value() + dp.y());