How to detect when user changes anything in MainWindow screen.

Hi wondering if anybody has a good solution for this problem I am trying to solve.

I have a MainWindow with a bunch of child QDockWidgets, QMainMenu, and QToolbar's, just standard stuff so far.

What I want to do is be able to detect specific types of events in the MainWindow. The category is any user action with the mouse that causes the screen contents to change and would make it look different than before. For example, the child QDockWidget's can be made not visible, be restored, repositioned, resized. Also the toolbars can be repositioned and resized.

It wouldn't work to have each child object detect this itself and signal the MainWindow (for example) because I need to distinguish between user actions upon individual widgets and something like restoreState actions, which I have as a main menu item. So i need to know whether the screen change was due to the user changing a specific child widget or the user choosing the menu item (or toolbar button to do this) restoreState option.

If anybody has any good suggestions I would really appreciate some tips.

there is no all-in-one wonder solution for this ;)
QDockWidget and QToolBar provides signals for several types of changes.
You will need to connect to them when you create the instances.

If you don't want the signals to be triggered in some situations when you change something programatically you have to do this:
@
w->blockSignals(true);
w-> ... // change something which might trigger signals
w->blockSignals(false);
@