title: QListView with QStandardItemModel does not show selection highlight through code
body: <p>I have a <code>QListView</code> that is populated with either a <code>QStandardItemModel</code> or a <code>QStringListModel</code> (based on simplicity of contents... number of columns).   </p>
  
  <p>On load, or switching between widgets, I search for the item that should be selected, and try to highlight it.</p>
  
  <pre><code>if (first)
  {
      m_myListView.setModel(m_standardItemModel);
  
      QList&lt;QStandardItem*&gt; lst = m_standardItemModel-&gt;findItems(m_value1, Qt::MatchExactly, 1);
      if(!lst.isEmpty())
      {
          QModelIndex index = lst.at(0)-&gt;index();
          qDebug() &lt;&lt; index.row();                  // tells me correct row
          //m_myListView.setCurrentIndex(index);    // no change if I use
          m_myListView.selectionModel()-&gt;select(index, QItemSelectionModel::ClearAndSelect);
          m_myListView.scrollTo(index);
      }
  }
  else
  {
      m_myListView.setModel(m_stringListModel);
  
      int i = m_stringListModel-&gt;stringList().indexOf(m_value2);
      if (i &gt;= 0)
      {
          QModelIndex index = m_stringListModel-&gt;index(i);
          m_myListView.selectionModel()-&gt;select(index, QItemSelectionModel::ClearAndSelect);
          m_myListView.scrollTo(index);
      }
  }
  </code></pre>
  
  <p>The <code>m_stringListModel</code> version correctly highlights (and scrolls to item).<br>
  The <code>m_standardItemModel</code> version does not highlight row, and does not scroll to item. But in the uses afterwards, it correctly provides the data for selected index:</p>
  
  <pre><code>QModelIndexList indexList = m_myListView.selectionModel()-&gt;selectedIndexes();
  if (!indexList.isEmpty())
  {
      QModelIndex index = indexList.first();
      if (index.isValid())
      {
          row = index.row();
          data1 = m_standardItemModel-&gt;index(row, 1).data().toString();
  </code></pre>
  
  <p>...</p>
  
  <p>So... it seems that the selection works, but if it does, why do I not see a highlight ? (and the <code>scrollTo()</code> )</p>
  
  <p>Note - the code is pretty giant but I verified for the possibility of reloading the model and possibly losing the selection - and besides, the <code>QStringListModel</code> version works correctly.</p>
  
  <p>Is that a typical behavior of <code>QStandardItemModel</code>, or is there something I must do, like setting a <code>BackgroundRole</code> type data ?</p>
  
  <p>How can I highlight the selection of the list view with the <code>QStandardItemModel</code> applied ?</p>