eric6/MicroPython/MicroPythonGraphWidget.py

changeset 8143
2c730d5fd177
parent 8067
a467ab075be0
child 8218
7c09585bd960
--- a/eric6/MicroPython/MicroPythonGraphWidget.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/MicroPython/MicroPythonGraphWidget.py	Tue Mar 02 17:17:09 2021 +0100
@@ -51,7 +51,7 @@
         
         self.__chartView = QChartView(self)
         self.__chartView.setSizePolicy(
-            QSizePolicy.Expanding, QSizePolicy.Expanding)
+            QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Expanding)
         self.__layout.addWidget(self.__chartView)
         
         self.__verticalLayout = QVBoxLayout()
@@ -63,15 +63,17 @@
         self.__saveButton.setToolTip(self.tr("Press to save the raw data"))
         self.__saveButton.clicked.connect(self.on_saveButton_clicked)
         self.__verticalLayout.addWidget(self.__saveButton)
-        self.__verticalLayout.setAlignment(self.__saveButton, Qt.AlignHCenter)
+        self.__verticalLayout.setAlignment(self.__saveButton,
+                                           Qt.AlignmentFlag.AlignHCenter)
         
-        spacerItem = QSpacerItem(20, 20, QSizePolicy.Minimum,
-                                 QSizePolicy.Expanding)
+        spacerItem = QSpacerItem(20, 20, QSizePolicy.Policy.Minimum,
+                                 QSizePolicy.Policy.Expanding)
         self.__verticalLayout.addItem(spacerItem)
         
         label = QLabel(self.tr("max. X:"))
         self.__verticalLayout.addWidget(label)
-        self.__verticalLayout.setAlignment(label, Qt.AlignHCenter)
+        self.__verticalLayout.setAlignment(label,
+                                           Qt.AlignmentFlag.AlignHCenter)
         
         self.__maxX = 100
         self.__maxXSpinBox = QSpinBox()
@@ -81,7 +83,7 @@
         self.__maxXSpinBox.setToolTip(self.tr(
             "Enter the maximum number of data points to be plotted."))
         self.__maxXSpinBox.setValue(self.__maxX)
-        self.__maxXSpinBox.setAlignment(Qt.AlignRight)
+        self.__maxXSpinBox.setAlignment(Qt.AlignmentFlag.AlignRight)
         self.__verticalLayout.addWidget(self.__maxXSpinBox)
         
         # holds the data to be checked for plotable data
@@ -112,7 +114,7 @@
         self.__chart.setAxisX(self.__axisX, self.__series[0])
         self.__chart.setAxisY(self.__axisY, self.__series[0])
         self.__chartView.setChart(self.__chart)
-        self.__chartView.setRenderHint(QPainter.Antialiasing)
+        self.__chartView.setRenderHint(QPainter.RenderHint.Antialiasing)
         self.preferencesChanged()
         
         self.__maxXSpinBox.valueChanged.connect(self.__handleMaxXChanged)
@@ -127,9 +129,9 @@
             # automatic selection of light or dark depending on desktop
             # color scheme
             if e5App().usesDarkPalette():
-                self.__chart.setTheme(QChart.ChartThemeDark)
+                self.__chart.setTheme(QChart.ChartTheme.ChartThemeDark)
             else:
-                self.__chart.setTheme(QChart.ChartThemeLight)
+                self.__chart.setTheme(QChart.ChartTheme.ChartThemeLight)
         else:
             self.__chart.setTheme(chartColorTheme)
     

eric ide

mercurial