Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. LinearGradient "end" property getting ignored
Qt 6.12 LTS is out! See what's new in the release blog

LinearGradient "end" property getting ignored

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 642 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • vikramgV Offline
    vikramgV Offline
    vikramg
    wrote on last edited by
    #1

    Trying the example under LinearGradient here:

    http://doc.qt.io/qt-5/qml-qtgraphicaleffects-lineargradient.html

    using qmlscene, and it seems as though the "end" property takes no effect. I am unable to verify the output shown on that page with the angled gradient (with end: Qt.point(300, 300)). I get a vertical gradient no matter what values I try for the end point. What's going on here? Here's the code I'm trying (just copied from the link above):

    import QtQuick 2.0
    import QtGraphicalEffects 1.0
    
    Item {
        width: 300
        height: 300
    
        LinearGradient {
            anchors.fill: parent
            start: Qt.point(0, 0)
            //end: Qt.point(0, 300)
            end: Qt.point(300, 300)
            gradient: Gradient {
                GradientStop { position: 0.0; color: "white" }
                GradientStop { position: 1.0; color: "black" }
            }
        }
    }
    

    I'm using Qt 5.6 (although qmlscene from 5.5 shows the same thing).

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt
    • Unsolved