Jump to content

Proper external close of hou.ui.selectFile() and hou.ui.selectNode()


nsergeev

Recommended Posts

Dear colleagues,

Houdini provides developers with an option to open the File-/Node-Dialog (such as hou.ui.selectFile() and hou.ui.selectNode()). However, in case I call it from the external QWidget, in my case it is PySide2. If I close this PySide2's QWindow, obviously, it causes the Houdini crash, because hou.ui.selectFile() should return a string to the PySide2's QWidget parent.

Here is an example:

I have a tool on the Shelf, it opens PySide2 QWidget. Imagine there is a button which opens hou.ui.selectFile() or hou.ui.selectNode(). After calling this function, Houdini creates one more subwindow with File-/Node-Dialog respectively. However, if I close QWidget, any of two select functions return a result to non-existed at the moment sub-application. It causes Houdini crash.

I am looking for how can I take the reference to this File-/Node Dialog to properly terminate it on closeEvent(self, event), because disabling QWidget's UI, while File-/Node Dialog is open, doesn't seem to be the best solution.

 

One of the possible answers might be: use PySide2's File Dialogs. What seems to be ok for the File-/Path-Dialog, but it might take time to produce custom hou.ui.selectNode(). 

Thank you in advance!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...