5 |
5 |
6 """ |
6 """ |
7 Module implementing the watch expression viewer widget. |
7 Module implementing the watch expression viewer widget. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt5.QtCore import ( |
10 from PyQt6.QtCore import ( |
11 Qt, QModelIndex, QItemSelectionModel, QSortFilterProxyModel |
11 Qt, QModelIndex, QItemSelectionModel, QSortFilterProxyModel |
12 ) |
12 ) |
13 from PyQt5.QtWidgets import ( |
13 from PyQt6.QtWidgets import ( |
14 QTreeView, QAbstractItemView, QMenu, QHeaderView, QDialog |
14 QTreeView, QAbstractItemView, QMenu, QHeaderView, QDialog |
15 ) |
15 ) |
16 |
16 |
17 from E5Gui.E5Application import e5App |
17 from E5Gui.E5Application import e5App |
18 from E5Gui import E5MessageBox |
18 from E5Gui import E5MessageBox |
125 """ |
125 """ |
126 if not index.isValid(): |
126 if not index.isValid(): |
127 return |
127 return |
128 |
128 |
129 flags = ( |
129 flags = ( |
130 QItemSelectionModel.SelectionFlags( |
130 (QItemSelectionModel.SelectionFlag.ClearAndSelect | |
131 QItemSelectionModel.SelectionFlag.ClearAndSelect | |
131 QItemSelectionModel.SelectionFlag.Rows) |
132 QItemSelectionModel.SelectionFlag.Rows) |
|
133 if selected else |
132 if selected else |
134 QItemSelectionModel.SelectionFlags( |
133 (QItemSelectionModel.SelectionFlag.Deselect | |
135 QItemSelectionModel.SelectionFlag.Deselect | |
134 QItemSelectionModel.SelectionFlag.Rows) |
136 QItemSelectionModel.SelectionFlag.Rows) |
|
137 ) |
135 ) |
138 self.selectionModel().select(index, flags) |
136 self.selectionModel().select(index, flags) |
139 |
137 |
140 def __createPopupMenus(self): |
138 def __createPopupMenus(self): |
141 """ |
139 """ |