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

QML Image element does not allow to bind source to QImage property of QObject

    XMLWordPrintable

Details

    • macOS

    Description

      Although the documentation clearly mentions that the source-property of an QML image element is an URL, I am expecting to be able to do this:

      I have a c++ model that gets exposed to a qml context. It has an image property:

      Q_PROPERTY (QImage background READ background)

      This property changes over time and it might be generated inside my application, so there is neither a public URL on the internet nor a local file on the filesystem.

      Now I want to display that image in a QML scene like this:

      Image

      { fillMode: Image.Tile source: model.background }

      qrc:/resources/main.qml:8: Unable to assign QImage to QUrl

      which is a correct conclusion but anyway I want to do this. I have seen other bug reports that seem to go into the same direction(using application generated images in qml) but involve custom image loaders etc. I don't see why this would be necessary and I am voting for such a simple solution like proposed above.

      Attachments

        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
            axeljaeger Axel Jäger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes