Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QQuickImageProvider force image to be updated. How to?

QQuickImageProvider force image to be updated. How to?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 3 Posters 2.6k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kofr
    wrote on last edited by Kofr
    #1

    Hi. I have QQuickImageProvider and I need to keep image in sync in QML with source set to this QQuickImageProvider to be updated in case of its source changes.
    How to do this? I ask because QQuickImageProvider does not have any signals or to indicate that source changed.
    What is the benefit of using QQuickImageProvider instead of P_PROPERTY(QImage image... ) which signals about changes?

    raven-worxR 1 Reply Last reply
    0
    • L Offline
      L Offline
      literA2
      wrote on last edited by
      #2

      @Kofr if you're using the QQuickImageProvider to load the image, once the onSourceChanged signal (Image class) is triggered the requestImage() function of QQuickImageProvider will be called.

      Kindly refer to the documentation for its benefits.

      1 Reply Last reply
      0
      • K Kofr

        Hi. I have QQuickImageProvider and I need to keep image in sync in QML with source set to this QQuickImageProvider to be updated in case of its source changes.
        How to do this? I ask because QQuickImageProvider does not have any signals or to indicate that source changed.
        What is the benefit of using QQuickImageProvider instead of P_PROPERTY(QImage image... ) which signals about changes?

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by
        #3

        @Kofr said in QQuickImageProvider force image to be updated. How to?:

        What is the benefit of using QQuickImageProvider instead of P_PROPERTY(QImage image... ) which signals about changes?

        the benefits are well described in the class description.

        As the classname says it's supposed to provide images. The images do not necessarily exist. For example you could create pixmaps on the fly specified by url parameters.

        You need to create a separate QObject which keeps track of the images and triggers when you want it to. the image provider is still needed though. But in QML you could request the image url via your custom object which then also registers to trigger updates when it changes for example.

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved