Commit abeeb1e0 authored by Daniel Murphy's avatar Daniel Murphy
Browse files

Set QT layer for Error Reporter on BigSur

parent deec3d72
......@@ -7,6 +7,7 @@
import argparse
import importlib
import sys
import os
import mantid
from qtpy import QT_VERSION
......@@ -31,6 +32,20 @@ def main() -> int:
# Qt resources must be imported before QApplication starts
importlib.import_module(f'mantidqt.dialogs.errorreports.resources_qt{QT_VERSION[0]}')
if sys.platform == 'darwin':
# Force layer-backing on macOS >= Big Sur (11)
# or the application hangs
# A fix inside Qt is yet to be released:
# https://codereview.qt-project.org/gitweb?p=qt/qtbase.git;a=commitdiff;h=c5d904639dbd690a36306e2b455610029704d821
# A complication with Big Sur numbering means we check for 10.16 and 11:
# https://eclecticlight.co/2020/08/13/macos-version-numbering-isnt-so-simple/
from distutils.version import LooseVersion
import platform
mac_vers = LooseVersion(platform.mac_ver()[0])
if mac_vers >= '11' or mac_vers == '10.16':
os.environ['QT_MAC_WANTS_LAYER'] = '1'
print('############\nDANIEL WAS HERE\n##############\n')
from qtpy.QtWidgets import QApplication
app = QApplication(sys.argv)
form = CrashReportPage(show_continue_terminate=False)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment