369 views
in GUI Development by
In the documentation is an example for one property and multiple observers. I have the inverse situation:

I have i.e. ten properties. Changing each of them should result in calling the same slot. So what is the best way to implement this?

Pick one of the ten properties, send the notifications of all properties to this property and install an observer for this single property?

1 Answer

+1 vote
by

One typical use-case is that several UI components referring to one property - each time the property changes all UI components get notified. This is very convenient for developing applications with a model-view-controller approach.

Nevertheless, the attachoberserver and notifyobservers statements are not restricted to the notification of property changes (so called property observer).

For your purpose, you can consider to use object observers: If you arrange all your properties within one class, you can first update all properties and then notify all observers of this class. Within your GUI component you can use attachobserver to register a slot method which will be called accordingly.

Alternativley, you can consider to use global observers.

Another solution is the usage of Core::SystemEvent: This means, you create a system event when all data are prepared and place a system event handler within your GUI components to react on the event.

Many ways lead to the goal...

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...