I tried playing around with sizePolicy and minimumSize, but that did not accomplish anything useful.

Reimplementing sizeHint works better, e.g.:

Qt Code:
  1. QSize MyTreeWidget::sizeHint() const
  2. {
  3. int width=0;
  4. for (int i=0; i<columnCount(); ++i)
  5. width += 2 + columnWidth(i);
  6. return QSize(width +16-2, 100);
  7. }
To copy to clipboard, switch view to plain text mode 

That is, I basically add up the column-widths. Unfortunately I had to hardcode in "2" for the spacing between columns that is not included in the columnWidth(), and a "16" for the width of a scrollbar. Is there any way to ask Qt about these numbers?