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

Qt Quick 2D Renderer: Partial scene update might erase items at fractional coordinates

    XMLWordPrintable

Details

    • 2dc17a45f (dev), d21b1f607 (6.6), b53b28380 (6.5)

    Description

      Code

      import QtQuick 2.15
      import QtQuick.Window 2.15
      
      Window {
          id: root
          width: 400
          height: 300
          visible: true
      
          Rectangle {
              id: box
              width: 100
              height: 100
              color: box.go ? "green" : "red"
      
              property bool go: false
      
              Rectangle {
                  id: line
                  y: 50.01 // Any non-integer value here will trigger the issue, say 50.01 or 50.99
                  width: parent.width*2
                  height: 1
                  color: "blue"
              }
          }
      
          Timer {
              interval: 1000
              repeat: true
              running: true
              onTriggered: box.go = !box.go
          }
      }
      
      

       

      Steps to reproduce

      1. Build and run the code above, with the environment variable QT_QUICK_BACKEND=software
      2. Observe the GUI over a few seconds (as the Timer toggles a few times)
      3. Resize the window
      4. Observe the GUI over a few more seconds

       

      Expected outcomes
      While "box" toggles between red and green, "line" remains unchanged (blue) and visible at all times

       

      Actual outcomes

      • "line" is visible at startup
      • When "box" changes colour, the portion of "line" that overlaps with "box" is erased and doesn't come back
      • Resizing the window temporarily makes the whole "line" visible again, but the issue re-occurs when "box" changes colour

       

      Notes

      • Changing line.y to an integer value produces the expected outcome
      • Using a non-software backend produces the expected outcome

      Attachments

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

        Activity

          People

            janichol Andy Nichols
            skoh-qt Sze Howe Koh
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes