shadowst17 Posted January 24, 2020 Share Posted January 24, 2020 hey guys, I have a pyQT window that is parented to the main Houdini Window but every time I reopen the scene it's opens the PyQT window again. class Manager(QtWidgets.QDialog): def __init__(self, parent=None): super(Manager, self).__init__(parent) self.setWindowTitle('Manager') self.setFixedSize(700, 450) dialog = Manager() dialog.setParent(hou.ui.mainQtWindow(), QtCore.Qt.Window) dialog.show() According to the docs I need to unparent it in the close event which I have done but it still seems to open. What am I missing? def closeEvent(self, event): self.setParent(None) self.close() Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted January 24, 2020 Share Posted January 24, 2020 3 hours ago, shadowst17 said: What am I missing? The point of parenting. You most likely want your UI shown on-demand (i.e clicking a shell button, menu or in python panel). Parenting to the main and not expecting it to show up doesn't make much sense. 3 hours ago, shadowst17 said: every time I reopen the scene Which means you have your code executed either in 123/456.py or in hou.session or in HDA's event handlers. Decide when you want this ui to be shown and call dialog.show() from there. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.