Regarding Z-order in QML



  • How would i increase the z-order of an image dynamically ? I tried by increasing z ,but didn't work . any other way of doing it so that i can manually control Z-order of two images when a state gets changed ?

    Thanks
    Krishkn



  • Are those two elements siblings? Could you post an excerpt of your qml code?



  • z works. in most of cases) so, the code



  • Z-order works for me, a simple sample

    @
    import Qt 4.7

    Item {
    width: 200
    height: 200

    Rectangle {
        id: red
        z: 1
        color: "red"
        width: 100; height: 100
    
        MouseArea {
            anchors.fill: parent
            onClicked: red.z = blue.z + 1
        }
    
    }
    
    Rectangle {
        id: blue
        color: "blue"
        x: 50; y: 50; width: 100; height: 100
    
        MouseArea {
            anchors.fill: parent
            onClicked: blue.z = red.z + 1
        }
    }
    

    }
    @


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.