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

QtQuick Rectangle: Gradient not displayed when the color property is set to transparent.

    XMLWordPrintable

Details

    • Windows
    • 7d3c2da9f (dev), 83bbc685a (6.10), 469c3cbc6 (6.9), 074273fca (tqtc/lts-6.8)

    Description

      This bug already exists, but there is no reaction to my comment:

      https://bugreports.qt.io/browse/QTBUG-39928

       

          // not working
          Rectangle {
              anchors.horizontalCenter: parent.horizontalCenter
              anchors.bottom: parent.bottom
              width: parent.width
              height: 200
              color: '#00000000'
              // color: '#0040e0d0' // not working
              gradient: Gradient {
                  orientation: Gradient.Horizontal
                  GradientStop { position: 0.00; color: '#ffcbf7c5' }
                  GradientStop { position: 0.50; color: '#4dffffff' }
                  GradientStop { position: 1.00; color: '#ffe6f1df' }
              }
          } 

      At the moment we have to use this ugly workaround where we set the color to empty string when there is a gradient.

      color: widget.gradient ? '' : widget.color             
      gradient:  widget.gradient

      The documentation clearly states "If both a color and a gradient are specified, the gradient is used"

       

      Attachments

        1. gradient.zip
          5 kB
          Martin Aumair
        For Gerrit Dashboard: QTBUG-134403
        # Subject Branch Project Status CR V

        Activity

          People

            poikelin Joni Poikelin
            amartin Martin Aumair
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes