title: How to remove an Item from a List View?
body: <p>I have a <strong>QLineEdit</strong>, 2 <strong>QPushButtons</strong> (Add &amp; Remove Buttons) and a <strong>QListView</strong>.
  I want to add the <strong>QLineEdit text to the QListView</strong> when the add button is clicked. Same way, I have to delete an item from the <strong>QListView</strong> if the remove button is clicked.
  I'm using a <strong>QStringListModel</strong> to add the <strong>QLineEdit</strong> text to the <strong>QListView</strong>. But I don't know how to delete the <strong>QListView item</strong>. How can I do this? Plz Help.. Thanks in Advance.</p>
  
  <pre><code>#ifndef  EXAMPLE_H
  #define  EXAMPLE_H
  #include &lt;QWidget&gt;
  #include &lt;QStringList&gt;
  #include &lt;QStringListModel&gt;
  
  
  class EXAMPLE : public QWidget
  {
      Q_OBJECT
  
   public:
       explicit EXAMPLE(QWidget *parent = 0);
       ~EXAMPLE();
  
   private slots:
        void on_addButton_released();
        void on_removeButon_released();
  
   private:
        Ui::EXAMPLE *ui;
        QStringList  stringList;
   };
  
   #endif // EXAMPLE_H
  
  
      EXAMPLE.CPP
  
      #include "EXAMPLE.h"
      #include &lt;QStringListModel&gt;
  
  
      EXAMPLE::EXAMPLE(QWidget *parent) :
          QWidget(parent),
          ui(new Ui::EXAMPLE)
      {
          ui-&gt;setupUi(this);
          ui-&gt;listView-&gt;setModel(new QStringListModel(stringList));
      }
  
      EXAMPLE::~EXAMPLE()
      {
          delete ui;
      }
  
      void EXAMPLE::on_addButton_released()
      {
          stringList.append(ui-&gt;lineEdit-&gt;text());
          ((QStringListModel*) ui-&gt;listView-&gt;model())-&gt;setStringList(stringList);
          ui-&gt;lineEdit-&gt;clear();
      }
  
      void EXAMPLE::on_removeButon_released()
      {
  
      }
  </code></pre>