vinnitu
vinnitu

Reputation: 4364

QValueList reverse iterator

How to make reverse looping for QValueList?

i found, thanks to all

QValueList<int> l;
for (int i = 0; i < 10; i++) l.append(i);
QValueListIterator<int> it = l.end(); --it;
for (; it != l.end(); --it)
{
    qDebug(QString::number(*it));
}

Upvotes: 0

Views: 872

Answers (1)

MSalters
MSalters

Reputation: 179779

The first thing you should do is change it to a QLinkedList

As it happens, the linked article shows an example of reverse looping.

Upvotes: 1

Related Questions