Enter code here...
class CustomQtApplication(QtApplication):
"""Redirect from Enaml QtApplication to origin one.
Required by ApplicationContext"""
def __getattr__(self, item):
return getattr(self._qapp, item)
class AppContext(ApplicationContext):
def __init__(self):
if self.excepthook:
self.excepthook.install()
# Many Qt classes require a QApplication to have been instantiated.
# Do this here, before everything else, to achieve this:
self.app
# We don't build as a console app on Windows, so no point in installing
# the SIGINT handler:
if not is_windows():
self._signal_wakeup_handler = SignalWakeupHandler(
self.app._qapp, self._qt_binding.QAbstractSocket
)
self._signal_wakeup_handler.install()
if self.app_icon:
self.app.setWindowIcon(self.app_icon)
@cached_property
def app(self):
return CustomQtApplication()
Enter code here...