Hey Philipp,

you might want to make sure that your path is ok (file exists and so on),
and maybe try using
*addFile<http://qt-project.org/doc/qt-4.8/qicon.html#addFile>
 *on your QIcon object ...

I doubt that might be the case, bus maybe you need to cast your path to a
QString *QIcon <http://qt-project.org/doc/qt-4.8/qicon.html#QIcon-4>* (
const QString & *fileName* )?



Cheers





On Wed, Feb 6, 2013 at 8:50 AM, Simon Anderson <
[email protected]> wrote:

> Currently at work, I can see if I can get an icon showing when im home,
> but I do remember us having icons on our buttons.
>
>
>
>
> On Wed, Feb 6, 2013 at 6:07 AM, philipp.oeser <[email protected]>wrote:
>
>> **
>>  Hi list,
>>
>> first of all: thanx again for bringing PyQT to Softimage!
>> (it's just so much nicer to be able to do UIs for SI, Nuke and Maya in
>> _one_ go :))
>>
>> But: I was wondering if someone else is having trouble getting QIcons to
>> show in PyQT for Softimage?
>> I have some code that runs fine in Maya and Nuke (it shows the icons with
>> QStandardItems in a QTreeView)
>> but the exact same code/ui-file just doesnt show the Icons in
>> Softimage...
>>
>> ======= something like this ===============
>> oTasksModel = QtGui.QStandardItemModel()
>> oRootItem = oTasksModel.invisibleRootItem()
>> self.ui.UI_tv_Tasks.setModel(oTasksModel)
>>
>> sTask = 'taskname'
>> oTaskItem = QtGui.QStandardItem(sTask)
>>
>> sFullPath = 'validpath'
>> oIcon = QtGui.QIcon(sFullPath)
>> oTaskItem.setIcon(oIcon)
>>
>> # it seems to be taken, if you print out oTaskItem.icon(), it will print
>> # <PyQt4.QtGui.QIcon object at 0x000....>
>>
>> oRootItem.appendRow(oTaskItem)
>> ==================================
>>
>> Has this been done succesfully? Or can someone confirm it is not working?
>> Should I dig deeper?
>>
>> Thanx in advance
>> Philipp
>>
>>  P.S. using PyQt-Py2.6-x64-gpl-4.9.5-1 and PyQtForSoftimage_beta5
>>
>
>
>
> --
> -------------------
> Simon Ben Anderson
> blog: http://vinyldevelopment.wordpress.com/
>



-- 
Xavier

Reply via email to