Is there a way to ensure my widget and its child widget components initialize/construct/preconstruct in accordance with their established child/parent hierarchy?
As it currently stands, the parent widget which contains several widget components, which themselves may contain widget components. completely ignores any semblance of lifecycle initialization order.
I would expect the lifecycle to call the parent’s OnInitialized event after all children/grandchildren have finished their initialization.
Expected:
1. Preconstruct All
2. Construct All
3. OnInitialized GrandChild
4. OnInitialized Child
5. OnInitialized Parent
However, instead when I print out the results of each event, I get the following order:
1. OnInitialized Parent
2. OnInitialized Child
3. PreConstruct Child
4. Construct Child
5. PreConstruct Parent
6. Construct Parent
//I Understand UE calls PreConstruct and Construct multiple times as part of class construction and templating.
7. PreConstruct Child
8. PreConstruct Parent
9. PreConstruct Child
10. PreConstruct Parent
11. PreConstruct Child
12. PreConstruct Parent
13. PreConstruct Child
14. PreConstruct Parent
I need to call a function in a child widget component after the parent has finished Initializing. That child will configure it’s components accordingly. However the child’s components are still null
or unknown
by the time the parent has finished.