Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void resizeColumnsToContents( QTreeWidget &treeWidget_ )
- {
- int cCols = treeWidget_.columnCount();
- int cItems = treeWidget_.topLevelItemCount();
- int w;
- int col;
- int i;
- for( col = 0; col < cCols; col++ ) {
- w = treeWidget_.header()->sectionSizeHint( col );
- for( i = 0; i < cItems; i++ )
- w = qMax( w, treeWidget_.topLevelItem( i )->text( col ).size()*7 + (col == 0 ? treeWidget_.indentation() : 0) );
- treeWidget_.header()->resizeSection( col, w );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement