title: Remove a row from a QStandardItemModel where selected row is a QTableView
body: <p>I have a Qt project where I have a <code>QStandardItemModel</code> called <code>stockModel</code>. This model is linked to a <code>QTableView</code> called <code>tvStock</code>.</p>
  
  <p>I have a button called <code>btnDelete</code> which has a <code>clicked</code> event set up as follows:</p>
  
  <pre><code>void StockItems::on_btnDelete_clicked()
  {
      //delete
  }
  </code></pre>
  
  <p>How do I delete the selected row of <code>tvStock</code> from <code>stockModel</code>?</p>
  
  <p>I assume I can start with this (but I'm not sure how to complete it):</p>
  
  <pre><code>stockModel-&gt;removeRow(/* What goes here? */);
  </code></pre>
  
  <p>Otherwise let me know if I'm completely on the wrong track.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>I found and modified some code that allows to me to delete the row if the entire row's contents are selected:</p>
  
  <pre><code>QModelIndexList indexes = ui-&gt;tvStock-&gt;selectionModel()-&gt;selectedRows();
  
  while (!indexes.isEmpty()) {
      stockModel-&gt;removeRows(indexes.last().row(), 1);
      indexes.removeLast();
  }
  </code></pre>
  
  <p>Is there a way this code could be modified to delete the entire row if only one of the row items is selected?</p>
  
  <p>Thanks!</p>