Jump to content

Load QT UI from HDA extra file


IIIROFLIII

Recommended Posts

Hi everyone,

I wonder if someone has already succeed to load a .ui file made with qtdesigner, but the particular case is that .ui file is inside a HDA in Extra Files. I've tried with opdef but it seems to be not working.

the command I used was QUILoader().load(path.ui) (and it's working if the .ui file is on disk)

Thanks to all

 

Link to comment
Share on other sites

Hi Salkerx777, thanks for your reply.

I just checked your hda and it seems to have what i'm missing, nevertheless when i try to launch the ui there is this error (see attachment)

 

From my side I find a "solution", i can get the content of the ui with hou.readFile(opdef....), then write this content on the desktop in a ui file and pointing on it when launching, then deleting after the ui.show() (so it's transparent for the user)

But your solution is more convenient^^, and i'm very interesting to work with it

 

Capture.PNG

Link to comment
Share on other sites

I dunno guys, just tried it on a different computer and it also works. Both are Linux machines though.

In general, you want to generate Python code from your ui files. See this:

https://doc.qt.io/qtforpython/tutorials/basictutorial/uifiles.html

Houdini ships with pyside2-uic though I couldn't find the wrapper script for it, you can call it directly like so:

hython $HFS/python/lib/python2.7/site-packages-ui-forced/PySide2/scripts/uic.py dialog.ui -o dialog.py

 

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...