Reputation: 16091
I have a C++ model that is used in QML. It's working fine, but I have problems showing decoration. How can I display icons in QML? I have searched the documentation and the web, no success. Image
doesn't work either.
Upvotes: 0
Views: 349
Reputation: 49289
You have two options:
provide the icon as a string with a path to the icon file and use an Image
element in QML to load the icon from the path string.
provide the icon as a QImage
and use a custom image provider to use the QImage
as a source for a QML Image
.
The second approach is overkill in your case, but still, image interop between C++ and QML is possible if you need it in future.
Upvotes: 1