#include
#include
int main() {
QList intlist;
intlist << 2 << 5 << 2 << 4 << 2;
int findings = 0;
QListIterator it(intlist);
while (it.findNext(2))
findings++;
qDebug() << findings; // output: 3
while (it.findPrevious(2))
findings--;
qDebug() << findings; // : 0
return 0;
}