I'm trying to display the standard Clarisse icon images against the respective item names in my PyQt widget. For eg: If my QTreeWidget lists an item of type "LayerImage", I'd like to pull the same icon for that item as displayed in Clarisse's Browser window.
Here's an example piece of code:
- Code: Select all
item = ix.get_item("project://renderPasses/EXAMPLE_BEAUTY/EXAMPLE_BEAUTY_LAYER")
icon = item.get_item_icon()
imgData = icon.get_image().get_data()
I was hoping to convert 'imgData' into a QPixmap object in PyQt. But haven't had any success because the expected argument type in Qt is QByteArray. And I don't know how to handle the data type for imgData. If I run something like this:
- Code: Select all
pixMap = QtGui.QPixmap()
pixMap.loadFromData(imgData)
I get this error:
argument 1 has unexpected type 'SwigPyObject'
Any help is greatly appreciated!