PDA

View Full Version : Status bar message tend to disappear



maverick_pol
21st May 2009, 09:57
Hi,

I have a custom MainWindow class coded by hand, not .ui file used.
I display a sample message:

statusBar()->showMessage(tr("----- This is status bar position -----"));

It's shown ok. When I move mouse over a menu the message disappears.

This is the only line when I use the statusBar.


When I add a widget to the status bar and set its test( Qlabel) then the message is the same []

Thanks

caduel
21st May 2009, 10:14
those messages are not permanent; have a look at QStatusBar::addPermanentWidget()

You can add a QLabel to a QStatusBar and set that label's text instead.

HTH

Lykurg
21st May 2009, 10:15
That's the normal behavior, because actions provide further explications in the status bar. If you want a permanent message use
QStatusBar::insertPermanentWidget ( int index, QWidget * widget, int stretch = 0 )

maverick_pol
21st May 2009, 10:33
Ok, thank you.
I have done it this way.

I am thinking what are those:


actions provide further explications in the status bar

shawno
16th July 2010, 00:15
I tried this maneuvre on a local status bar I have on each of my "tab" widgets (widgets within a QTabWidget). This local status bar does not behave like the main window status bar. The local messages only appear if the mouse hovers over the "tab" widget and while the mouse is over the "tab" widget the messages do not update. I'm doing tabbed searching of the local file system such that each "tab" widget (containing a QTreeView) performs a distinct search. I need the filepaths to permanently, and possibly rapidly, display and update on the local status bar regardless of the mouse position as I traverse the filesystem. Any ideas?