Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-12031

API for C++ Declarative modules to retrieve images

    XMLWordPrintable

Details

    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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              anbaldwi Andrew Baldwin
              Votes:
              7 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes