[Qt-qml] Image Provider

warwick.allison at nokia.com warwick.allison at nokia.com
Wed Mar 31 02:37:43 CEST 2010


> I usually use an image pre-loader in applications with a large set of
> images to reduce loading time, showing an initial throbber while
> loading the images used by the application in another thread.

Images are already loaded in a separate thread, so I'm not sure I understand the problem you're solving.

> I want to know if there is an official way to do this in QML.
> I see that I can register a QDeclarativeImageProvider, that could have
> a hash of pre-loaded images. But I presume this would consume more
> memory since the image would be transformed internally in a QPixmap in
> the main thread, duplicating the data, and also the image requests are
> performed in another thread.

Ultimately the image has to be a QPixmap, and those can only be created in the main (GUI) thread, so there is no way currently to avoid this copy.

--
Warwick




More information about the Qt-qml mailing list