Merge pull request #1385 from davvid/bindir
[git-cola.git] / qtpy / QtCharts.py
blob81716b0fc3df01cd46c1f797e5e4e19d002c47a1
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 import QtChart as QtCharts
21 from PyQt5.QtChart import *
22 except ModuleNotFoundError as error:
23 raise QtModuleNotInstalledError(
24 name="QtCharts",
25 missing_package="PyQtChart",
26 ) from error
27 elif PYQT6:
28 try:
29 from PyQt6 import QtCharts
30 from PyQt6.QtCharts import *
31 except ModuleNotFoundError as error:
32 raise QtModuleNotInstalledError(
33 name="QtCharts",
34 missing_package="PyQt6-Charts",
35 ) from error
36 elif PYSIDE2:
37 import inspect
39 # https://bugreports.qt.io/projects/PYSIDE/issues/PYSIDE-1026
40 import PySide2.QtCharts as __temp
41 from PySide2.QtCharts import *
43 for __name in inspect.getmembers(__temp.QtCharts):
44 globals()[__name[0]] = __name[1]
45 elif PYSIDE6:
46 from PySide6 import QtCharts
47 from PySide6.QtCharts import *