[Interest] Crazy idea of the day: QML Image source inception
Jérôme Godbout
jerome at bodycad.com
Fri Oct 21 15:25:01 CEST 2016
every Item into Qml now have grabToImage function which could be used to
design an Item and all it's children and then grab it to an images :
http://doc.qt.io/qt-5/qml-qtquick-item.html#grabToImage-method
This way you could compose an Item hierarchie then use it into your canvas.
On Fri, Oct 21, 2016 at 4:06 AM, Gunnar Sletta <gunnar at sletta.org> wrote:
> To some extent this this is already possible. Why does it have to be an
> Image specifically, though?
>
> You can cache an item subtree using Item::layer.enabled = true, or by
> loading the said .qml with a Loader and turn that into a texture (which is
> what an image actually is) using ShaderEffectSource.
>
> cheers,
> Gunnar
>
> > On 20 Oct 2016, at 15:55, Jason H <jhihn at gmx.com> wrote:
> >
> > I have a collection of QML elements that use the canvas. I'd like to be
> able to re-use them as an Image source.
> >
> > For example, one of my QMLs is X.qml, which draws two intersecting
> diagonal lines using Canvas. I also have a ListView who has a delegate that
> contains an image. Sometimes I want this to be a typical image (PNG, JPG,
> SVG) but occasionally I'd like to be able to use a QML. I realize I can do
> some generation and write an image provider and jump through all those
> hoops, but something like this should be built in? It may also be possible
> to do some createComponent wizardry, and use two elements. But it remains
> that
> > Image {
> > source: "X.qml"
> > }
> >
> > would be very cool indeed.
> >
> >
> > _______________________________________________
> > Interest mailing list
> > Interest at qt-project.org
> > http://lists.qt-project.org/mailman/listinfo/interest
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20161021/11388a4b/attachment.html>
More information about the Interest
mailing list