506 views
in GUI Development by

Hi EW Team,
I am developing an event input screen in my GUI.


When I try to lonad the getRoot() component to define the VirtualKeyboard property, the Core::Root object returned is null. How can it be?

1 Answer

0 votes
by
 
Best answer
Alright, I think I solved it by using inside my init() a postsignal to a slot LateInit with the initialization of the VirtualKeyboard in it.
by

Hello Velas,

GetRoot() searches for the root object of the view tree. Therefore it works only for components which are part of the view tree (see also Understand the view tree and the Owner relationships). If the component is not belonging to the view tree, then GetRoot() can't find the root object and returns null. This is also the case for a just created instance of a component when it's Init() method is executed.

In version 12 we added a new global variable named rootthis. Using this variable you can access the root object from elsewhere, even form non-visual objects like a Device Interface. This enhancement should simplify the access to the view tree and its root object.

Best regards

Paul Banach

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

...