#include <QCoreApplication>
#include <QDebug>//QListIterator
void printList()
{QList<int> list;list<<1<<2<<3<<4<<5;QListIterator<int> i(list);qDebug()<<"正序打印....";//正序打印for(;i.hasNext();)qDebug()<<i.next();//倒序打印qDebug()<<"倒序打印....";i.toBack();for(;i.hasPrevious();)qDebug()<<i.previous();
}void mutableList(){QList<int> list;qDebug()<<"插入列表数据0-9:";QMutableListIterator<int> i(list);//创建迭代器for(int j=0;j<10;j++)i.insert(j);for(i.toFront();i.hasNext();)qDebug()<<i.next();qDebug()<<"偶数删除,奇数乘以10:";//偶数删除,奇数乘以10:for(i.toBack();i.hasPrevious();){if(i.previous()%2==0){i.remove();}else{i.setVal