X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_ViewerProxy.cpp;h=44cee80cdc980b62a20667d057bfe53febca0944;hb=9c54fb01877c455abb5b5ff22e384468f795b328;hp=3352c318f9d7c74b88235d94e1d87007b8d9d59a;hpb=1cbebb6f3e523ba66c3a2af447b33f8f210343ec;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_ViewerProxy.cpp b/src/XGUI/XGUI_ViewerProxy.cpp index 3352c318f..44cee80cd 100644 --- a/src/XGUI/XGUI_ViewerProxy.cpp +++ b/src/XGUI/XGUI_ViewerProxy.cpp @@ -42,7 +42,7 @@ Handle(V3d_View) XGUI_ViewerProxy::activeView() const return myWorkshop->salomeConnector()->viewer()->activeView(); } else { AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer(); - return (aViewer->activeViewWindow()) ? aViewer->activeViewWindow()->viewPort()->getView() : + return (aViewer->activeViewWindow()) ? aViewer->activeViewWindow()->viewPortApp()->getView() : Handle(V3d_View)(); } } @@ -64,7 +64,7 @@ void XGUI_ViewerProxy::fitAll() } else { AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer(); if (aViewer->activeViewWindow()) - aViewer->activeViewWindow()->viewPort()->fitAll(); + aViewer->activeViewWindow()->viewPortApp()->fitAll(); } } @@ -81,7 +81,7 @@ void XGUI_ViewerProxy::connectToViewer() this, SIGNAL(deleteView(ModuleBase_IViewWindow*))); connect(aViewer, SIGNAL(viewCreated(ModuleBase_IViewWindow*)), - this, SIGNAL(viewCreated(ModuleBase_IViewWindow*))); + this, SLOT(onViewCreated(ModuleBase_IViewWindow*))); connect(aViewer, SIGNAL(activated(ModuleBase_IViewWindow*)), this, SIGNAL(activated(ModuleBase_IViewWindow*))); @@ -150,16 +150,11 @@ void XGUI_ViewerProxy::connectToViewer() bool XGUI_ViewerProxy::eventFilter(QObject *theObject, QEvent *theEvent) { - AppElements_Viewer* aViewer = myWorkshop->mainWindow()->viewer(); - bool isViewPort = theObject == aViewer->activeViewWindow()->viewPort(); - if (isViewPort) - { - if (theEvent->type() == QEvent::Enter) { - emit enterViewPort(); - } - else if (theEvent->type() == QEvent::Leave) { - emit leaveViewPort(); - } + if (theEvent->type() == QEvent::Enter) { + emit enterViewPort(); + } + else if (theEvent->type() == QEvent::Leave) { + emit leaveViewPort(); } return ModuleBase_IViewer::eventFilter(theObject, theEvent); } @@ -174,6 +169,13 @@ void XGUI_ViewerProxy::onDeleteView(AppElements_ViewWindow* theWnd) emit deleteView(theWnd); } +void XGUI_ViewerProxy::onViewCreated(ModuleBase_IViewWindow* theWnd) +{ + theWnd->viewPort()->installEventFilter(this); + + emit viewCreated(theWnd); +} + void XGUI_ViewerProxy::onViewCreated(AppElements_ViewWindow* theWnd) { theWnd->viewPort()->installEventFilter(this);