Corrected some place to import QtCharts instead of QtChart. eric7

Fri, 21 May 2021 17:48:17 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 21 May 2021 17:48:17 +0200
branch
eric7
changeset 8343
242d5dae2937
parent 8342
0613a64f1b64
child 8344
7ce014e02cfb

Corrected some place to import QtCharts instead of QtChart.

eric7/MicroPython/MicroPythonGraphWidget.py file | annotate | diff | comparison | revisions
eric7/MicroPython/MicroPythonWidget.py file | annotate | diff | comparison | revisions
eric7/Preferences/ConfigurationPages/MicroPythonPage.py file | annotate | diff | comparison | revisions
eric7/QScintilla/Lexers/LexerPython.py file | annotate | diff | comparison | revisions
eric7/UI/UserInterface.py file | annotate | diff | comparison | revisions
scripts/install.py file | annotate | diff | comparison | revisions
--- a/eric7/MicroPython/MicroPythonGraphWidget.py	Fri May 21 17:45:47 2021 +0200
+++ b/eric7/MicroPython/MicroPythonGraphWidget.py	Fri May 21 17:48:17 2021 +0200
@@ -20,7 +20,7 @@
     QWidget, QHBoxLayout, QVBoxLayout, QToolButton, QSizePolicy, QSpacerItem,
     QLabel, QSpinBox
 )
-from PyQt6.QtChart import QChartView, QChart, QLineSeries, QValueAxis
+from PyQt6.QtCharts import QChartView, QChart, QLineSeries, QValueAxis
 
 from E5Gui import E5MessageBox
 from E5Gui.E5Application import e5App
--- a/eric7/MicroPython/MicroPythonWidget.py	Fri May 21 17:45:47 2021 +0200
+++ b/eric7/MicroPython/MicroPythonWidget.py	Fri May 21 17:48:17 2021 +0200
@@ -1166,7 +1166,7 @@
         @type bool
         """
         if not HAS_QTCHART:
-            # QtChart not available => fail silently
+            # QtCharts not available => fail silently
             return
         
         if not self.__device:
--- a/eric7/Preferences/ConfigurationPages/MicroPythonPage.py	Fri May 21 17:45:47 2021 +0200
+++ b/eric7/Preferences/ConfigurationPages/MicroPythonPage.py	Fri May 21 17:48:17 2021 +0200
@@ -39,7 +39,7 @@
         
         # populate the chart theme combobox
         try:
-            from PyQt6.QtChart import QChart
+            from PyQt6.QtCharts import QChart
             
             self.chartThemeComboBox.addItem(
                 self.tr("Automatic"), -1)
--- a/eric7/QScintilla/Lexers/LexerPython.py	Fri May 21 17:45:47 2021 +0200
+++ b/eric7/QScintilla/Lexers/LexerPython.py	Fri May 21 17:48:17 2021 +0200
@@ -91,13 +91,14 @@
                     "Description": self.tr("PyQt5/6 Modules"),
                     "Words": """
  PyQt5 PyQt6 Qsci Qt Qt3DAnimation Qt3DCore Qt3DExtras Qt3DInput Qt3DLogic
