137 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

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

...