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);
+ }
+ }
}
}