{
GraphicsView_ObjectList aList;
QListIterator<QGraphicsItem*> anIter( items() );
- anIter.toBack(); // objects created later should be put to the result list first
- while( anIter.hasPrevious() )
- if( GraphicsView_Object* anObject = dynamic_cast<GraphicsView_Object*>( anIter.previous() ) )
+ while( anIter.hasNext() )
+ if( GraphicsView_Object* anObject = dynamic_cast<GraphicsView_Object*>( anIter.next() ) )
{
if( theIsSortSelected && anObject->isSelected() )
aList.prepend( anObject ); // put the selected objects to a head of the list