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. SetStatusBar does not work from a different window

SetStatusBar does not work from a different window

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 2.5k Views
  • 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.
  • D Offline
    D Offline
    divide
    wrote on last edited by
    #1

    Hi,

    My main window has a status bar which displays the "statusbar" text defined for each widget (when the mouse is over the widget).
    It works, except when the widget is displayed in a new QDialog on top of my main window.
    In this case the main status bar don't get any text from the hovered widget.
    Do I need to define something special ?

    Thanks

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mohsen
      wrote on last edited by
      #2

      it's usual. it's another layer over your objects. if you've fixed position items you may implement a global mouse x,y matrix for objects.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on last edited by
        #3

        As mohsen sais, it is normal that this only works within the currently active window. However, it is possible to make it work outside the window as well, with some tricks. Note, I did not try this myself, but what I would do is this:

        install an event filter on the QApplication object, and listen for QStatusTipEvents.

        if you receive one, you manually set a temporary message on the status bar of your choice using the QStatusBar::showMessage() method, using the text you get from the event.

        Again: I never tried this myself. On the other hand: remember that the reason that this is hard, is probably because it is non-standard behaviour!

        1 Reply Last reply
        0
        • D Offline
          D Offline
          divide
          wrote on last edited by
          #4

          Ok, thanks for the answer !
          The small improvement doesn't worth the extra coding, so I guess popping tool tips will be enough for this window :)

          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