Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Unsolved Animation: what is better gpu wise?

    Mobile and Embedded
    1
    1
    240
    Loading More Posts
    • 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.
    • J
      JulienD last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post