9 |
9 |
10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 |
11 |
12 import os |
12 import os |
13 |
13 |
14 from PyQt5.QtCore import Qt, pyqtSlot, qVersion |
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 |
18 |
20 |
19 |
21 |
20 class LexerAssociationDialog(QDialog, Ui_LexerAssociationDialog): |
22 class LexerAssociationDialog(QDialog, Ui_LexerAssociationDialog): |
21 """ |
23 """ |
22 Class implementing a dialog to enter lexer associations for the project. |
24 Class implementing a dialog to enter lexer associations for the project. |
32 self.setupUi(self) |
34 self.setupUi(self) |
33 |
35 |
34 self.editorLexerList.headerItem().setText( |
36 self.editorLexerList.headerItem().setText( |
35 self.editorLexerList.columnCount(), "") |
37 self.editorLexerList.columnCount(), "") |
36 header = self.editorLexerList.header() |
38 header = self.editorLexerList.header() |
37 if qVersion() >= "5.0.0": |
39 if qVersionTuple() >= (5, 0, 0): |
38 header.setSectionResizeMode(QHeaderView.ResizeToContents) |
40 header.setSectionResizeMode(QHeaderView.ResizeToContents) |
39 else: |
41 else: |
40 header.setResizeMode(QHeaderView.ResizeToContents) |
42 header.setResizeMode(QHeaderView.ResizeToContents) |
41 header.setSortIndicator(0, Qt.AscendingOrder) |
43 header.setSortIndicator(0, Qt.AscendingOrder) |
42 |
44 |