5 |
5 |
6 """ |
6 """ |
7 Module implementing the variables viewer widget. |
7 Module implementing the variables viewer widget. |
8 """ |
8 """ |
9 |
9 |
10 from PyQt4.QtCore import Qt, QRegExp |
10 from PyQt4.QtCore import Qt, QRegExp, qVersion |
11 from PyQt4.QtGui import QTreeWidget, QTreeWidgetItem, QApplication, QAbstractItemView, \ |
11 from PyQt4.QtGui import QTreeWidget, QTreeWidgetItem, QApplication, QAbstractItemView, \ |
12 QMenu |
12 QMenu |
13 |
13 |
14 from E5Gui.E5Application import e5App |
14 from E5Gui.E5Application import e5App |
15 |
15 |
305 )) |
305 )) |
306 |
306 |
307 header = self.header() |
307 header = self.header() |
308 header.setSortIndicator(0, Qt.AscendingOrder) |
308 header.setSortIndicator(0, Qt.AscendingOrder) |
309 header.setSortIndicatorShown(True) |
309 header.setSortIndicatorShown(True) |
310 header.setClickable(True) |
310 if qVersion() >= "5.0.0": |
|
311 header.setSectionsClickable(True) |
|
312 else: |
|
313 header.setClickable(True) |
311 header.resizeSection(0, 120) # variable column |
314 header.resizeSection(0, 120) # variable column |
312 header.resizeSection(1, 150) # value column |
315 header.resizeSection(1, 150) # value column |
313 |
316 |
314 self.__createPopupMenus() |
317 self.__createPopupMenus() |
315 self.setContextMenuPolicy(Qt.CustomContextMenu) |
318 self.setContextMenuPolicy(Qt.CustomContextMenu) |