[Development] Why does QQuickImageProvider not support SVG images?
Giuseppe D'Angelo
giuseppe.dangelo at kdab.com
Thu Mar 13 16:05:10 CET 2025
Il 12/03/25 09:46, Schimkowitsch Robert ha scritto:
> I immediately jumped on the brand-new VectorImage, and quickly found, to
> my disappointment, that I cannot use it, because I am missing an
> important piece.
>
> How am I supposed to pass a memory-generated SVG via URL?
>
> Normally, I would do that via QQuickImageProvider, but it seems someone
> forgot SVGs there.
Or via a custom QNAM.
However VectorImage doesn't support SVGs not coming from the filesystem
or the resource system.
> https://github.com/qt/qtdeclarative/blob/dev/src/quickvectorimage/qquickvectorimage.cpp#L57
IMO there's no reason for this limitation to be there, and the fact that
the `source` property is of type `url` makes this behavior difference
(say, with Image) extremely unpleasant.
(VectorImage is also missing signals and notifications for loading
errors, FWIW.)
> I’m happy for suggestions….that do not involve writing stuff to disc
> (for long-lived devices, that can become an issue with SSD lifetime).
>
Is tmpfs an option?
My 2 c,
--
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - Trusted Software Excellence
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4244 bytes
Desc: Firma crittografica S/MIME
URL: <http://lists.qt-project.org/pipermail/development/attachments/20250313/42549131/attachment.bin>
More information about the Development
mailing list