title: How do I get the items selected from a QListView?
body: <pre><code>{
  ...
      nrow = 10;     
      ncol = 1;
  
      /*create QListView */
      m_listView = new QListView(this);
      m_listView-&gt;setGeometry(QRect(QPoint(0,100), QSize(100, 150)));
  
      QStandardItemModel *model = new QStandardItemModel( nrow, 1, this );
  
      //fill model value
      for( int r=0; r&lt;nrow; r++ )
      {
          QString sstr = "[ " + QString::number(r) + " ]";
          QStandardItem *item = new QStandardItem(QString("Idx ") + sstr);
          model-&gt;setItem(r, 0, item);
      }
  
      //set model
      m_listView-&gt;setModel(model);
      m_listView-&gt;setSelectionMode( QAbstractItemView::ExtendedSelection );
      connect(m_listView, SIGNAL(pressed(QModelIndex)), this, SLOT(hItem(QModelIndex)));
  }
  
  void MainWindow::hItem(QModelIndex m)
  {
      QItemSelectionModel *selectionModel = m_listView-&gt;selectionModel();
  
      m_txt2-&gt;setText(QString::number(selectionModel-&gt;selectedIndexes().at(0),'d',0));//???
  
      //not sure how to get the items selected:  index and string per selection    
  }
  </code></pre>