#include "mainwindow.h" #include <QApplication> #include <QDebug> int main(int argc, char *argv[]) { QString str = "Welcome to you "; qDebug() << str; QApplication a(argc, argv); QList<int> list;//创建一个空的列表list QMutableListIterator<int> i(list);//创建上述列表的读写迭代器 for (int j = 0; j < 10; ++j) i.insert(j); for (i.toFront();i.hasNext();) qDebug() << i.next(); for (i.toBack();i.hasPrevious();) qDebug() << i.previous(); //MainWindow w; //w.show(); return a.exec(); }
运行结果如下
"Welcome to you " 0 1 2 3 4 5 6 7 8 9 9 8 7 6 5 4 3 2 1 0