PyQt, Maya: Icons on buttons created by QT designer are not shown in Maya?

Hi again,

I’ve created a window with some buttons and icon on each button. When I call the window in Maya, it works correctly but it doesn’t show the icons. What am I missing here?

Thanks a lot,

Path issue, designer saves paths as relative, not full path. I believe they are either relative to the .ui file, or relative to the designer.exe file.
Qt under Maya is using a different working directory to load images relative to… You can change the working directory, but that is shared by things like the file browser, so someone loading a file will break your ui relative paths :frowning:

Best solution is to use .qrc files instead, and then compile them with pyrcc4

Is it possible to use a .qrc file with mel?

[QUOTE=Temujin;17825]Path issue, designer saves paths as relative, not full path. I believe they are either relative to the .ui file, or relative to the designer.exe file.
Qt under Maya is using a different working directory to load images relative to… You can change the working directory, but that is shared by things like the file browser, so someone loading a file will break your ui relative paths :frowning:

Best solution is to use .qrc files instead, and then compile them with pyrcc4[/QUOTE]

Too many things to learn for a simple user interface 8|

Thanks Nathan.

Once a .qrc file is imported via python as a python module, the relative icon paths WILL work via mel. (The Qt resource system is a big shared resource, so mel/c++/pyqt all share the same data)

[QUOTE=Temujin;17847]Once a .qrc file is imported via python as a python module, the relative icon paths WILL work via mel. (The Qt resource system is a big shared resource, so mel/c++/pyqt all share the same data)[/QUOTE]
thanks Temujin! So, I’m confused, would that be standard python, or using pyQt. Why I’m asking is that the machines I use don’t have the option for installing pyQT, so I would have to use mel or python. If so, how would you import the .qrc file. An example would be highly appreciated.