1.0k views
in Getting started by
Hello, is there a way to use the same variable in two different classes?

I have:

application::default and application::setup and I'd like to use in application::setup a variable that I had modified in application::defaut. The variable is a string, so I can't use the Enum or Set.

1 Answer

0 votes
by

Hello,

if you want to have variables (e.g. to store some settings) that should be accessible from different components within your applications, you can put these variables into a separate class and create an autoobject of this class (e.g. Application::Settings). 

Best regards,

Manfred. 

by
Thanks, it's worked. But If I need to change the variable decleared in Application:Settings in another class (e.g. Application::default) and make the change visible to others classes, what shuold I do?
by

You can use notifications and observers to inform your GUI components about changes within the settings class. Is this what you are looking for?

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...