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

Initially empty BorderImage that has a shader effect applied never becomes visible

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.0.0
    • Quick: SceneGraph
    • None
    • Current Qt5 master
    • 077c7eb97c822e70fdb2bfe88e3ddec46897ef6e

    Description

      Initially empty (as in, has no source) BorderImage that has a shader effect applied does not become visible even after adding a source.

      A test case:

      main.qml
      import QtQuick 2.0
      
      Item {
          width: 640
          height: 480
      
          BorderImage {
              id: image
              anchors.centerIn: parent
      
              property bool empty: false // <--- change to 'true' and it never becomes visible!
              source: empty ? "" : "test.png"
      
              property bool initial
              Component.onCompleted: initial = empty
          }
      
          ShaderEffect {
              id: effect
              anchors.fill: image
              property variant source: ShaderEffectSource {
                  sourceItem: image
                  hideSource: true
              }
          }
      
          MouseArea {
              anchors.fill: parent
              onClicked: image.empty = !image.empty
      
              Text {
                  text: "Initially empty: " + image.initial
                  anchors { margins: 10; left: parent.left; top: parent.top }
              }
              Text {
                  text: "Image source: " + image.source
                  anchors { margins: 10; left: parent.left; bottom: parent.bottom }
              }
              Text {
                  text: "(click the background to toggle)"
                  anchors { margins: 10; right: parent.right; bottom: parent.bottom }
              }
          }
      }
      

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            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