Propose making QQuickImage public in Qt 5.2

  • I propose making QQuickImage public so that custom Image component with "image" property can be implemented by subclassing QQuickImage.

    "This thread": mentions the reason

  • Lifetime Qt Champion


    You're on the wrong place to do that (this forum is more user oriented), for such requests you should use the "bug report system": and fill a "feature request" with all details explaining why it would be good (don't forget to check if one already exists)

  • We have no plans to make QQuickImage public. In order to re-use QQuickImage for custom image sources, there is already a public API with QQuickImageProvider. If you need more custom behaviour than that, you can create a custom QQuickItem.

  • Thank Jens

    but I want to avoid reimplementing Image component completely.

    I think a new Image component with "image" property should be implemented officially.

    Because there are "image" property in UIImageView of iOS, ImageView of Android and ImageView of BB10 repectively.

  • But why can't you use a QQuickImageProvider a this is exactly what it is intended for. An "image" property is not very useful in qml.

  • An “image” property can help ease implementing image processing applications.

    For example, an image is loaded via a network resource by Image component of QtQuick, “image” property can be used as an input of image processing tasks(implemented by C++), and then new image(return by C++ functions) can be assigned to “image” property to update Image.

    Imagine there were an image property, I can do that

    @Image {
    id: imageView
    onStatusChanged: if (image.status == Image.Ready) {
    var newImage = cppClass.imageProcess(imageView.image)
    imageView.image = imageView.image

    Without "image" property, I need to download images by C++ code first, and then pass images to QQuickImageProvider.

  • There is no way to process images loaded via QML without using a shader. So you'd need to think about if your processing can be done with a shader.

    I agree with Jens that exposing an "imageData" attribute of some kind would cover a very small number of use cases, which doesn't help you if you fall under that use case!

  • Thank sohail

    I knew Shader Effects, I want to use Shader Effects too. However after Shader Effects are rendered, how to save results? The only way I know is grabbing drawing frames. The issue of grabbing drawing frames is that I cannot get full-resolution results because screen resolution is limited.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.