Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] how to print a int and string to the status bar?
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] how to print a int and string to the status bar?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kalster
    wrote on last edited by
    #1

    how to print a int and string to the status bar. I would like to display in the status bar, the name of the user and the max connections of the program. something like. User: Fred | Connections: 3. How can i do this. thank you.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kalster
      wrote on last edited by
      #2

      i found it. what i was looking for is ui->statusBar->showMessage. but i discovered a another small problem that i am not able to fix. when I display a statusTip or tooltip somewhere else, the original message of user / connections message is gone. how to display that message after i leave the tips? the mouseMoveEvent does not work.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lgeyer
        wrote on last edited by
        #3

        "QStatusBar::showMessage()":http://developer.qt.nokia.com/doc/qt-4.8/qstatusbar.html#showMessage
        [quote]Hides the normal status indications and displays the given message for the specified number of milli-seconds (timeout). If timeout is 0 (default), the message remains displayed until the clearMessage() slot is called or until the showMessage() slot is called again to change the message.

        Note that showMessage() is called to show temporary explanations of tool tip texts, so passing a timeout of 0 is not sufficient to display a permanent message.[/quote]
        [quote]Normal and Permanent messages are displayed by creating a small widget (QLabel, QProgressBar or even QToolButton) and then adding it to the status bar using the addWidget() or the addPermanentWidget() function. Use the removeWidget() function to remove such messages from the status bar.[/quote]

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kalster
          wrote on last edited by
          #4

          thank you Lukas Geyer

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved