Important: Please read the Qt Code of Conduct -

LinearGradient "end" property getting ignored

  • Trying the example under LinearGradient here:

    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).

Log in to reply