title: Parsing through a csv file in Qt
body: <p>Is anyone familiar with how to parse through a csv file and put it inside a string list. Right now I am taking the entire csv file and putting into the string list. I am trying to figure out if there is a way to get only the first column. </p>
  
  <pre><code>#include "searchwindow.h"
  #include &lt;QtGui/QApplication&gt;
  
  #include &lt;QApplication&gt;
  #include &lt;QStringList&gt;
  #include &lt;QLineEdit&gt;
  #include &lt;QCompleter&gt;
  #include &lt;QHBoxLayout&gt;
  #include &lt;QWidget&gt;
  #include &lt;QLabel&gt;
  
  #include &lt;qfile.h&gt;
  #include &lt;QTextStream&gt;
  
  
  int main(int argc, char *argv[])
  {
      QApplication a(argc, argv);
  
      QWidget *widget = new QWidget();
      QHBoxLayout *layout = new QHBoxLayout();
  
      QStringList wordList;
  
      QFile f("FlightParam.csv");
      if (f.open(QIODevice::ReadOnly))
      {
          //file opened successfully
          QString data;
          data = f.readAll();
          wordList = data.split(',');
  
          f.close();
      }
  
      QLabel *label = new QLabel("Select");
      QLineEdit *lineEdit = new QLineEdit;
      label-&gt;setBuddy(lineEdit);
  
      QCompleter *completer = new QCompleter(wordList);
      completer-&gt;setCaseSensitivity(Qt::CaseInsensitive); //Make caseInsensitive selection
  
      lineEdit-&gt;setCompleter(completer);
  
      layout-&gt;addWidget(label);
      layout-&gt;addWidget(lineEdit);
  
      widget-&gt;setLayout(layout);
      widget-&gt;showMaximized();
  
      return a.exec();
  }
  </code></pre>