Designing a custom widget
Solved
General and Desktop
-
Hello,
I was wondering if in general it's better to design a custom widget containing a pointer for each sub widget/layout allocated in the heap or gather the various pointers using QWidget methods and allocate sub widget only inside methods, taking advantage of parent/child relations, without having a direct reference to them.
In particular, in my custom widget I need to add and remove specific widgets. -
@Daniel_Contro If you need to access the widgets later then it is better to store the pointers as members in your class.
-
@Daniel_Contro Well, if your UI is so dynamic then you can of course use childAt, but keep in mind that it is not very fast (you should not call it in long lasting loops for example).