SetStatusBar does not work from a different window

  • 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 ?


  • 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.

  • 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!

  • 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 :)

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.