title: QStyledItemDelegate's sizeHint method not called for a QTableView row
body: <p>I have <a href="http://doc.qt.nokia.com/4.7-snapshot/qtableview.html" rel="nofollow">QTableView</a> using a <a href="http://doc.qt.nokia.com/4.7-snapshot/qsqlquerymodel.html" rel="nofollow">QSqlQueryModel</a> (it fetches data from SQLite).</p>
  
  <p>There is a <a href="http://doc.qt.nokia.com/4.7-snapshot/qstyleditemdelegate.html" rel="nofollow">QStyledItemDelegate</a> subclass called <code>MiniItemDelegate</code> that I use as a delegate for the items.  I set up a <a href="http://doc.qt.nokia.com/4.7-snapshot/qstyleditemdelegate.html#sizeHint" rel="nofollow">sizeHint()</a> method like this:</p>
  
  <pre><code>QSize MiniItemDelegate::sizeHint(const QStyleOptionViewItem &amp;option,
                                   const QModelIndex &amp;index) const
  {
      // just for testing...breakpoint shows this line never gets called
      return QSize(256,256);  
  }
  </code></pre>
  
  <p>I'm not sure why this method isn't called when I run the following code:</p>
  
  <pre><code>m_pMiniItemDelegate = new MiniItemDelegate(this);
  ui-&gt;PList_tableView-&gt;setSelectionBehavior(QAbstractItemView::SelectRows);
  ui-&gt;PList_tableView-&gt;setSelectionMode(QAbstractItemView::SingleSelection);
  ui-&gt;PList_tableView-&gt;setItemDelegate(m_pMiniItemDelegate);
  ui-&gt;PList_tableView-&gt;setAlternatingRowColors(true);
  ui-&gt;PList_tableView-&gt;setModel(ListMiniSqlModel::instance());
  </code></pre>
  
  <p>This also doesn't work:</p>
  
  <pre><code>ui-&gt;PList_tableView-&gt;resizeColumnsToContents();
  ui-&gt;PList_tableView-&gt;resizeRowsToContents();
  </code></pre>
  
  <p>Nor does this:</p>
  
  <pre><code>QHeaderView* headerView = ui-&gt;PList_tableView-&gt;horizontalHeader();
  headerView-&gt;setResizeMode(QHeaderView::ResizeToContents);
  </code></pre>