Q:

Get current item from QMutableListIterator

I can't dereference a QMutableListIterator like an STL iterator - with *it.
I'm trying to use QMutableListIterator::value() but my program crashes. What is the right way to do this?
QFileInfoList files;
// populate list
QListIterator<QFileInfo> it(files);
it.toFront();
QFileInfo = it_top.value();
// crash

The error is 
ASSERT: "item_exists()" in file /usr/include/qt4/QtCore/qlist.h, line 778

Thanks

A:

I just checked the Qt documentation for "toFront" and it says:

Moves the iterator to the front of the
  container (before the first item).

http://doc.trolltech.com/latest/qmutablelistiterator.html#toFront
The Qt Iterators are Java-style iterators which start before the items and end on the last item, the C++ style iterators begin on the first item and end after the last one.

