QT: Only set if hasattr(QtCore.Qt, "AA_ShareOpenGLContexts")

If the attribute does not exist (presumably in older versions of Qt),
this change prevents the following error:

  AttributeError: type object 'Qt' has no attribute 'AA_ShareOpenGLContexts'
This commit is contained in:
Yuval Kogman 2018-01-13 16:03:40 +00:00
parent c8e67e2bd0
commit 34256c16f8
1 changed files with 2 additions and 1 deletions

View File

@ -92,7 +92,8 @@ class ElectrumGui:
#network.add_jobs([DebugMem([Abstract_Wallet, SPV, Synchronizer,
# ElectrumWindow], interval=5)])
QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_X11InitThreads)
QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_ShareOpenGLContexts)
if hasattr(QtCore.Qt, "AA_ShareOpenGLContexts"):
QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_ShareOpenGLContexts)
self.config = config
self.daemon = daemon
self.plugins = plugins