Project/LexerAssociationDialog.py

changeset 2094
88620e11c67c
parent 1509
c0b5e693b0eb
child 2302
f29e9405c851
diff -r d23ab571d2b9 -r 88620e11c67c Project/LexerAssociationDialog.py
--- a/Project/LexerAssociationDialog.py	Wed Oct 03 13:20:57 2012 +0200
+++ b/Project/LexerAssociationDialog.py	Wed Oct 03 15:36:41 2012 +0200
@@ -11,7 +11,7 @@
 
 from pygments.lexers import get_all_lexers
 
-from PyQt4.QtCore import Qt, pyqtSlot
+from PyQt4.QtCore import Qt, pyqtSlot, qVersion
 from PyQt4.QtGui import QHeaderView, QTreeWidgetItem, QDialog
 
 import QScintilla.Lexers
@@ -35,7 +35,10 @@
 
         self.editorLexerList.headerItem().setText(self.editorLexerList.columnCount(), "")
         header = self.editorLexerList.header()
-        header.setResizeMode(QHeaderView.ResizeToContents)
+        if qVersion() >= "5.0.0":
+            header.setSectionResizeMode(QHeaderView.ResizeToContents)
+        else:
+            header.setResizeMode(QHeaderView.ResizeToContents)
         header.setSortIndicator(0, Qt.AscendingOrder)
         
         try:

eric ide

mercurial