124 @param selected flag indicating the action (bool) |
124 @param selected flag indicating the action (bool) |
125 """ |
125 """ |
126 if not index.isValid(): |
126 if not index.isValid(): |
127 return |
127 return |
128 |
128 |
129 if selected: |
129 flags = ( |
130 flags = QItemSelectionModel.SelectionFlags( |
130 QItemSelectionModel.SelectionFlags( |
131 QItemSelectionModel.SelectionFlag.ClearAndSelect | |
131 QItemSelectionModel.SelectionFlag.ClearAndSelect | |
132 QItemSelectionModel.SelectionFlag.Rows) |
132 QItemSelectionModel.SelectionFlag.Rows) |
133 else: |
133 if selected else |
134 flags = QItemSelectionModel.SelectionFlags( |
134 QItemSelectionModel.SelectionFlags( |
135 QItemSelectionModel.SelectionFlag.Deselect | |
135 QItemSelectionModel.SelectionFlag.Deselect | |
136 QItemSelectionModel.SelectionFlag.Rows) |
136 QItemSelectionModel.SelectionFlag.Rows) |
|
137 ) |
137 self.selectionModel().select(index, flags) |
138 self.selectionModel().select(index, flags) |
138 |
139 |
139 def __createPopupMenus(self): |
140 def __createPopupMenus(self): |
140 """ |
141 """ |
141 Private method to generate the popup menus. |
142 Private method to generate the popup menus. |