Preferences/ConfigurationPages/EditorHighlightersPage.py

changeset 2094
88620e11c67c
parent 1509
c0b5e693b0eb
child 2302
f29e9405c851
--- a/Preferences/ConfigurationPages/EditorHighlightersPage.py	Wed Oct 03 13:20:57 2012 +0200
+++ b/Preferences/ConfigurationPages/EditorHighlightersPage.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
 
 from .ConfigurationPageBase import ConfigurationPageBase
@@ -36,7 +36,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