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

[Reg 5.15.2/6.3.2 -> 6.4.x] DropShadow: Changing radius at runtime also changes Z-order

    XMLWordPrintable

Details

    • 7a8f65ab4d (qt/qtdeclarative/6.4) 7a8f65ab4d (qt/tqtc-qtdeclarative/6.4)

    Description

      Changing the DropShadow's radius causes it to be drawn in front of its source. See attached screenshots.

      Code

      import QtQuick
      import Qt5Compat.GraphicalEffects
      
          width: btn.width + 50
      Window {
          height: btn.height + 50
          color: "silver"
          visible: true
      
          Rectangle {
              id: btn
              anchors.centerIn: parent
              color: mouseArea.pressed ? "midnightblue" : "darkblue"
              width: 100
              height: 50
              radius: 4
      
              Text {
                  anchors.centerIn: parent
                  color: "white"
                  text: "Click Me"
              }
              MouseArea {
                  id: mouseArea
                  anchors.fill: parent
              }
          }
          DropShadow {
              id: lowerShadow
              anchors.fill: btn
              source: btn
              color: mouseArea.pressed ? "lightgray" : "gray"
              radius: mouseArea.pressed ? 0 : 3 // Making this a fixed value causes the problem to disappear
              transparentBorder: true
              verticalOffset: 3
              horizontalOffset: 3
          }
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              inho Inho Lee
              skoh-qt Sze Howe Koh
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes