pyproject.toml: list dependencies and optional-dependencies as dynamic
[git-cola.git] / qtpy / QtCharts.py
blob568d9c991ca32bb6aac856aa5e4c265d145e414b
1 # -----------------------------------------------------------------------------
2 # Copyright © 2019- The Spyder Development Team
4 # Licensed under the terms of the MIT License
5 # (see LICENSE.txt for details)
6 # -----------------------------------------------------------------------------
8 """Provides QtChart classes and functions."""
10 from . import (
11 PYQT5,
12 PYQT6,
13 PYSIDE2,
14 PYSIDE6,
15 QtModuleNotInstalledError,
18 if PYQT5:
19 try:
20 from PyQt5.QtChart import *
21 from PyQt5 import QtChart as QtCharts
22 except ModuleNotFoundError as error:
23 raise QtModuleNotInstalledError(
24 name='QtCharts', missing_package='PyQtChart'
25 ) from error
26 elif PYQT6:
27 try:
28 from PyQt6.QtCharts import *
29 from PyQt6 import QtCharts
30 except ModuleNotFoundError as error:
31 raise QtModuleNotInstalledError(
32 name='QtCharts', missing_package='PyQt6-Charts'
33 ) from error
34 elif PYSIDE2:
35 from PySide2.QtCharts import *
37 # https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
38 import PySide2.QtCharts as __temp
39 import inspect
41 for __name in inspect.getmembers(__temp.QtCharts):
42 globals()[__name[0]] = __name[1]
43 elif PYSIDE6:
44 from PySide6.QtCharts import *
45 from PySide6 import QtCharts