setStatusBar does not work from a different window
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 ?
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!