Project

General

Profile

Actions

Bug #14469

open

WGroupBox children added via addWidget()/addNew<>() are not rendered

Added by Will Johnson 9 days ago. Updated 2 days ago.

Status:
Implemented @Emweb
Priority:
Normal
Target version:
Start date:
04/14/2026
Due date:
% Done:

0%

Estimated time:

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

Actions #1

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
Actions #2

Updated by Romain Mardulyn 6 days ago

  • Status changed from InProgress to Review
  • Assignee deleted (Romain Mardulyn)
Actions #3

Updated by Matthias Van Ceulebroeck 2 days ago

  • Assignee set to Matthias Van Ceulebroeck
Actions #4

Updated by Romain Mardulyn 2 days ago

  • Status changed from Review to Implemented @Emweb
  • Assignee changed from Matthias Van Ceulebroeck to Romain Mardulyn
Actions

Also available in: Atom PDF