STL-Style Iterators : QStringList « Qt « C++






STL-Style Iterators

  


#include <QtCore>
#include <QDebug>

using namespace std;

int main() {
  QStringList list;
  list << "dog" << "cat" << "mouse";
  QStringList::iterator it;
  for (it = list.begin(); it != list.end(); ++it)
  {
    qDebug() << *it << endl;
  }
  return 0;
}

   
    
  








Related examples in the same category

1.Adding QStringList to QListWidget
2.A simple model that uses a QStringList as its data source
3.Complete demo for QStringList
4.Split QStringList
5.QStringList demo
6.Quick sort QStringList
7.Search in a list of fruit names first for the word Pear and then for Orange
8.using QStringList, append to and output and join