Project

General

Profile

Dynamic WTreeView inside a WGroupBox

Added by Rob Van Dyck over 12 years ago

Hi,

I would like to have a WTreeView inside a WGroupBox, that uses all available width, and expands (and shrinks) vertically to display all currently visible rows.

I created this using the attached buildable/executable code.

For the horizontal resizing: I make the WTreeView LayoutSizeAware.

For the vertical resizing: I respond on signals for collapsing/expanding nodes, calculate and set the new needed height and call update on the layout manager that the WTreeView is positioned in.

I'm wondering whether there is a better way to do this? And if not, how would I avoid the flickering when collapsing/expanding treenodes?

Thanx for your input!

Rob.

main.cpp (4.83 KB) main.cpp

Replies (3)

RE: Dynamic WTreeView inside a WGroupBox - Added by Rob Van Dyck over 12 years ago

One improvement is moving the 'layout_->update_layout();' call to the end of item_collapsed(). Because in the case of expansion the layout manager allready does the correct action.

RE: Dynamic WTreeView inside a WGroupBox - Added by Rob Van Dyck over 12 years ago

But it will still have the flickering issue when collapsing a node.

RE: Dynamic WTreeView inside a WGroupBox - Added by Rob Van Dyck about 12 years ago

Any pointers or hints are appreciated :-)!

Thanx in advance,

Rob.

    (1-3/3)