Hi,
I use the selectedItems() function to get the actual selected items to remove them.
The problem is if you have a tree like that :

A
-B
--C

You select A then B then C and then delete, since a for loop is used that delete A then B and C of the for loop are not valid and I got a crash.
Qt Code:
  1. void CMainEditorWindow::Delete()
  2. {
  3. // Get the selected items.
  4. QList< QTreeWidgetItem* > SelectedItems = SceneOutlinerWidget->GetSelectedItems();
  5.  
  6. // Delete each actor.
  7. foreach( QTreeWidgetItem* Item, SelectedItems )
  8. {
  9. CSceneOutlinerItem* SceneOutlinerItem = static_cast< CSceneOutlinerItem* >( Item );
  10. MainEditorUndoStack->push( new CUndoCommandDeleteActor( SceneOutlinerItem->GetUniqueID() ) );
  11. }
  12. }
To copy to clipboard, switch view to plain text mode 
Is it possible to have selected items but remove item found in children of other or that needs to be implemented in a recursive function manually ?
Thanks for the help