Project

General

Profile

WTableView: automatic column size?

Added by Vincenzo Romano over 12 years ago

Is there a way to automatically resize a WTableView whose model (actually WStandardItemModel) has been completely filled in?


Replies (9)

RE: WTableView: automatic column size? - Added by Vincenzo Romano over 12 years ago

Calling

setColumnWidth( colno,WLength::Auto );

didn't help.

RE: WTableView: automatic column size? - Added by Arjan Vermeij over 12 years ago

I'm not sure I understand what you mean. What are you trying to achieve?

I would like to have columns that automagically adjust themselves to the maximum width of the content of each of its cells. Is this possible?

Arjan.

RE: WTableView: automatic column size? - Added by Vincenzo Romano over 12 years ago

The width of each column should be the minimun needed to display in just one line the widest content of any cell in that column.

Like you have tables in HTML (see attached fragment).

p.html (134 Bytes) p.html HTML fragment

RE: WTableView: automatic column size? - Added by Arjan Vermeij over 12 years ago

Well, that's exactly what I would like to have. Have you been able to make a WTableView behave like this at all?

RE: WTableView: automatic column size? - Added by Vincenzo Romano over 12 years ago

Nope.

What I'm focusing now is to get the WTableView to stretch in width so to fill the whole WContainerWidget.

Which is not working with WTabkeView but works with a number of other widgets ...

This could happen because the WTableView is not a

at all but rather an arrangement of

s.

In HTML+CSS, if the containing box has a defined width, whatever you put inside with style="width:100%" should make it stretch to maximum allowed width.

But, again, this seems not to be the case for WTableView.

RE: WTableView: automatic column size? - Added by Vincenzo Romano over 12 years ago

I think we need to hear a word from devs, which also deserve vacations! :-)

So far it's not a show stopper for me and I am now focusing on other things.

At worst I think I'll need to do some code inspection on the sources, which will be time consuming.

RE: WTableView: automatic column size? - Added by Vincenzo Romano over 12 years ago

I think we need to hear a word from devs, which also deserve vacations! :-)

So far it's not a show stopper for me and I am now focusing on other things.

At worst I think I'll need to do some code inspection on the sources, which will be time consuming.

RE: WTableView: automatic column size? - Added by Koen Deforche over 12 years ago

Hey,

Okay okay :-)

The conversation is being consolidated at: http://redmine.emweb.be/boards/2/topics/2659

Regards,

koen

    (1-9/9)