[SOLVED] how to dynamic assign a value to qml item's property transform



  • the transform property in item is read-only, i cannot change this value while the program is running. Is there any method to modify it.



  • You can modify only properties of Rotation, Scale and Translate objects. For example, if you got:

    @
    Image {
    id: img
    source: "pics/qt.png"
    transform: Rotation { id: rot; origin.x: 30; origin.y: 30; axis { x: 0; y: 1; z: 0 } angle: 72 }
    }
    @

    it is possible to change it like that:

    @
    rot.origin.x = 40
    @



  • thanks very much, your answer can help me to resolve my problem


Log in to reply
 

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