diff --git a/qtpy/QtCharts.py b/qtpy/QtCharts.py index b041b0cd..164be471 100644 --- a/qtpy/QtCharts.py +++ b/qtpy/QtCharts.py @@ -12,6 +12,7 @@ if PYQT5: try: from PyQt5.QtChart import * + from PyQt5 import QtChart as QtCharts except ImportError as error: raise PythonQtError( 'The QtChart module was not found. ' @@ -20,6 +21,7 @@ elif PYQT6: try: from PyQt6.QtCharts import * + from PyQt6 import QtCharts except ImportError as error: raise PythonQtError( 'The QtCharts module was not found. ' @@ -27,7 +29,9 @@ ) from error elif PYSIDE6: from PySide6.QtCharts import * + from PySide6 import QtCharts elif PYSIDE2: + from PySide2.QtCharts import * # https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026 import PySide2.QtCharts as __temp import inspect diff --git a/qtpy/tests/test_qtcharts.py b/qtpy/tests/test_qtcharts.py index 1c7ed425..0531b169 100644 --- a/qtpy/tests/test_qtcharts.py +++ b/qtpy/tests/test_qtcharts.py @@ -8,3 +8,4 @@ def test_qtcharts(): """Test the qtpy.QtCharts namespace""" from qtpy import QtCharts assert QtCharts.QChart is not None + assert QtCharts.QtCharts.QChart is not None