From a17460c2760a535c816cfbdc602f30c51f29ec3e Mon Sep 17 00:00:00 2001 From: stv Date: Fri, 16 Dec 2005 07:08:10 +0000 Subject: [PATCH] Cyclic invocation of method "show" was removed. --- src/Qtx/QtxMainWindow.cxx | 20 +++++++++++++++----- src/Qtx/QtxMainWindow.h | 1 + 2 files changed, 16 insertions(+), 5 deletions(-) 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* ); -- 2.39.2