title: QTableView shows no data, when associated model has got data
body: <p>I am playing with Qt (I am a beginner), and trying to show a table's data in a QTableView.
  So far I have this:</p>
  
  <pre><code>ui-&gt;setupUi(this);
  
  QSqlDatabase db;
  db=QSqlDatabase::addDatabase("QSQLITE");
  db.setDatabaseName("test.db");
  
  if (db.open())
      qDebug() &lt;&lt; "success";
  else
      qDebug() &lt;&lt; "failed";
  QSqlTableModel model;
  model.setTable("names");
  model.select();
  qDebug() &lt;&lt; model.rowCount();
  
  ui-&gt;tableView-&gt;setModel(&amp;model);
  </code></pre>
  
  <p>The problem is that, the model does get the data(2 rows), but the QTableView does now show it.</p>
  
  <p>Any clues what is wrong here?</p>