Details
-
Task
-
Resolution: Won't Do
-
P2: Important
-
None
-
None
Description
QDeclarativeImageProvider only provides a C++ interface for Declarative modules which provide images.
There is currently no public API for modules to retrieve images from a URL that makes use of existing declarative engine functionality such as
- threaded asynchronous loading that does not disturb the main rendering thread with computationally expensive image decoding
- source size scaling to decode an image to a size other than it's natural one (e.g. megapixel digital camera images down to screen sized bitmaps)
- caching of images
This means that currently modules must recreate this functionality themselves.
It may be worth considering a way this can be implemented so that such custom items from modules can easily present a standard set of image-related item properties, even though they may not be derived form the private QDeclarativeImage class.
As an example, consider a custom item which needs a background image and a mask image. It cannot present the standard "source" or "sourceSize" properties for both of these. Better might be "background" and "mask" properties which can take a reusable "ImageResource" item which is similar to "Image", but not derived from "Item" (and hence not visual).
Declarative could provide the "ImageResource" as a standard item, along with a public C++ interface allowing it to be used by modules. This use case is discussed further in QTBUG-19185.
An additional requirement for the C++ API is that the overall cache size be controllable (QTBUG-13555).
Attachments
Issue Links
- relates to
-
QTBUG-19185 Image data element for QML
-
- Reported
-
-
QTBUG-14596 Provide support for QImages in QML javascript functions
-
- Closed
-