I’ve set up a framework that gets initialised from an app configured in the project environment. This framework adds a few commands.
I have a method on the framework that I want to run when tk-desktop starts up. The method sets up a QThread and some QTimers.
When I run my meth in the framework init then it fails because the QApplication has not been set up yet. I had a look through the bootstrap code and it seems that the QApplication is only setup after the init. I can’t find any hooks that run after the QApplication has been set up.
My workaround at the moment is to fork the tk-desktop and add a post_qt_init hook (similar to tk-photoshopcc) that runs after the QApplication. I then use this hook in the shotgun_config to call my framework method. This works but I don’t really want to have to fork the app.
I think I could also fork the site config and implement the launch_python.py to change the path_to_boostrap to a custom bootstrap that calls my code after utiltities.start_app. However I’m not too keen on overriding the site config as that will require a site wide change as apposed to a project pipeline config change.
Is there any easier way of doing this?