Bug #14469
openWGroupBox children added via addWidget()/addNew<>() are not rendered
0%
Description
Widgets added to a WGroupBox using addWidget() or addNew<>() are silently not rendered.
This is visible in the Wt Widget Gallery, where the Group Box example displays only the fieldset frame and legend — the child widgets inside are invisible; screenshot shown in attached jpg.
WGroupBox::init() calls setLogicalLayout(nullptr), which unconditionally creates a WVBoxLayout wrapper and passes it to WContainerWidget::setLogicalLayout(), even when the argument is nullptr.
This sets WContainerWidget::layout_ to a non-null but empty WVBoxLayout.
The fix is to only create the WVBoxLayout wrapper and call the parent setLogicalLayout() when a real layout is provided. When called with nullptr (as in init()), just initialize logicalLayout_ without creating a wrapper layout.
I think the attached patch fixes the issue.
thank you
Files
Updated by Romain Mardulyn 7 days ago
- Status changed from New to InProgress
- Assignee set to Romain Mardulyn
- Target version set to 4.13.2
Updated by Romain Mardulyn 6 days ago
- Status changed from InProgress to Review
- Assignee deleted (
Romain Mardulyn)
Updated by Matthias Van Ceulebroeck 2 days ago
- Assignee set to Matthias Van Ceulebroeck
Updated by Romain Mardulyn 2 days ago
- Status changed from Review to Implemented @Emweb
- Assignee changed from Matthias Van Ceulebroeck to Romain Mardulyn