Results 1 to 3 of 3

Thread: need help with the status bar

  1. #1
    Join Date
    Feb 2006
    Posts
    7
    Qt products
    Qt3
    Platforms
    Windows

    Default need help with the status bar

    Hello, I'm working on a Main Application in Qt Designer 3.2.1, and I am trying to figure out how to work with the status bar. I know that the following will display the word "message" for two seconds.

    statusBar()->message("message", 2000);

    There's two things I'd like to do:
    1) Display another message after the two seconds. I attempted this, but when I executed the program, the status bar instantly switched to the second message rather than waiting two seconds.

    2) Be able to display multiple items at once, including integers. For example, I'd like to be able to display the word "In", followed by the value of an integer variable, followed by the word "Out", followed by the value of another integer variable.

    I would appreciate any help you could give me. Thanks!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: need help with the status bar

    Quote Originally Posted by filmfreak
    1) Display another message after the two seconds. I attempted this, but when I executed the program, the status bar instantly switched to the second message rather than waiting two seconds.
    You will have to queue messages and use QTimer or QStatusBar::messageChanged() to change them.

    2) Be able to display multiple items at once, including integers. For example, I'd like to be able to display the word "In", followed by the value of an integer variable, followed by the word "Out", followed by the value of another integer variable.
    Just put everything in one string.

    Also check out QStatusBar::addWidget() method.

  3. #3
    Join Date
    Feb 2006
    Location
    Kirovohrad, Ukraine
    Posts
    72
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Smile Re: need help with the status bar

    Quote Originally Posted by filmfreak
    2) Be able to display multiple items at once, including integers. For example, I'd like to be able to display the word "In", followed by the value of an integer variable, followed by the word "Out", followed by the value of another integer variable.
    Qt Code:
    1. statusBar()->message(QString("In: %1 | Out: %2").arg(inValue).arg(outValue));
    To copy to clipboard, switch view to plain text mode 

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. Change cursor & status during Drag & Drop
    By ronlongo in forum Qt Programming
    Replies: 0
    Last Post: 1st December 2008, 17:56
  3. Updating Status Bar Icon
    By nbkhwjm in forum Qt Programming
    Replies: 1
    Last Post: 8th October 2008, 05:22
  4. Status Bar in a SUB WINDOW.
    By Cutey in forum Qt Programming
    Replies: 3
    Last Post: 23rd July 2008, 08:42
  5. Status Widget
    By user_mail07 in forum Qt Programming
    Replies: 4
    Last Post: 18th June 2008, 08:51

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.