yes, it's a really simple observer.
QMessagebox static are just convenience calls that make a QMessagebox - so just replace the statics with equivalent instantiations. You'll have to subclass the messagebox and the dialogs anyway (to use the interface I gave above) unless you want to start messing with function pointers and callbacks.
For your needs, I guess you could get away without the interface if you want to be more hacky:
-make the register function void Register(QWidget*)
-get rid of all static calls to messagebox because you will need an instance pointer to pass to Register
-in the manager, call close() on the registered widgets instead of CloseOnIdle()
-to be proper, the manager should connect the destroyed() signal of the widgets to some slot in the manager ('Unregister' would be sensible) so that it could remove the widget from the observers list
If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.
This post has been edited 1 times, last edit by "Amleto" (Dec 10th 2011, 5:58pm)