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

Image: reloading of image causes flicker

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • None
    • 5.12.2
    • None
    • e0e0f722b86db7b99185ccd669dd5456623e7e69

      With QtQuick 2 reloading of (remote) images that was pretty unnoticable with QtQuick 1 causes flickering now.

      Looks like the reason is QQuickImageBase::load() calling update right after triggering the reload (there's a comment explaining why). As the image is not yet available this results in "nothing" to be drawn (= flicker) until image loading has been completed.

      Maybe QQuickImageBase should apply some kind of double buffering, e.g. using two alternating QQuickPixmap instances.

      Here's some example code reloading a webcam image every five seconds:

      import QtQuick 2.12
      import QtQuick.Window 2.12
      
      Window {
        visible: true
        width: 640
        height: 480
        title: qsTr("Webcam Flicker")
      
        property int counter
      
        Image {
          anchors.fill: parent
          source: "https://www.bicos.de/webcam/webcam4.jpg?ts=" + counter
        }
      
        Timer {
          interval: 5000
          repeat: true
          onTriggered: counter++;
          running: true
        }
      }
      

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            njeisecke Nils Jeisecke
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes