[Interest] QIcon vs QQuickIcon

Remy Rouvin remy.rouvin at gmail.com
Tue Jun 14 16:52:25 CEST 2022


What about passing the image in base64 format in the source property ?

-----Message d'origine-----
De : Interest <interest-bounces at qt-project.org> De la part de ivan tkachenko
Envoyé : mercredi 1 juin 2022 01:08
À : Benjamin TERRIER <b.terrier at gmail.com>
Cc : Qt Interest <interest at qt-project.org>
Objet : Re: [Interest] QIcon vs QQuickIcon

> The standard solution is to use a QQuickImageProvider.
> In C++ you would implement your own QQuickImageProvider which will 
> contain the QIcons.
> In QML then you would use a url like "image://myprovider/icon_id".
> Then the QML engine will call your QQuickImageProvider to retrieve the 
> icon image.
> 
> An alternative solution might be to use data urls, but I have never 
> tried it.

Sounds insanely complex when just got a QIcon from somewhere and you want to
feed it into UI.

Well, thanks for clarifying that no [easy] solution is currently available
in the Qt itself.

--
ivan (@ratijas)



More information about the Interest mailing list