- Qt3DRender QtBluetooth QtChart QtCore QtDataVisualization QtDBus QtDesigner
- QtGui QtHelp QtLocation QtMacExtras QtMultimedia QtMultimediaWidgets QtNetwork
- QtNetworkAuth QtNfc QtOpenGL QtOpenGLWidgets QtPositioning QtPrintSupport
- QtPurchasing QtQml QtQuick QtQuick3D QtQuickWidgets QtRemoteObjects QtSensors
- QtSerialPort QtSql QtSvg QtSvgWidgets QtTest QtTextToSpeech QtWebChannel
- QtWebEngine QtWebEngineCore QtWebEngineWidgets QtWebSockets QtWidgets
- QtWinExtras QtX11Extras QtXml QtXmlPatterns sip""",
+ Qt3DRender QtBluetooth QtChart QtCharts QtCore QtDataVisualization QtDBus
+ QtDesigner QtGui QtHelp QtLocation QtMacExtras QtMultimedia
+ QtMultimediaWidgets QtNetwork QtNetworkAuth QtNfc QtOpenGL QtOpenGLWidgets
+ QtPositioning QtPrintSupport QtPurchasing QtQml QtQuick QtQuick3D
+ QtQuickWidgets QtRemoteObjects QtSensors QtSerialPort QtSql QtSvg QtSvgWidgets
+ QtTest QtTextToSpeech QtWebChannel QtWebEngine QtWebEngineCore
+ QtWebEngineWidgets QtWebSockets QtWidgets QtWinExtras QtX11Extras QtXml
+ QtXmlPatterns sip""",
                     "Style": {
                         "fore": 0x44AADD,
                         "font_bold": True,
--- a/eric7/UI/UserInterface.py	Fri May 21 17:45:47 2021 +0200
+++ b/eric7/UI/UserInterface.py	Fri May 21 17:48:17 2021 +0200
@@ -3753,20 +3753,20 @@
             """<tr><td><b>Qt</b></td><td>{0}</td></tr>"""
         ).format(qVersion())
         versionText += (
-            """<tr><td><b>PyQt</b></td><td>{0}</td></tr>"""
+            """<tr><td><b>PyQt6</b></td><td>{0}</td></tr>"""
         ).format(PYQT_VERSION_STR)
         with contextlib.suppress(ImportError, AttributeError):
-            from PyQt6 import QtChart
+            from PyQt6 import QtCharts
             versionText += (
-                """<tr><td><b>PyQtChart</b></td><td>{0}</td></tr>"""
-            ).format(QtChart.PYQT_CHART_VERSION_STR)
+                """<tr><td><b>PyQt6-Charts</b></td><td>{0}</td></tr>"""
+            ).format(QtCharts.PYQT_CHART_VERSION_STR)
         with contextlib.suppress(ImportError, AttributeError):
             from PyQt6 import QtWebEngine
             versionText += (
-                """<tr><td><b>PyQtWebEngine</b></td><td>{0}</td></tr>"""
+                """<tr><td><b>PyQt6-WebEngine</b></td><td>{0}</td></tr>"""
             ).format(QtWebEngine.PYQT_WEBENGINE_VERSION_STR)
         versionText += (
-            """<tr><td><b>QScintilla</b></td><td>{0}</td></tr>"""
+            """<tr><td><b>PyQt6-QScintilla</b></td><td>{0}</td></tr>"""
         ).format(QSCINTILLA_VERSION_STR)
         versionText += (
             """<tr><td><b>sip</b></td><td>{0}</td></tr>"""
--- a/scripts/install.py	Fri May 21 17:45:47 2021 +0200
+++ b/scripts/install.py	Fri May 21 17:48:17 2021 +0200
@@ -1502,9 +1502,10 @@
         else:
             pipInstall(
                 "PyQt6-Charts>=6.1.0",
-                "Optional 'PyQtChart' could not be detected.\n"
+                "Optional 'PyQt6-Charts' could not be detected.\n"
                 "Error: {0}".format(msg)
             )
+    print("Found PyQt6-Charts")
     
     try:
         from PyQt6 import Qsci      # __IGNORE_WARNING__
@@ -1714,8 +1715,10 @@
                 exit(5)
     
     # print version info for additional modules
+    # TODO: add info about QtSerialPort once PyQt 6.2.0/Qt 6.2.0 is released
+    #       (only if that is a separate package)
     with contextlib.suppress(NameError, AttributeError):
-        print("PyQt6-Chart:", QtCharts.PYQT_CHART_VERSION_STR)
+        print("PyQt6-Charts:", QtCharts.PYQT_CHART_VERSION_STR)
     
     with contextlib.suppress(ImportError, AttributeError):
         from PyQt6 import QtWebEngine

eric ide

mercurial