9 |
9 |
10 import os |
10 import os |
11 |
11 |
12 from pygments.lexers import get_all_lexers |
12 from pygments.lexers import get_all_lexers |
13 |
13 |
14 from PyQt4.QtCore import Qt, pyqtSlot |
14 from PyQt4.QtCore import Qt, pyqtSlot, qVersion |
15 from PyQt4.QtGui import QHeaderView, QTreeWidgetItem |
15 from PyQt4.QtGui import QHeaderView, QTreeWidgetItem |
16 |
16 |
17 from .ConfigurationPageBase import ConfigurationPageBase |
17 from .ConfigurationPageBase import ConfigurationPageBase |
18 from .Ui_EditorHighlightersPage import Ui_EditorHighlightersPage |
18 from .Ui_EditorHighlightersPage import Ui_EditorHighlightersPage |
19 |
19 |
34 self.setupUi(self) |
34 self.setupUi(self) |
35 self.setObjectName("EditorHighlightersPage") |
35 self.setObjectName("EditorHighlightersPage") |
36 |
36 |
37 self.editorLexerList.headerItem().setText(self.editorLexerList.columnCount(), "") |
37 self.editorLexerList.headerItem().setText(self.editorLexerList.columnCount(), "") |
38 header = self.editorLexerList.header() |
38 header = self.editorLexerList.header() |
39 header.setResizeMode(QHeaderView.ResizeToContents) |
39 if qVersion() >= "5.0.0": |
|
40 header.setSectionResizeMode(QHeaderView.ResizeToContents) |
|
41 else: |
|
42 header.setResizeMode(QHeaderView.ResizeToContents) |
40 header.setSortIndicator(0, Qt.AscendingOrder) |
43 header.setSortIndicator(0, Qt.AscendingOrder) |
41 |
44 |
42 try: |
45 try: |
43 self.extsep = os.extsep |
46 self.extsep = os.extsep |
44 except AttributeError: |
47 except AttributeError: |