ImageReader QML Type

ImageReader is a wrapper of QImageReader that support asynchronous operation and read from image provider. More...

Import Statement: import .

Properties

Signals

Methods

Detailed Description

It is a singleton component

Property Documentation

canRead : bool

Returns true if an image can be read for the device (i.e., the image format is supported, and the device seems to contain valid data); otherwise returns false.

You need to call fetch() before access this property.


errorString : string

This property indicate the error occured during read()


image : QImage

This property holds the image read by the reader. You need to call read() before access this property


isError : bool

This property indicate any error occured


isFetch : bool

Returns TRUE if the fetch() function is completed. Otherwise, it will returns false.


isFinished : bool

This property indicate is the read() function finished.


isReady : bool

This property indicate is the image ready to read


size : size

Returns the size of the image.

You need to call fetch() before access this property.


source : url

This property holds the location of image.


Signal Documentation

finished()

Once the image reader is finished to read an image. It will emit signal.


Method Documentation

void clear()

Clear all the content of property then restore to initial status.


void fetch()

Fetch the information of the image without actually reading the image content. It is asynchronous call. Once it is fetched, it will emit fetched() signal and set isFetched property to true.


void read()

Reads an image from the source. On success, it will set the isReady and image property.

Otherwise, it will set isError to true. You can then access errorString poroperty to find out the type of error that occurred.