Allow using QtWebEngine in the main calibre application as well

This commit is contained in:
Kovid Goyal 2022-08-10 21:07:29 +05:30
parent 53a44ce034
commit d73fef560e
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 0 deletions

View File

@ -34,6 +34,7 @@ dlls = [
'Widgets', 'Widgets',
# 'Multimedia', # 'Multimedia',
'OpenGL', 'OpenGL',
'OpenGLWidgets',
'Quick', 'Quick',
'QuickWidgets', 'QuickWidgets',
'Qml', 'Qml',
@ -88,6 +89,8 @@ PYQT_MODULES = (
'QtSensors', 'QtSensors',
'QtSvg', 'QtSvg',
'QtWidgets', 'QtWidgets',
'QtOpenGL',
'QtOpenGLWidgets',
'QtWebEngine', 'QtWebEngine',
'QtWebEngineCore', 'QtWebEngineCore',
'QtWebEngineWidgets', 'QtWebEngineWidgets',

View File

@ -1077,6 +1077,9 @@ class Application(QApplication):
# Allow import of webengine after construction of QApplication on new # Allow import of webengine after construction of QApplication on new
# enough PyQt # enough PyQt
QApplication.setAttribute(Qt.ApplicationAttribute.AA_ShareOpenGLContexts) QApplication.setAttribute(Qt.ApplicationAttribute.AA_ShareOpenGLContexts)
# this import is needed to have Qt call qt_registerDefaultPlatformBackingStoreOpenGLSupport
from qt.core import QOpenGLWidget
del QOpenGLWidget
if iswindows: if iswindows:
self.windows_app_uid = None self.windows_app_uid = None
if windows_app_uid: if windows_app_uid: