I assume that self.header is a QLabel. The UI file would be quite helpful
for reference.

You should flip the slashes or if you really want backslashes, use the raw
string notation by putting an r before the quotes:
r"Y:\dev\python\mnmModelToolsHeader.jpg"

Also, make sure that the file is found by python:
myFile = "Y:/dev/python/mnmModelToolsHeader.jpg"
if os.path.exists(myFile):
    print "yay"

It may well be possible that Qt is having an issue with your jpeg, so try
loading a different image or a different
format<http://qt-project.org/doc/qt-4.8/qpixmap.html#reading-and-writing-image-files>
.

Tell me if any of these suggestions put you in the right direction.

Cheers,
jesse



On Thu, Sep 19, 2013 at 7:19 AM, Salvador Olmos Miralles <
[email protected]> wrote:

> So I've made a window for Maya in QtDesigner, and I've tried assigning a
> label a pixmap from QtDesigner, from the python script that references de
> ui file, and still I can't get the pixmap to work. I've also change a
> thousand times the .jpg path and none of them work. I paste my Python
> script:
>
>
> #----------------------------------------
>
> from PyQt4 import QtGui, QtCore, uic
> import platform, sys, random
> import maya.cmds as cmds
>
> os = platform.system()
> if os == "Windows":
>     uiFile = 'path_to_ui'
> else:
>     uiFile = 'path_to_ui'
> form_class, base_class = uic.loadUiType(uiFile)
>
> class textureReleaseUI(form_class, base_class):
>
>     def __init__(self, parent=mui.getMayaWindow()):
>         super(textureReleaseUI, self).__init__(parent)
>         self.setupUi( self )
>         self.initUI()
>     def initUI(self):
>         pixmap = QtGui.QPixmap("Y:\dev\python\mnmModelToolsHeader.jpg")
>         self.header.setPixmap(pixmap)
>         self.connectSignals()
>     def connectSignals(self):
>         self.connect(self.orient_btn, QtCore.SIGNAL('pressed()'),
> orientTip)
>         self.connect(self.clean_btn, QtCore.SIGNAL('pressed()'), main)
>         self.connect(self.rename_btn, QtCore.SIGNAL('pressed()'),
> checkNaming)
>         self.connect(self.none_btn, QtCore.SIGNAL('pressed()'), printLines)
>
>
> def runUI():
>     #global app
>     global win
>     #app=QtGui.QApplication(sys.argv)
>     win = textureReleaseUI()
>     win.show()
>     #sys.exit(app.exec_())
> runUI()
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to