I have implemented a QListWidget and add items to it QListWidgetItems, whats
weird is the Icon shows up for the first block in if but not for the elif block
, i have checked it twice the path is right and even tried \\n coz \n converts
to newline, but icons doesnt shows up see this link
http://www.youtube.com/watch?v=RgjbHz5o68w&t=3m5s&hd=1
the code i am using to add items :
def addToRenderQueue(self):
ext=os.path.splitext(str(self.scnFilePath.text()))[-1]
if self.mayachkBox.isChecked() and (ext=='.ma'):
img_mIcon=QtGui.QPixmap("images\icon_maya-small.png")
ntask=self.makeBatTask()
self.itemTask=QtGui.QListWidgetItem(ntask)
self.itemTask.setIcon(QtGui.QIcon(img_mIcon))
self.listWidget.insertItem(0,self.itemTask)
elif self.nukechkBox.isChecked() and (ext=='.nk'):
img_nIcon=QtGui.QPixmap("images\nuke.png")
ntask=self.makeBatTask()
self.itemTask=QtGui.QListWidgetItem(ntask)
self.itemTask.setIcon(QtGui.QIcon(img_nIcon))
self.listWidget.insertItem(0,self.itemTask)
if anyone can tell me why is it happening and how do I get QIcon to show for
the elif part too...
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].