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, QDialog |
15 from PyQt4.QtGui import QHeaderView, QTreeWidgetItem, QDialog |
16 |
16 |
17 import QScintilla.Lexers |
17 import QScintilla.Lexers |
18 |
18 |
19 from .Ui_LexerAssociationDialog import Ui_LexerAssociationDialog |
19 from .Ui_LexerAssociationDialog import Ui_LexerAssociationDialog |
33 super().__init__(parent) |
33 super().__init__(parent) |
34 self.setupUi(self) |
34 self.setupUi(self) |
35 |
35 |
36 self.editorLexerList.headerItem().setText(self.editorLexerList.columnCount(), "") |
36 self.editorLexerList.headerItem().setText(self.editorLexerList.columnCount(), "") |
37 header = self.editorLexerList.header() |
37 header = self.editorLexerList.header() |
38 header.setResizeMode(QHeaderView.ResizeToContents) |
38 if qVersion() >= "5.0.0": |
|
39 header.setSectionResizeMode(QHeaderView.ResizeToContents) |
|
40 else: |
|
41 header.setResizeMode(QHeaderView.ResizeToContents) |
39 header.setSortIndicator(0, Qt.AscendingOrder) |
42 header.setSortIndicator(0, Qt.AscendingOrder) |
40 |
43 |
41 try: |
44 try: |
42 self.extsep = os.extsep |
45 self.extsep = os.extsep |
43 except AttributeError: |
46 except AttributeError: |