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

[Reg 6.3.2 -> 6.4.x] DropShadow: Changing radius to 0 at runtime causes a crash when attached to Canvas

    XMLWordPrintable

Details

    • f70844868 (dev), 5d2f4c348 (6.5), 8f9fdde22 (tqtc/lts-6.2), d4ef47ea9 (6.4), 4e81f58f8 (6.4.3)

    Description

      Clicking on the rectangular Canvas below causes a crash.

      Interestingly, it doesn't seem to crash if the MouseArea is made a child of the Canvas.

      import QtQuick
      import Qt5Compat.GraphicalEffects
      
      Window {
          id: root
          width: 400
          height: 300
          visible: true
      
          Canvas {
              id: btn
              width: 100
              height: 50
              anchors.centerIn: parent
              onPaint: getContext("2d").fillRect(0, 0, btn.width, btn.height)
          }
      
          // Moving this MouseArea into the Canvas causes the problem to disappear
          MouseArea {
              id: mouseArea
              anchors.fill: btn
          }
      
          DropShadow {
              anchors.fill: btn
              source: btn
              radius: mouseArea.pressed ? 0 : 3
              transparentBorder: true
              verticalOffset: 3
              horizontalOffset: 3
          }
      }
      

       

      Workaround

      It doesn't crash if you replace the 0 with a small, non-zero value (e.g. Number.EPSILON )

      Attachments

        Issue Links

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

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              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