signals and slots in multilayered UI widgets

Usually the enclosing widget encapsulates the widgets inside it and provides a higher-level interface. E.g., if W3 contains several widgets that need to be enabled/disabled depending on some state, W3 would manage that state, provide API for it and enable/disable widgets accordingly. So usually there is no need to go directly from W1 to W3.

If the widgets don’t know about each other (e.g. b/c W1 is a generic container widget that can embed anything), then the one who assembles the UI, knowing all involved widgets, should do the connection.

I don’t know what you mean by “qApp signal”, but that sounds too much like on central object being connected to everything, which of course isn’t good design either.

Maybe you have a specific example you had in mind?

Leave a Comment