title: Qt C++ How to use QList< >::const_iterator?
body: <p>I am iterating through a list and i want to use const_iterator. But i don't know how to do that! Until now i used iterator and i implemented my function this way. Can anyone help me to use const_iterator?</p>
  
  <pre><code>void MainWindow::populate(const QList&lt;Vehicle&gt; &amp;vehicles)
  {
  int j = 0;
  QListIterator&lt;Vehicle&gt; iter(vehicles);    
  while(iter.hasNext()){
      Vehicle car = iter.next();
      //set car
      QString makeAndModel = car.getGeneralData().getMake() + car.getGeneralData().getModel();
      QStandardItem *mAndM = new QStandardItem(QString(makeAndModel));
      mAndM-&gt;setEditable(false);
      model-&gt;setItem(j,0,mAndM);
  
      //set type
      QStandardItem *type = new QStandardItem(QString(car.getGeneralData().getType()));
      type-&gt;setEditable(false);
      model-&gt;setItem(j,1,type);
  
      //set mileage
      QString mileageString = QString::number(car.getGeneralData().getMileage());
      QStandardItem *mileage = new QStandardItem(QString(mileageString));
      mileage-&gt;setEditable(false);
      model-&gt;setItem(j,2,mileage);
  
      //set year
      QString yearString = QString::number(car.getGeneralData().getYear());
      QStandardItem *year = new QStandardItem(QString(yearString));
      year-&gt;setEditable(false);
      model-&gt;setItem(j,3,year);
  
      //set registration
      QString regString = VehicleHelper::convertBoolToString(car.getRegistration().isRegistered());
      QStandardItem *regDate = new QStandardItem(QString(regString));
      regDate-&gt;setEditable(false);
      model-&gt;setItem(j,4,regDate);
      j++;
     }
   }
  </code></pre>