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

    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

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

        Activity

          People

            janichol Andy Nichols
            amartin Martin Aumair
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change