Hi,
In my application (in the QMainWindow) I use a QMenuBar and a QToolBar. When other widgets than my QMainWindow (typically QDialog:s, even such that are not Modal) are "focused", in general the QMenuBar is automatically "disabled". The QMenuBar gets enabled again when the other widget is closed, or when "activating"/"focusing" the QMainWindow. This is some kind of default behaviour of the QMenuBar in my QMainWindow, and I would very much like my QToolBar to behave in the same way - to "disable" it when for example a QDialog opens (and are focused), to prevent the user from thinking that he/she can use the ToolButtons all the time.

I've tried changing the QMainWindow:s 'focusInEvent' and 'focusOutEvent', but I did not succeed in "capturing" the correct behaviour. The QMenuBar:s enable/disable state does not seem to be precisely correlated to the focus state od the QMainWindow. Or did I just not succed?

In other word - is there a way of having the QToolBar:s enabled/disabled state "following" the enabled/disabled state of the QMenuBar???