PDA

View Full Version : Display decoration in listview delegate



manuelschneid3r
4th January 2016, 13:36
I have a model in C++ that is used in my Qml file. Its working fine, but I have problems showing the decoration. How can I display an icon in qml? I searched the documentation and the web, no success. ImageItem wont work either.

anda_skoa
4th January 2016, 13:40
You mean something like Qt::DecorationRole in widget based views?

The easiest way is to have a role that returns the image's file name and then use an Image element using that as its source.

Cheers,
_