]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
PRECOS issue 0000552: Highlighting objects in 2D view
authorouv <ouv@opencascade.com>
Tue, 5 Jul 2011 08:04:31 +0000 (08:04 +0000)
committerouv <ouv@opencascade.com>
Tue, 5 Jul 2011 08:04:31 +0000 (08:04 +0000)
src/GraphicsView/GraphicsView_ViewPort.cxx

index f7d995c3847f0c17a440186ac494c0ad894b6b29..6a91d58a38c2ce6b94a58ca22345e6662635da65 100644 (file)
@@ -259,8 +259,9 @@ GraphicsView_ObjectList GraphicsView_ViewPort::getObjects( bool theIsSortSelecte
 {
   GraphicsView_ObjectList aList;
   QListIterator<QGraphicsItem*> anIter( items() );
-  while( anIter.hasNext() )
-    if( GraphicsView_Object* anObject = dynamic_cast<GraphicsView_Object*>( anIter.next() ) )
+  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() ) )
     {
       if( theIsSortSelected && anObject->isSelected() )
         aList.prepend( anObject ); // put the selected objects to a head of the list