Allow using webengine after QApplication construction when using ensure_app as well

This commit is contained in:
Kovid Goyal 2022-07-17 14:58:42 +05:30
parent 6fd08f10af
commit 47bf2085f6
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -1555,6 +1555,7 @@ def ensure_app(headless=True):
os.environ['QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM'] = '1' os.environ['QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM'] = '1'
if headless and iswindows: if headless and iswindows:
QApplication.setAttribute(Qt.ApplicationAttribute.AA_UseSoftwareOpenGL, True) QApplication.setAttribute(Qt.ApplicationAttribute.AA_UseSoftwareOpenGL, True)
QApplication.setAttribute(Qt.ApplicationAttribute.AA_ShareOpenGLContexts)
_store_app = QApplication(args) _store_app = QApplication(args)
if headless and has_headless: if headless and has_headless:
_store_app.headless = True _store_app.headless = True