title: How to pass/retrieve the parameters from/to SIGNAL/SLOT of a QListView?
body: <p>I made a custom <strong>SLOT</strong> called <code>on_listView_currentChanged</code> and connected it to the <code>currentChanged</code> <strong>SIGNAL</strong> of a <strong>QListView</strong>. But the <strong>SIGNAL/SLOT</strong> are not working. </p>
  
  <p>How can I pass/retrieve the parameters from/to SIGNAL/SLOT of a QListView?</p>
  
  <p>Below are my most essential codes:</p>
  
  <p><strong>mainwindow.h</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>#ifndef MAINWINDOW_H
  #define MAINWINDOW_H
  
  #include &lt;QMainWindow&gt;
  #include &lt;QStringListModel&gt;
  #include &lt;QStringList&gt;
  #include &lt;QFile&gt;
  #include &lt;QString&gt;
  #include &lt;QTextStream&gt;
  #include &lt;QTimeEdit&gt;
  #include &lt;QElapsedTimer&gt;
  #include &lt;QItemSelection&gt;
  
  namespace Ui {
  class MainWindow;
  }
  
  class MainWindow : public QMainWindow
  {
      Q_OBJECT
  
  public:
      explicit MainWindow(QWidget *parent = 0);
      ~MainWindow();
  
  private slots:
      void on_listView_currentChanged(const QModelIndex &amp; current, const QModelIndex &amp; previous);
  
  private:
      Ui::MainWindow *ui;
  
      void populateListView();
  
      QStringListModel *stringListModel;
      QStringList stringList;
  };
  
  #endif // MAINWINDOW_H</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>mainwindow.cpp</strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>#include "mainwindow.h"
  #include "ui_mainwindow.h"
  
  MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::MainWindow)
  {
      ui-&gt;setupUi(this);
  
      populateListView();
  
      connect(ui-&gt;listView-&gt;selectionModel(), SIGNAL(currentChanged(const QModelIndex &amp; current, const QModelIndex &amp; previous)), this, SLOT(on_listView_currentChanged(const QModelIndex &amp; current, const QModelIndex &amp; previous)));
  }
  MainWindow::~MainWindow()
  {
      delete ui;
  }
  void MainWindow::on_listView_currentChanged(const QModelIndex &amp; current, const QModelIndex &amp; previous)
  {
      ui-&gt;textBrowser-&gt;setHtml(current.data().toString());
  }
  void MainWindow::populateListView()
  {
      //My lengthy codes to populate the lsitView with items
  }</code></pre>
  </div>
  </div>
  </p>