November 5, 2011

divide divide
Lab Rat
26 posts

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 ?

Thanks

3 replies

November 7, 2011

Mohsen Mohsen
Robot Herder
725 posts

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.

 Signature 

www.madagon.com

November 7, 2011

Andre Andre
Area 51 Engineer
6031 posts

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:

  1. install an event filter on the QApplication object, and listen for QStatusTipEvents.
  2. 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!

 Signature 

Looking for Qt developers to join our team @ i-Optics: https://qt-project.org/forums/viewthread/25393/

November 7, 2011

divide divide
Lab Rat
26 posts

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

 
  ‹‹ runningLeafAnimations Error      Huge helper poster ! ››

You must log in to post a reply. Not a member yet? Register here!