title: Reimplementing sizeHintForColumn() to resizeColumnsToContents() over all cells (not only shown) in QTableView
body: <p>I am developing a PyQt application that has a QTableWidget, that could, potentially, be used to display a large amount of rows. I would like that each column width would be defined by the maximal element width of the whole column, not only by the largest element that is displayed at the moment of programmatical adding of cells data to the table widget.</p>
  <p>The <a href="http://doc.qt.nokia.com/latest/qtableview.html#resizeColumnToContents" rel="nofollow noreferrer">Qt docs</a> in the resizeColumnToContents() method description state that</p>
  <blockquote>
  <p>Only visible columns will be resized.
  Reimplement <a href="http://doc.qt.nokia.com/latest/qtableview.html#sizeHintForColumn" rel="nofollow noreferrer">sizeHintForColumn()</a> to
  resize hidden columns as well.</p>
  </blockquote>
  <p>The question is, how exactly should I do this correctly? Unfortunately, I have no real experience in PyQt, and I was unable to find any sources of this method to give me any leads on how should I do this.</p>
  <p>And is it possible to do resizing based on the current content displayed at any given moment, i.e. resize after any paintEvents recieved by the table widget?</p>