From: stv Date: Fri, 16 Dec 2005 07:08:10 +0000 (+0000) Subject: Cyclic invocation of method "show" was removed. X-Git-Tag: TG-D5-38-2003_D2005-20-12~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a17460c2760a535c816cfbdc602f30c51f29ec3e;p=modules%2Fgui.git Cyclic invocation of method "show" was removed. --- diff --git a/src/Qtx/QtxMainWindow.cxx b/src/Qtx/QtxMainWindow.cxx index 41b5bbee7..b8968ef8c 100644 --- a/src/Qtx/QtxMainWindow.cxx +++ b/src/Qtx/QtxMainWindow.cxx @@ -224,17 +224,29 @@ void QtxMainWindow::loadGeometry( QtxResourceMgr* resMgr, const QString& section resize( win_w, win_h ); move( win_x, win_y ); - myMode = winState; + myMode = -1; - vis ? show() : hide(); + if ( vis ) + QApplication::postEvent( this, new QCustomEvent( QEvent::User, (void*)winState ) ); + else + myMode = winState; } void QtxMainWindow::show() { - int mode = myMode; + if ( myMode != -1 ) + QApplication::postEvent( this, new QCustomEvent( QEvent::User, (void*)myMode ) ); myMode = -1; + QMainWindow::show(); +} + +void QtxMainWindow::customEvent( QCustomEvent* e ) +{ + QMainWindow::customEvent( e ); + + int mode = (int)e->data(); switch ( mode ) { case WS_Normal: @@ -247,8 +259,6 @@ void QtxMainWindow::show() showMaximized(); break; } - - QMainWindow::show(); } int QtxMainWindow::relativeCoordinate( const int type, const int WH, const int wh ) const diff --git a/src/Qtx/QtxMainWindow.h b/src/Qtx/QtxMainWindow.h index 3d9a1922c..c2aa1bdb7 100644 --- a/src/Qtx/QtxMainWindow.h +++ b/src/Qtx/QtxMainWindow.h @@ -59,6 +59,7 @@ public slots: protected: virtual void setUpLayout(); + virtual void customEvent( QCustomEvent* ); private slots: void onDestroyed( QObject* );