[Interest] Getting a QImage from an QML Image, protocol agnostic QImage?

Sean Harmer sean.harmer at kdab.com
Tue Apr 11 16:19:06 CEST 2017


On Tuesday 11 April 2017 16:05:57 Jason H wrote:
> I am looking for a way to get the original pixel data from a Image element
> into QImage. A few ways just grab the image as rendered (returning less
> data if scaled down) but I want the full image.
> 
> I don't mind loading the pixel data for myself, but the Image element take s
> QUrl, and if passed to QImage(url) nothing except local files load, and I
> have to use url().path(). I'd like to pass the full URL to
> QImage("https://blah/file") and have it load synchronously.
> 
> Is there any way to do that?

Use a QnetworkAccessManager to fetch the file first.

Cheers,

Sean
-- 
Dr Sean Harmer | sean.harmer at kdab.com | Managing Director UK
KDAB (UK) Ltd, a KDAB Group company
Tel. +44 (0)1625 809908; Sweden (HQ) +46-563-540090
Mobile: +44 (0)7545 140604
KDAB - Qt Experts



More information about the Interest mailing list