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

Scene Graph Nodes placed at incorrect positions with software rendering backend

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7.0 RC
    • Quick: 2D Renderer
    • None
    • Linux/Wayland

    Description

      When using the QtQuick Software Rendering backend, adding and removing scene graph nodes may result in some nodes being placed at global coordinates instead of relative to its item. I am unsure if this is a placement issue or whether the nodes somehow end up outside of the graph.

      In the attached example, I have a C++ QQuickItem subclass that creates a QSGSimpleRectNode with a color that is set from a property on the QQuickItem. If the color changes (triggered by clicking on the item in this case), a new rect node is placed next to the existing one with the new color. ThenĀ  a timer is started and 500ms later the node with the old color is removed and the new node is moved to the old node's position.

      This all works correctly with the RHI backend, but when using the software backend, the first render is correct but subsequent renders result in the nodes being placed in the top left of the window rather than the center. I have also attached two recordings of the behavior, one with hardware rendering that behaves correctly, one with QT_QUICK_BACKEND=software that behaves incorrectly.

      Attachments

        1. CMakeLists.txt
          0.4 kB
        2. hardware.webm
          19 kB
        3. main.cpp
          0.3 kB
        4. Main.qml
          0.3 kB
        5. software.webm
          19 kB
        6. TestItem.cpp
          1 kB
        7. TestItem.h
          0.5 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            awhiemstra Arjen Hiemstra
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes