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

Reparenting the ShaderEffect source item has undesired side effects

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.0.0
    • 5.0.0
    • Quick: SceneGraph
    • None
    • 63f1fb2dfeabc01f14a1766a2277ece4d338b0e6

    Description

      Here's a test case. Just run it, the parent is changed every 500ms and the source item suddenly becomes visible.

      import QtQuick 2.0
      
      Rectangle {
          id: root
          width: 300
          height: 300
      
          Text {
              id: text
              anchors.centerIn: parent
              font.pixelSize: 120
              font.family: "Times"
              color: "green"
              text: "Qt"
          }
      
          Timer {
              interval: 500
              running: true
              repeat: true
              onTriggered: {
                  text.parent = (text.parent ? null : root);
                  console.log(text.parent);
              }
          }
      
          ShaderEffect {
              anchors.fill: parent
              property variant source: ShaderEffectSource {
                  sourceItem: text
                  hideSource: true
                  smooth: true
              }
          }
      }
      

      A real life use case is in Qt Components ToolBar that does some reparenting magic. The problem is likely related to the TODO statement in QSGShaderEffect::setSource().

      Attachments

        For Gerrit Dashboard: QTBUG-21032
        # Subject Branch Project Status CR V

        Activity

          People

            kkalland Kim Motoyoshi Kalland (Inactive)
            jpnurmi J-P Nurmi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes