PDG, Startup Scripts and Qt

   1465   1   0
User Avatar
Member
4 posts
Joined: Jan. 2016
Offline
Hi guys,

I'm currently having the issue that my ROP Geometry Output nodes in TOPs are failing whenever I'm using my 123.py startup script with the following error log:
QWidget: Must construct a QApplication before a QWidget
If I got it right in the TOPs documentation, I believe this is due to the fact that TOPs spawns one or multiple new Houdini instances which will then run the task(s). I think those subprocesses are opened up without the GUI and therefore there was no QApplication initialized before I am calling my custom pipeline window.
Is there any way to query if the current process was opened by TOPs? This way I could still open the window when a user opened Houdini but ignore it when TOPs did it.
I also tried the
if __name__ == '__main__'
condition, but that didn't make a difference either.


Thanks for your help in advance!

Michael
User Avatar
Member
4 posts
Joined: Jan. 2016
Offline
Here is a way to get around that issue. I'm only calling the startup scripts which are using Qt with the following condition:

if not 'hython' in os.path.basename(sys.executable):
Edited by michlvfx - May 24, 2020 04:34:08
  • Quick Links