title: How to update QTableView when database updated?
body: <p>I use <code>QSqlRelationalTableModel</code> to extract data from database, and use <code>tableView</code> to show it. Now, when I update my database, how to update <code>tableView</code> automatically to show it? I know i need to use function <code>dataChanged()</code> to make this automatically, but i do not know how to use it? Any suggestion will be appreciated.</p>
  
  <p>The main code is as follows:</p>
  
  <pre><code>QSqlRelationalTableModel *model = new QSqlRelationalTableModel(NULL, db);
  model-&gt;setTable(tableName);
  model-&gt;select();
  tableView-&gt;setModel(model);
  tableView-&gt;show();
  </code></pre>