]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Clear selection before setting new one qtviewer_on_v9.12
authorCHEMIN Sébastien 236498 <sc236498@is245491.intra.cea.fr>
Mon, 3 Jun 2024 08:48:39 +0000 (10:48 +0200)
committerCHEMIN Sébastien 236498 <sc236498@is245491.intra.cea.fr>
Mon, 3 Jun 2024 08:48:39 +0000 (10:48 +0200)
src/LightApp/LightApp_QTVSelector.cxx

index 4c6554a30c3b212999736f80618437954de6f8d1..f6f54e47b3afdba5a2a836fc079b657ee2049bb1 100644 (file)
@@ -78,15 +78,16 @@ void LightApp_QTVSelector::setSelection( const SUIT_DataOwnerPtrList& theList)
   
   if( QtViewer_ViewPort* aViewport = myViewer->getActiveViewPort() )
     {
-    foreach (QGraphicsItem *item, aViewport->items())
-      { 
-        if (QtViewer_Object* obj = dynamic_cast<QtViewer_Object*>(item))
-          {
-            LightApp_DataOwner* owner = dynamic_cast<LightApp_DataOwner*>( obj->owner() );
-            bool sel = owner && aSelected.contains(owner->entry());
-            obj->setSelected(sel);
-          }
-      }
+      aViewport->scene()->clearSelection();
+      foreach (QGraphicsItem *item, aViewport->items())
+        {
+          if (QtViewer_Object* obj = dynamic_cast<QtViewer_Object*>(item))
+            {
+              LightApp_DataOwner* owner = dynamic_cast<LightApp_DataOwner*>( obj->owner() );
+              bool sel = owner && aSelected.contains(owner->entry());
+              obj->setSelected(sel);
+            }
+       }
    }
 }