title: how to change the text of qlineedit when Qlistview index is changed in another qdialog?
body: <p>Hi i want get the text string of QListView in my main window when i click a button in Qdialog. my implementation is :</p>
  
  <p><a href="https://i.stack.imgur.com/nhxVf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nhxVf.png" alt="enter image description here"></a></p>
  
  <p>in Qdialog </p>
  
  <pre><code>void hist::getValue(){
      QModelIndexList templatelist =
          ui-&gt;listView-&gt;selectionModel()-&gt;selectedIndexes();
      QStringList stringlist;
      foreach (const QModelIndex &amp;index, templatelist) {
        stringlist.append(index.data(Qt::DisplayRole).toString());
      }
      qDebug()&lt;&lt;stringlist;
      // return stringlist;   // what i need to here to return stringlist ?
  }
  
  void hist::on_downloadselected_clicked() {
  
      connect(ui-&gt;downloadselected, SIGNAL(clicked()), SLOT(accept()));
  
      // TODO selected download
  }
  </code></pre>
  
  <p>in mainwindow </p>
  
  <pre><code>void mainwindow::on_pushButton_2_clicked()
  {
      hist history;
      history.exec();
      if( history.exec() == QDialog::Accepted ){
         QString damn = history.getValue();  // am getting error here 
         ui-&gt;url-&gt;setText(damn);
         qDebug()&lt;&lt;"pressed";
      }
  }
  </code></pre>