139 views
in GUI Development by
Hi,

I've created two component class, ScreenA and ScreenB of type Core::Group. I've added one property say PropertyA with update method UpdatePropertyA in DeviceClass. So whenever this PropertyA is updated, the linked UpdatePropertyA method will do notifyobservers as I've added. I've added one property observer in ScreenA and ScreenB respectively.
1. I'm updating the PropertyA from DeviceClass. So that the property observer added in the ScreenA is get notified and the attached slot method is executed.
2. But while I'm trying to swtich to ScreenB, again If I'm updating the PropertyA from Device class the property observer in both ScreenA and ScreenB attached slot methods are executing.
3. But in my use case I want the ScreenA property observer to remain unchanged whenever it's switched from one screen to another screen.
4. How we can achieve this usecase.

Thanks & Regards
Dinesh Thirumaran

1 Answer

0 votes
by

Hello Dinesh,

do you want the observer to be notified only in the actual active dialog? In such case you could add following condition to the begin of the slot method triggered by the observer:

// If 'this' component is not the active Dialog anymore, ignore the event.
if ( !IsCurrentDialog())
  return;

... continue with event processing

Depending on your application case you could also use other methods to test the dialog state (e.g. IsActiveDialog()). See the section Identify the active Dialogs and avoid race conditions for more details.

I hope it helps you further,.

Best regards

Paul

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

...