Results 1 to 5 of 5

Thread: Status bar message tend to disappear

  1. #1
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Status bar message tend to disappear

    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
    Last edited by maverick_pol; 21st May 2009 at 11:07.
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Status bar message tend to disappear

    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

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Status bar message tend to disappear

    That's the normal behavior, because actions provide further explications in the status bar. If you want a permanent message use
    Qt Code:
    1. QStatusBar::insertPermanentWidget ( int index, QWidget * widget, int stretch = 0 )
    To copy to clipboard, switch view to plain text mode 

  4. #4
    Join Date
    May 2007
    Location
    Lublin, Poland
    Posts
    345
    Thanks
    40
    Thanked 8 Times in 4 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Status bar message tend to disappear

    Ok, thank you.
    I have done it this way.

    I am thinking what are those:

    actions provide further explications in the status bar
    Qt allows you to use everything you want
    wysota
    --------------------------------------------------------------------------------
    #if defined(Q_OS_UNIX) && defined(QT_DEBUG)
    abort(); // trap; generates core dump
    #else
    exit(1); // goodbye cruel world
    #endif

  5. #5
    Join Date
    Dec 2009
    Location
    Omaha, NE USA
    Posts
    7
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Status bar message tend to disappear

    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?

Similar Threads

  1. "Normal" Status Bar Message doesn't look right...
    By codeslicer in forum Qt Programming
    Replies: 4
    Last Post: 20th January 2009, 00:50
  2. treewidget and a message system
    By alisami in forum Qt Programming
    Replies: 7
    Last Post: 27th July 2008, 19:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.