From ef8bd63bd32660f4aca8a9c7668a2eb6a6f65865 Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 1 Sep 2015 09:31:07 +0300 Subject: [PATCH] Issue #850 Flyout property panel: sketch features can not be created by clicking in the viewer Additionaly the next regression is corrected: sketch, contour, translation, select lines with a rectangle[move over some lines], click Tab, waiting result-the next control in PP is activated, but it has not happened. --- src/NewGeom/NewGeom_SalomeViewer.cpp | 14 -------------- src/XGUI/XGUI_OperationMgr.cpp | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/NewGeom/NewGeom_SalomeViewer.cpp b/src/NewGeom/NewGeom_SalomeViewer.cpp index 6803bfe8c..3f5a801b5 100644 --- a/src/NewGeom/NewGeom_SalomeViewer.cpp +++ b/src/NewGeom/NewGeom_SalomeViewer.cpp @@ -174,10 +174,6 @@ void NewGeom_SalomeViewer::onMouseDoubleClick(SUIT_ViewWindow* theView, QMouseEv void NewGeom_SalomeViewer::onMouseMove(SUIT_ViewWindow* theView, QMouseEvent* theEvent) { myView->setCurrentView(theView); - OCCViewer_ViewWindow* aViewWnd = dynamic_cast(theView); - Handle(AIS_InteractiveContext) aContext = AISContext(); - if (aContext->HasDetected()) // Set focus to provide key events in the view - aViewWnd->getViewPort()->setFocus(Qt::MouseFocusReason); emit mouseMove(myView, theEvent); } @@ -197,16 +193,6 @@ bool NewGeom_SalomeViewer::canDragByMouse() const //********************************************** void NewGeom_SalomeViewer::onKeyPress(SUIT_ViewWindow* theView, QKeyEvent* theEvent) { - OCCViewer_ViewWindow* aViewWnd = dynamic_cast(theView); - Handle(AIS_InteractiveContext) aContext = AISContext(); - Handle(V3d_View) aView = aViewWnd->getViewPort()->getView(); - - bool noModifiers = (theEvent->modifiers() == Qt::NoModifier); - if ((theEvent->key() == Qt::Key_N) && noModifiers) { - aContext->HilightNextDetected(aView); - } else if ((theEvent->key() == Qt::Key_P) && noModifiers) { - aContext->HilightPreviousDetected(aView); - } emit keyPress(myView, theEvent); } diff --git a/src/XGUI/XGUI_OperationMgr.cpp b/src/XGUI/XGUI_OperationMgr.cpp index 8cb968b1c..efc2ce9d5 100644 --- a/src/XGUI/XGUI_OperationMgr.cpp +++ b/src/XGUI/XGUI_OperationMgr.cpp @@ -9,6 +9,7 @@ #include "ModuleBase_Operation.h" #include "ModuleBase_IWorkshop.h" #include "ModuleBase_IModule.h" +#include #include "ModuleBase_OperationDescription.h" #include "ModuleBase_OperationFeature.h" @@ -412,6 +413,20 @@ bool XGUI_OperationMgr::onKeyReleased(QKeyEvent* theEvent) emit keyEnterReleased(); commitOperation(); } + case Qt::Key_N: + case Qt::Key_P: { + bool noModifiers = (theEvent->modifiers() == Qt::NoModifier); + if (noModifiers) { + ModuleBase_IViewer* aViewer = myWorkshop->viewer(); + Handle(AIS_InteractiveContext) aContext = aViewer->AISContext(); + Handle(V3d_View) aView = aViewer->activeView(); + if ((theEvent->key() == Qt::Key_N)) + aContext->HilightNextDetected(aView); + else if ((theEvent->key() == Qt::Key_P)) + aContext->HilightPreviousDetected(aView); + } + } + break; default: isAccepted = false; -- 2.39.2