Allow usage of webengine in main calibre process

This commit is contained in:
Kovid Goyal 2022-03-16 06:57:30 +05:30
parent 5fe9010e74
commit 51f5dcb678
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -926,6 +926,9 @@ class Application(QApplication):
def __init__(self, args, force_calibre_style=False, override_program_name=None, headless=False, color_prefs=gprefs, windows_app_uid=None): def __init__(self, args, force_calibre_style=False, override_program_name=None, headless=False, color_prefs=gprefs, windows_app_uid=None):
self.ignore_palette_changes = False self.ignore_palette_changes = False
QNetworkProxyFactory.setUseSystemConfiguration(True) QNetworkProxyFactory.setUseSystemConfiguration(True)
# Allow import of webengine after construction of QApplication on new
# enough PyQt
QApplication.setAttribute(Qt.ApplicationAttribute.AA_ShareOpenGLContexts)
if iswindows: if iswindows:
self.windows_app_uid = None self.windows_app_uid = None
if windows_app_uid: if windows_app_uid: