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

Update Rectangle gradient code example

    XMLWordPrintable

Details

    • DaVinci 100

    Description

      Currently in the Rectangle gradient property section, the code example for creating a horizontal gradient uses the rotation property and not the Gradient orientation property. This could be misleading to the user as it gives the impression that the rectangle needs to be rotated in order to create a horizontal gradient. 

      https://doc.qt.io/qt-6/qml-qtquick-rectangle.html#gradient-prop

      The suggestion is to update the horizontal gradient example or add another example which demonstrates the use of the Gradient orientation property to create a horizontal gradient.

      Rectangle {
          y: 200; width: 80; height: 80
          gradient: Gradient {
              orientation: Gradient.Horizontal
              GradientStop { position: 0.0; color: "lightsteelblue" }
              GradientStop { position: 1.0; color: "blue" }
          }
      } 

      Attachments

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

        Activity

          People

            andreas.eliasson Andreas Eliasson
            lysandra.sola Lysandra Sola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes