You can use QApplication::topLevelWidgets()
to get a list of top-level widgets (windows). You'd call it like this: qApp->topLevelWidgets()
.
There are multiple ways of notifying those widgets about the changes. I've listed some of them below; the list is by no means exhaustive, there are many more ways of doing it.
You can use a
QObject
to store your settings in dynamic properties. You can emit a signal when any property is changed. ReimplementQObject::event()
to handleQDynamicPropertyChangeEvent
that the object will receive whenever a dynamic property is changed. Whenever a property is changed, you can simply store it in QSettings. The object's initial property values can be retrieved from QSettings upon construction.Emit a signal manually whenever you change settings, and connect it to each SDI window at the point when you create it. This doesn't require using the
topLevelWidgets()
method.Use a custom model, say derived from
QAbstractListModel
, and attach your windows to thedataChanged
signal of the model.