]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
INT PAL 53422: FitAll does't work in OCC viewer
authormpa <mpa@opencascade.com>
Mon, 29 Aug 2016 07:50:46 +0000 (10:50 +0300)
committervsr <vsr@opencascade.com>
Mon, 29 Aug 2016 09:12:04 +0000 (12:12 +0300)
src/OCCViewer/OCCViewer_ViewPort3d.cxx
src/OCCViewer/OCCViewer_ViewPort3d.h

index 814b97a97dc17be4d08b12610389dcad8fa1c3a1..4a2cb3a222ceb4af644dd3845a939e90e2b21128 100755 (executable)
@@ -38,6 +38,7 @@
 #include <QPaintEvent>
 #include <QResizeEvent>
 #include <QApplication>
+#include <QTimer>
 
 #if OCC_VERSION_MAJOR < 7
   #include <Visual3d_View.hxx>
@@ -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 ]
 */
index e122cebabf1a0c253125db0f1757c3c54dbf90dd..f6f9f55f1680f4115433d8d639acb492c3de76b3 100755 (executable)
@@ -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* );