[Kde-games-devel] Displaying a table
    Ian Wadham 
    ianw2 at optusnet.com.au
       
    Thu Jun 21 08:49:05 CEST 2007
    
    
  
On Thu, 21 Jun 2007 01:33 pm, Matthew Woehlke wrote:
> KColorDialog had problems with QTableWidget, maybe you are running into
> something similar? You could try using QHeaderView::resizeSection instead.
>
Hole in one, Matthew! :-)  And thanks for the QFontMetrics tip, Guillaume.
It seems that QHeaderView controls the whole column-sizing (or
row-sizing) thing.  The following will make an entire column of a tree
or table set its size to hold and display whatever data is in column
N, except that the user can no longer resize it.
  tree->header()->setResizeMode (N, QHeaderView::ResizeToContents);
QHeaderView::resizeSection would give even finer control over the
data display.  Thanks, guys!  I had been looking for days in the
wrong places.
All the best, Ian W.
    
    
More information about the kde-games-devel
mailing list