Project/LexerAssociationDialog.py

changeset 5736
000ea446ff4b
parent 5616
adcffadf4962
child 6048
82ad8ec9548c
equal deleted inserted replaced
5735:f606dbe20be6 5736:000ea446ff4b
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

eric ide

mercurial