[Qt-interest] QTreeView or QTableView size

David Boosalis david.boosalis at gmail.com
Wed Sep 14 21:27:52 CEST 2011


You might try this:
QTableView::horizontalHeader()->resizeSections(
QHeaderView::ResizeToContents);

On Thu, Sep 8, 2011 at 1:58 AM, <jani at wbsources.com> wrote:

> Hello Gents,
>
> Is it possible to automatically resize QTableView to its content?
> Now I set its size to QTableView::horizontalHeader()->height() + counting
> the lines and calling rowHeight() on all of them. QSizePolicy::Minimum
> does not seem to affect how my table is sized. Also there is a default
> minimum size (256x192) for all QTableView even if is set minimum size to
> to zero.
>
> Any help would be greatly appreciated.
> Thanks.
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110914/2bfbbcb2/attachment.html 


More information about the Qt-interest-old mailing list