prefs: remap core.editor = nvim to nvim-qt
[git-cola.git] / qtpy / QtWebEngineWidgets.py
blob05a183788b4ca0f3323ec51173742e90e424bd05
1 # -----------------------------------------------------------------------------
2 # Copyright © 2014-2015 Colin Duquesnoy
3 # Copyright © 2009- The Spyder development Team
5 # Licensed under the terms of the MIT License
6 # (see LICENSE.txt for details)
7 # -----------------------------------------------------------------------------
9 """Provides QtWebEngineWidgets classes and functions."""
11 from . import (
12 PYQT5,
13 PYQT6,
14 PYSIDE2,
15 PYSIDE6,
16 QtModuleNotInstalledError,
20 # To test if we are using WebEngine or WebKit
21 # NOTE: This constant is imported by other projects (e.g. Spyder), so please
22 # don't remove it.
23 WEBENGINE = True
26 if PYQT5:
27 try:
28 from PyQt5.QtWebEngineWidgets import QWebEnginePage
29 from PyQt5.QtWebEngineWidgets import QWebEngineView
30 from PyQt5.QtWebEngineWidgets import QWebEngineSettings
31 from PyQt5.QtWebEngineWidgets import QWebEngineScript
33 # Based on the work at https://github.com/spyder-ide/qtpy/pull/203
34 from PyQt5.QtWebEngineWidgets import QWebEngineProfile
35 except ModuleNotFoundError as error:
36 raise QtModuleNotInstalledError(
37 name='QtWebEngineWidgets', missing_package='PyQtWebEngine'
38 ) from error
39 elif PYQT6:
40 try:
41 from PyQt6.QtWebEngineWidgets import *
42 from PyQt6.QtWebEngineCore import QWebEnginePage
43 from PyQt6.QtWebEngineCore import QWebEngineSettings
44 from PyQt6.QtWebEngineCore import QWebEngineProfile
45 from PyQt6.QtWebEngineCore import QWebEngineScript
46 except ModuleNotFoundError as error:
47 raise QtModuleNotInstalledError(
48 name='QtWebEngineWidgets', missing_package='PyQt6-WebEngine'
49 ) from error
50 elif PYSIDE2:
51 from PySide2.QtWebEngineWidgets import QWebEnginePage
52 from PySide2.QtWebEngineWidgets import QWebEngineView
53 from PySide2.QtWebEngineWidgets import QWebEngineSettings
54 from PySide2.QtWebEngineWidgets import QWebEngineScript
56 # Based on the work at https://github.com/spyder-ide/qtpy/pull/203
57 from PySide2.QtWebEngineWidgets import QWebEngineProfile
58 elif PYSIDE6:
59 from PySide6.QtWebEngineWidgets import *
60 from PySide6.QtWebEngineCore import QWebEnginePage
61 from PySide6.QtWebEngineCore import QWebEngineSettings
62 from PySide6.QtWebEngineCore import QWebEngineProfile
63 from PySide6.QtWebEngineCore import QWebEngineScript