Bug #7396
openWTreeView not working when hidden during construction
0%
Description
When a WTreeView is hidden at construction (e.g. as child of
a WStackedWidget), resizing of the column widths is not working and data are
sometimes not displayed.
Using version 4.1.2
The attachment contains an test case, based on the WTreeView example.
Just replace TreeViewExample.C in the original example by the attached file
I added 3 lines:
43,44d42
< panel->hide();
<
96,98d93
<
< b = wc->addWidget(cpp14::make_unique("Show"));
< b->clicked().connect(panel, &WPanel::show);
The first line hides the panel containing the treeview at construction time.
Line 2 and 3 add a button to manually show the panel.
Start the application and press Show. Then try to resize the columns.
If you remove 'panel->hide()' everything works perfect again
Files
Updated by Roel Standaert almost 5 years ago
- File panel_resize_sensor.patch panel_resize_sensor.patch added
- Status changed from New to InProgress
- Assignee set to Koen Deforche
This issue was already partially fixed on the master
and 4.2-release
branches. The remaining issue seems to have to do with WPanel
itself.
I attached a patch that should fix the remaining issue. Koen, what do you think of this?
Updated by Koen Deforche almost 5 years ago
Roel,
Seems reasonable to me if the same thing didn't work in Wt 3 neither? Otherwise I would be curious how Wt3 got to react to resize?
Regards,
koen
Updated by Roel Standaert almost 5 years ago
It indeed did not work in Wt 3 either. I guess if a WPanel
was placed in a layout, it would react to resizes. In this case it isn't, so wtResize
isn't being triggered.
Updated by Roel Standaert almost 5 years ago
- Status changed from InProgress to Resolved
- Assignee deleted (
Koen Deforche)
I pushed panel_resize_sensor.patch
too.
Updated by Roel Standaert almost 5 years ago
- File forum_16637.cpp forum_16637.cpp added
- File forum_16637_2.cpp forum_16637_2.cpp added
- Status changed from Resolved to New
I will have to revert that change. It's causing a regression in the attached files (related to issue #7404), where the panel shrinks.
Updated by Roel Standaert almost 5 years ago
Turns out WPanel
's wtResize
code is a fairly naive implementation that only really works properly for the default
and polished
theme, but breaks down when using Bootstrap 2 or 3.