From de4ef1c88dc155025fd39e2d4d31cfd060959265 Mon Sep 17 00:00:00 2001 From: stv Date: Thu, 26 Jan 2006 14:08:32 +0000 Subject: [PATCH] Info label in the status bar shown at the first time after creation. --- src/SUIT/SUIT_Application.cxx | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/SUIT/SUIT_Application.cxx b/src/SUIT/SUIT_Application.cxx index 4ae8aec86..f187bfabd 100755 --- a/src/SUIT/SUIT_Application.cxx +++ b/src/SUIT/SUIT_Application.cxx @@ -120,16 +120,19 @@ SUIT_ResourceMgr* SUIT_Application::resourceMgr() const #define DEFAULT_MESSAGE_DELAY 3000 void SUIT_Application::putInfo ( const QString& msg, const int msec ) { - if ( desktop() ) { - //desktop()->statusBar()->message( msg, msec <= 0 ? DEFAULT_MESSAGE_DELAY : msec ); - if ( !myStatusLabel ) { - myStatusLabel = new QLabel (desktop()->statusBar()); - desktop()->statusBar()->addWidget(myStatusLabel, /*int stretch = */1); - } - myStatusLabel->setText(msg); - if( msec != -1 ) - QTimer::singleShot(msec <= 0 ? DEFAULT_MESSAGE_DELAY : msec, myStatusLabel, SLOT(clear())); + if ( !desktop() ) + return; + + if ( !myStatusLabel ) + { + myStatusLabel = new QLabel( desktop()->statusBar() ); + desktop()->statusBar()->addWidget( myStatusLabel, 1 ); + myStatusLabel->show(); } + + myStatusLabel->setText( msg ); + if ( msec != -1 ) + QTimer::singleShot( msec <= 0 ? DEFAULT_MESSAGE_DELAY : msec, myStatusLabel, SLOT( clear() ) ); } SUIT_Application* SUIT_Application::startApplication( int argc, char** argv ) const -- 2.39.2