36 not self.selectionModel().hasSelection(): |
36 not self.selectionModel().hasSelection(): |
37 # no models available or nothing selected |
37 # no models available or nothing selected |
38 return |
38 return |
39 |
39 |
40 selectedRows = self.selectionModel().selectedRows() |
40 selectedRows = self.selectionModel().selectedRows() |
41 for idx in reversed(selectedRows): |
41 for idx in reversed(sorted(selectedRows)): |
42 self.model().removeRow(idx.row(), idx.parent()) |
42 self.model().removeRow(idx.row(), idx.parent()) |
43 |
43 |
44 def removeAll(self): |
44 def removeAll(self): |
45 """ |
45 """ |
46 Public method to clear the view. |
46 Public method to clear the view. |