I want to add childWidgets to a layouted parentWidget at runtime. I need to construct the children like
ChildWidget* child = new ChildWidget(parentWidget);
ChildWidget* child = new ChildWidget(parentWidget);
To copy to clipboard, switch view to plain text mode
right? So now I would expect the child to be layed out according to the parentWidget's layout, but it doesn't happen. It seems like I explicitely have to:
ChildWidget* child = new ChildWidget(parentWidget);
parentWidget->layout()->addWidget(child);
ChildWidget* child = new ChildWidget(parentWidget);
parentWidget->layout()->addWidget(child);
To copy to clipboard, switch view to plain text mode
Is this the right way? It feels like I'm adding the child to the parent twice.
Bookmarks