Did you try to do this:

Qt Code:
  1. yourView->header()->setResizeMode(0, QHeaderView::ResizeToContents);
  2. yourView->header()->setStretchLastSection(true);
To copy to clipboard, switch view to plain text mode 

That should do what you want, without you having to resize the column after each expansion.