From: mpa Date: Mon, 29 Aug 2016 07:50:46 +0000 (+0300) Subject: INT PAL 53422: FitAll does't work in OCC viewer X-Git-Tag: V8_1_0rc1~17 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5cdb60de088efffeabe9ac76120e15d8d6334210;p=modules%2Fgui.git INT PAL 53422: FitAll does't work in OCC viewer --- diff --git a/src/OCCViewer/OCCViewer_ViewPort3d.cxx b/src/OCCViewer/OCCViewer_ViewPort3d.cxx index 814b97a97..4a2cb3a22 100755 --- a/src/OCCViewer/OCCViewer_ViewPort3d.cxx +++ b/src/OCCViewer/OCCViewer_ViewPort3d.cxx @@ -38,6 +38,7 @@ #include #include #include +#include #if OCC_VERSION_MAJOR < 7 #include @@ -622,21 +623,19 @@ void OCCViewer_ViewPort3d::resizeEvent( QResizeEvent* e ) #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) QApplication::syncX(); #endif - if ( !activeView().IsNull() ) - activeView()->MustBeResized(); + QTimer::singleShot( 0, this, SLOT( repaintViewAfterMove() ) ); } /*! Moved the viewport */ -/* void OCCViewer_ViewPort3d::repaintViewAfterMove( ) { if ( !activeView().IsNull() ){ activeView()->MustBeResized(); } } -*/ + /*! Fits all objects in view. [ virtual protected ] */ diff --git a/src/OCCViewer/OCCViewer_ViewPort3d.h b/src/OCCViewer/OCCViewer_ViewPort3d.h index e122cebab..f6f9f55f1 100755 --- a/src/OCCViewer/OCCViewer_ViewPort3d.h +++ b/src/OCCViewer/OCCViewer_ViewPort3d.h @@ -93,8 +93,6 @@ public: void showStaticTrihedron( bool ); - //void repaintViewAfterMove( ); - void setDefaultCursor( Qt::CursorShape theCursorShape ); QCursor* getDefaultCursor() const; @@ -106,6 +104,9 @@ signals: public slots: virtual bool synchronize( OCCViewer_ViewPort* ); +private slots: + void repaintViewAfterMove(); + protected: // EVENTS virtual void paintEvent( QPaintEvent* );