From 5cdb60de088efffeabe9ac76120e15d8d6334210 Mon Sep 17 00:00:00 2001 From: mpa Date: Mon, 29 Aug 2016 10:50:46 +0300 Subject: [PATCH] INT PAL 53422: FitAll does't work in OCC viewer --- src/OCCViewer/OCCViewer_ViewPort3d.cxx | 7 +++---- src/OCCViewer/OCCViewer_ViewPort3d.h | 5 +++-- 2 files changed, 6 insertions(+), 6 deletions(-) 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* ); -- 2.39.2