Browse Source

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'
master
Yuval Kogman 8 years ago
parent
commit
34256c16f8
  1. 1
      gui/qt/__init__.py

1
gui/qt/__init__.py

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

Loading…
Cancel
Save