1 int main1(int argc, char *argv[]) 2 { 3 QApplication a(argc, argv); 4 5 QList mylist={ 10,20,30}; 6 mylist << 100 << 200 << 300; 7 //创建容器 8 QMutableListIterator it(mylist); 9 10 //头插11 for(int i=0;i<10;i++)12 {13 it.insert(i);14 }15 16 for(it.toFront();it.hasNext();)17 {18 if(it.next()%2!=0)19 {20 it.remove();21 }22 // else23 // {24 // it.setValue(it.peekNext()*3);25 // }26 }27 for(it.toFront();it.hasNext();)28 {29 qDebug()<
::iterator it;40 for(it=mylist.begin();it!=mylist.end();it++)41 {42 qDebug()<<(*it);43 }44 }45 46 //创建只可读迭代器47 {48 QList