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* )));
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);
}
}
}
}
+//******************************************************
+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)
//{
void onMousePressed(XGUI_ViewWindow* theWindow, QMouseEvent* theEvent);
//void onContextMenuRequested(QContextMenuEvent* theEvent);
+ void onKeyRelease(XGUI_ViewWindow* theView, QKeyEvent* theKey);
+
private:
void addView(QMdiSubWindow* theView);
private:
XGUI_MainWindow* myMainWindow;
- Handle(V3d_Viewer) myV3dViewer;Handle(AIS_Trihedron) myTrihedron;Handle(AIS_InteractiveContext) myAISContext;
+ Handle(V3d_Viewer) myV3dViewer;
+ Handle(AIS_Trihedron) myTrihedron;
+ Handle(AIS_InteractiveContext) myAISContext;
XGUI::InteractionStyle myInteractionStyle;