X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_Viewer.cpp;h=47100f7c463e0e33c472f6c372d8978e939ce7f1;hb=fc2acc7bd36f7bff6ec1f5095bf7c44be15e2574;hp=3a81496155da40783e179953e8384d92d2cc0349;hpb=d9db5498b576854aae37ddf8c0bb6fceb264712e;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_Viewer.cpp b/src/XGUI/XGUI_Viewer.cpp index 3a8149615..47100f7c4 100644 --- a/src/XGUI/XGUI_Viewer.cpp +++ b/src/XGUI/XGUI_Viewer.cpp @@ -458,7 +458,7 @@ void XGUI_Viewer::addView(QMdiSubWindow* theView) SIGNAL(keyPress(XGUI_ViewWindow*, QKeyEvent*))); connect(aWindow, SIGNAL(keyReleased(XGUI_ViewWindow*, QKeyEvent*)), this, - SIGNAL(keyRelease(XGUI_ViewWindow*, QKeyEvent*))); + SLOT(onKeyRelease(XGUI_ViewWindow*, QKeyEvent*))); //connect(aWindow, SIGNAL(contextMenuRequested( QContextMenuEvent* )), // this, SLOT (onContextMenuRequested( QContextMenuEvent* ))); @@ -529,6 +529,8 @@ void XGUI_Viewer::onMouseMove(XGUI_ViewWindow* theWindow, QMouseEvent* theEvent) Handle(V3d_View) aView3d = theWindow->viewPort()->getView(); if (!aView3d.IsNull()) { myAISContext->MoveTo(theEvent->x(), theEvent->y(), aView3d); + if (myAISContext->HasDetected()) + theWindow->viewPort()->setFocus(Qt::MouseFocusReason); } } @@ -607,6 +609,20 @@ void XGUI_Viewer::updateViewsDrawMode() const } } +//****************************************************** +void XGUI_Viewer::onKeyRelease(XGUI_ViewWindow* theView, QKeyEvent* theKey) +{ + Handle(V3d_View) aView = theView->viewPort()->getView(); + bool noModifiers = (theKey->modifiers() == Qt::NoModifier); + if ((theKey->key() == Qt::Key_N) && noModifiers) { + myAISContext->HilightNextDetected(aView); + } else if ((theKey->key() == Qt::Key_P) && noModifiers) { + myAISContext->HilightPreviousDetected(aView); + } else { + emit keyRelease(theView, theKey); + } +} + //****************************************************** //void XGUI_Viewer::onContextMenuRequested(QContextMenuEvent* theEvent) //{