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',
# 'Multimedia',
'OpenGL',
'OpenGLWidgets',
'Quick',
'QuickWidgets',
'Qml',
@ -88,6 +89,8 @@ PYQT_MODULES = (
'QtSensors',
'QtSvg',
'QtWidgets',
'QtOpenGL',
'QtOpenGLWidgets',
'QtWebEngine',
'QtWebEngineCore',
'QtWebEngineWidgets',

View File

@ -1077,6 +1077,9 @@ class Application(QApplication):
# Allow import of webengine after construction of QApplication on new
# enough PyQt
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:
self.windows_app_uid = None
if windows_app_uid: