Project

General

Profile

Actions

Bug #14469

closed
WJ RM

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

Bug #14469: WGroupBox children added via addWidget()/addNew<>() are not rendered

Added by Will Johnson 5 months ago. Updated 5 months ago.

Status:
Closed
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

RM Updated by Romain Mardulyn 5 months ago Actions #1

  • Status changed from New to InProgress
  • Assignee set to Romain Mardulyn
  • Target version set to 4.13.2

RM Updated by Romain Mardulyn 5 months ago Actions #2

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

MV Updated by Matthias Van Ceulebroeck 5 months ago Actions #3

  • Assignee set to Matthias Van Ceulebroeck

RM Updated by Romain Mardulyn 5 months ago Actions #4

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

RM Updated by Romain Mardulyn 5 months ago Actions #5

  • Status changed from Implemented @Emweb to Closed
Actions

Also available in: PDF Atom