13 |
13 |
14 from PyQt5.QtCore import Qt, pyqtSlot |
14 from PyQt5.QtCore import Qt, pyqtSlot |
15 from PyQt5.QtWidgets import QHeaderView, QTreeWidgetItem, QDialog |
15 from PyQt5.QtWidgets import QHeaderView, QTreeWidgetItem, QDialog |
16 |
16 |
17 from .Ui_LexerAssociationDialog import Ui_LexerAssociationDialog |
17 from .Ui_LexerAssociationDialog import Ui_LexerAssociationDialog |
18 |
|
19 from Globals import qVersionTuple |
|
20 |
18 |
21 |
19 |
22 class LexerAssociationDialog(QDialog, Ui_LexerAssociationDialog): |
20 class LexerAssociationDialog(QDialog, Ui_LexerAssociationDialog): |
23 """ |
21 """ |
24 Class implementing a dialog to enter lexer associations for the project. |
22 Class implementing a dialog to enter lexer associations for the project. |
34 self.setupUi(self) |
32 self.setupUi(self) |
35 |
33 |
36 self.editorLexerList.headerItem().setText( |
34 self.editorLexerList.headerItem().setText( |
37 self.editorLexerList.columnCount(), "") |
35 self.editorLexerList.columnCount(), "") |
38 header = self.editorLexerList.header() |
36 header = self.editorLexerList.header() |
39 if qVersionTuple() >= (5, 0, 0): |
37 header.setSectionResizeMode(QHeaderView.ResizeToContents) |
40 header.setSectionResizeMode(QHeaderView.ResizeToContents) |
|
41 else: |
|
42 header.setResizeMode(QHeaderView.ResizeToContents) |
|
43 header.setSortIndicator(0, Qt.AscendingOrder) |
38 header.setSortIndicator(0, Qt.AscendingOrder) |
44 |
39 |
45 try: |
40 try: |
46 self.extsep = os.extsep |
41 self.extsep = os.extsep |
47 except AttributeError: |
42 except AttributeError: |