DataViews/CodeMetricsDialog.py

changeset 2094
88620e11c67c
parent 1640
1699d46026cd
child 2223
054c285dab38
--- a/DataViews/CodeMetricsDialog.py	Wed Oct 03 13:20:57 2012 +0200
+++ b/DataViews/CodeMetricsDialog.py	Wed Oct 03 15:36:41 2012 +0200
@@ -10,7 +10,7 @@
 import os
 import fnmatch
 
-from PyQt4.QtCore import pyqtSlot, Qt, QLocale
+from PyQt4.QtCore import pyqtSlot, Qt, QLocale, qVersion
 from PyQt4.QtGui import QDialog, QDialogButtonBox, QMenu, QHeaderView, QTreeWidgetItem, \
     QApplication
 
@@ -225,8 +225,12 @@
         self.buttonBox.button(QDialogButtonBox.Cancel).setEnabled(False)
         self.buttonBox.button(QDialogButtonBox.Close).setDefault(True)
         
-        self.resultList.header().setResizeMode(QHeaderView.Interactive)
-        self.summaryList.header().setResizeMode(QHeaderView.Interactive)
+        if qVersion() >= "5.0.0":
+            self.resultList.header().setSectionResizeMode(QHeaderView.Interactive)
+            self.summaryList.header().setSectionResizeMode(QHeaderView.Interactive)
+        else:
+            self.resultList.header().setResizeMode(QHeaderView.Interactive)
+            self.summaryList.header().setResizeMode(QHeaderView.Interactive)
         
     def on_buttonBox_clicked(self, button):
         """

eric ide

mercurial