Jump to content
IIIROFLIII

Load QT UI from HDA extra file

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

 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Never thought about loading the code as a buffer. That's really cool Alex. 

Cheers

-J

Share this post


Link to post
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

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×