hannesdelbeke / unimenu

easy consistent menus across apps: unreal, blender, maya, krita, substance painter, Katana, marmoset, 3ds max, cry-engine, FreeCAD, Hero, Nuke, Qt,...
https://github.com/hannesdelbeke/unimenu/wiki/features-overview
Apache License 2.0
83 stars 8 forks source link

global local vars issue #42

Closed hannesdelbeke closed 1 year ago

hannesdelbeke commented 1 year ago

when we use exec to run python code from a text file, the locals and globals inside the exec are lost. so w = QWidget() will instantly be garbage collected.

How can we keep the reference? tried but no luck so far

exec(self._command, globals(), globals())

it seems to pass the var correctly but widget still garbage collected. testing with import buttonizer.main; global w; w = buttonizer.main.show()

see https://www.programiz.com/python-programming/methods/built-in/exec

hannesdelbeke commented 1 year ago

think this was a bqt bug masquerading as a unimenu bug, closing