title: Getting selected rows in QListWidget
body: <p>I have a <code>Qlistwidget</code> in which I can select multiple items. I can get a list with all the selected items in the listwidget but can not find a way to get a list of the corresponding rows. To get a list of the selected items in the listwidget I used the following code:</p>
  
  <pre><code>print [str(x.text()) for x in self.listWidget.selectedItems()]
  </code></pre>
  
  <p>To retrieve the rows I am looking for something like: </p>
  
  <pre><code>a = self.listWidget.selectedIndexes()
  print a
  </code></pre>
  
  <p>But this does not work. I have also tried some code which resulted in outputs like this, which is not very useful:</p>
  
  <pre><code>&lt;PyQt4.QtGui.QListWidgetItem object at 0x0000000013048B88&gt;
  &lt;PyQt4.QtCore.QModelIndex object at 0x0000000014FBA7B8&gt;
  </code></pre>