Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

void QTreeView::resizeColumnToContents ( int  column  )  [slot, inherited]

Resizes the column given to the size of its contents.

Definition at line 1428 of file qtreeview.cpp.

References QTreeView::header(), QWidget::isHidden(), and QTreeView::sizeHintForColumn().

Referenced by QTreeView::setHeader().

{
    Q_D(QTreeView);
    d->executePostedLayout();
    if (column < 0 || column >= d->header->count())
        return;
    int contents = sizeHintForColumn(column);
    int header = d->header->isHidden() ? 0 : d->header->sectionSizeHint(column);
    d->header->resizeSection(column, qMax(contents, header));
}


Generated by  Doxygen 1.6.0   Back to index