http://qt-project.org/doc/qt-4.8/qstyleditemdelegate.html#details
http://qt-project.org/doc/qt-4.8/qt.html#ItemDataRole-enum
Have you looked into using Qt::DecorationRole
instead?
Just from reading the documentation here:
http://qt-project.org/doc/qt-4.8/qstyleditemdelegate.html#subclassing-qstyleditemdelegate
http://qt-project.org/doc/qt-4.8/qstyleditemdelegate.html#paint
and your sample code, it looks like you are following the documentation properly...
Have you checked out this example:
http://qt-project.org/doc/qt-4.8/itemviews-stardelegate.html
?
You could also throw in some qDebug
statements in there to make sure that your element is visible/shown, and that it gets to your paint event by putting qDebug() << Q_FUNC_INFO;
at the top of your paint event.
Hope that helps.