From 1aa683082dcceca4d93589d83c402e338dbea2a2 Mon Sep 17 00:00:00 2001 From: imn Date: Fri, 4 Dec 2015 11:53:59 +0300 Subject: [PATCH] Fix activation problem and SIGSEGV at OCCViewer and GL Viewer --- src/GLViewer/GLViewer_Viewer.cxx | 2 -- src/OCCViewer/OCCViewer_ViewPort3d.cxx | 6 +----- src/OCCViewer/OCCViewer_ViewSketcher.cxx | 4 ---- src/Qtx/QtxDialog.cxx | 2 -- 4 files changed, 1 insertion(+), 13 deletions(-) diff --git a/src/GLViewer/GLViewer_Viewer.cxx b/src/GLViewer/GLViewer_Viewer.cxx index 395dd686f..a4667ba45 100644 --- a/src/GLViewer/GLViewer_Viewer.cxx +++ b/src/GLViewer/GLViewer_Viewer.cxx @@ -890,8 +890,6 @@ void GLViewer_ViewSketcher::onSketch( SketchState state ) { #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) QApplication::syncX(); /* force rectangle redrawing */ -#else - QApplication::sync(); /* force rectangle redrawing */ #endif myViewer->activateSketching( GLViewer_Viewer::NoSketching ); } diff --git a/src/OCCViewer/OCCViewer_ViewPort3d.cxx b/src/OCCViewer/OCCViewer_ViewPort3d.cxx index 119299fec..a49d32046 100755 --- a/src/OCCViewer/OCCViewer_ViewPort3d.cxx +++ b/src/OCCViewer/OCCViewer_ViewPort3d.cxx @@ -592,8 +592,6 @@ void OCCViewer_ViewPort3d::paintEvent( QPaintEvent* e ) if ( !myWindow.IsNull() ) { #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) QApplication::syncX(); -#else - QApplication::sync(); #endif QRect rc = e->rect(); if ( !myPaintersRedrawing ) @@ -608,15 +606,13 @@ void OCCViewer_ViewPort3d::paintEvent( QPaintEvent* e ) */ void OCCViewer_ViewPort3d::resizeEvent( QResizeEvent* e ) { -#ifdef WIN32 +#if defined WIN32 || QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) /* Win32 : map before first show to avoid flicker */ if ( !mapped( activeView() ) ) mapView( activeView() ); #endif #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) QApplication::syncX(); -#else - QApplication::sync(); #endif if ( !activeView().IsNull() ) activeView()->MustBeResized(); diff --git a/src/OCCViewer/OCCViewer_ViewSketcher.cxx b/src/OCCViewer/OCCViewer_ViewSketcher.cxx index c9faa3a0c..862399de9 100755 --- a/src/OCCViewer/OCCViewer_ViewSketcher.cxx +++ b/src/OCCViewer/OCCViewer_ViewSketcher.cxx @@ -300,8 +300,6 @@ void OCCViewer_RectSketcher::onSketch( SketchState state ) { #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) QApplication::syncX(); /* force rectangle redrawing */ -#else - QApplication::sync(); /* force rectangle redrawing */ #endif mypViewWindow->activateSketching( OCCViewer_ViewWindow::NoSketching ); } @@ -521,8 +519,6 @@ void OCCViewer_PolygonSketcher::onSketch( SketchState state ) } #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) QApplication::syncX(); -#else - QApplication::sync(); #endif mypViewWindow->activateSketching( OCCViewer_ViewWindow::NoSketching ); } diff --git a/src/Qtx/QtxDialog.cxx b/src/Qtx/QtxDialog.cxx index 00c20734a..47a3a2867 100755 --- a/src/Qtx/QtxDialog.cxx +++ b/src/Qtx/QtxDialog.cxx @@ -1444,8 +1444,6 @@ void QtxDialog::emitSignal() QApplication::instance()->processEvents(); #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) QApplication::syncX(); -#else - QApplication::sync(); #endif int id = buttonId( (QAbstractButton*)mySender ); mySender = 0; -- 2.39.2