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

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8.2, 6.9.0
    • Quick: SceneGraph
    • None
    • 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

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

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes