Animation: what is better gpu wise?



  • Hello,

    What is better, as far as gpu is involved?
    This code is silly ans useless but makes the point.

    1st solution:

    Item{
       x: 0
       ...
       MouseArea{
           anchors.fill: parent
           onClicked:{
              another_item.x = 0
       }
    }
    

    2nd:

    Item{
    id: my_item
       x: 0
      state: "init"
       ...
       MouseArea{
           anchors.fill: parent
           onClicked:{
              another_item.state = "move_it"
       }
    }
    
    
        states: [
            State {
                name: "init"
                PropertyChanges { target: another_item; x: 0}
            },
            State {
                name: "move_it"
                PropertyChanges { target: another_item; x: somewhere}
            }
        ]
    

    The question is:
    Is it better to set things in javascript (blah.x = 0) or by states (blash.state = "new_state") for performance and fluidity?

    My tests reveal no difference but I may be wrong.


Log in to reply
 

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