QList

#include <QCoreApplication>
#include<QList>
#include<QDebug>

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    QList<int> List;
    for(int i = 0; i < 10; i++)
    {
        List.append(i);
    }


    QMutableListIterator<int> Iter(List);
    while(Iter.hasNext())
    {
        int i  = Iter.next();
        if(i == 5)
        {
            Iter.remove();
        }
    }
    Iter.toFront();
    while(Iter.hasNext())
    {
        qDebug() << Iter.next();
    }
    return a.exec();
}

  

posted @ 2016-12-17 18:40  mCat  Views(472)  Comments(0Edit  收藏  举报