Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Connect state animation to slider or something number changing event
Forum Updated to NodeBB v4.3 + New Features

Connect state animation to slider or something number changing event

Scheduled Pinned Locked Moved QML and Qt Quick
animationstatesandroid
4 Posts 2 Posters 1.7k Views 2 Watching
  • 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.
  • S Offline
    S Offline
    svyatoslav911512
    wrote on last edited by
    #1

    Hello experts,

    Do you know if there is a way to connect PropertyChanges or something same animation to slider or another number changing event to rotate something or move using state and transitions animations but with using slider also?

    For example in Android material design we have hamburger-back button with animation which one also changing accordingly to LeftPane movement.

    Thanks for any help.

    p3c0P 1 Reply Last reply
    0
    • S svyatoslav911512

      Hello experts,

      Do you know if there is a way to connect PropertyChanges or something same animation to slider or another number changing event to rotate something or move using state and transitions animations but with using slider also?

      For example in Android material design we have hamburger-back button with animation which one also changing accordingly to LeftPane movement.

      Thanks for any help.

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi @svyatoslav911512
      You can bind Slider's value to that of Item's rotation property. For eg:

      import QtQuick 2.4
      import QtQuick.Controls 1.3
      
      Item {
          width: 200
          height: 200
      
          Slider {
              id: slider
          }
      
          Rectangle {
              width: 50
              height: 50
              color: "red"
              antialiasing: true
              anchors.centerIn: parent
              rotation: slider.value*180
          }
      }
      

      Hope I understood you correctly :)

      157

      S 1 Reply Last reply
      1
      • p3c0P p3c0

        Hi @svyatoslav911512
        You can bind Slider's value to that of Item's rotation property. For eg:

        import QtQuick 2.4
        import QtQuick.Controls 1.3
        
        Item {
            width: 200
            height: 200
        
            Slider {
                id: slider
            }
        
            Rectangle {
                width: 50
                height: 50
                color: "red"
                antialiasing: true
                anchors.centerIn: parent
                rotation: slider.value*180
            }
        }
        

        Hope I understood you correctly :)

        S Offline
        S Offline
        svyatoslav911512
        wrote on last edited by
        #3

        @p3c0 It's looking very easy. I just started to learn QtQuick and will try this exmplae, thank you!

        p3c0P 1 Reply Last reply
        0
        • S svyatoslav911512

          @p3c0 It's looking very easy. I just started to learn QtQuick and will try this exmplae, thank you!

          p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          @svyatoslav911512 You can read more about property binding here. Happy coding..

          157

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved