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

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
  • 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 18 Apr 2015, 22:39 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.

    P 1 Reply Last reply 19 Apr 2015, 06:12
    0
    • S svyatoslav911512
      18 Apr 2015, 22:39

      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.

      P Offline
      P Offline
      p3c0
      Moderators
      wrote on 19 Apr 2015, 06:12 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 19 Apr 2015, 12:27
      1
      • P p3c0
        19 Apr 2015, 06:12

        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 19 Apr 2015, 12:27 last edited by
        #3

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

        P 1 Reply Last reply 19 Apr 2015, 13:40
        0
        • S svyatoslav911512
          19 Apr 2015, 12:27

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

          P Offline
          P Offline
          p3c0
          Moderators
          wrote on 19 Apr 2015, 13:40 last edited by
          #4

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

          157

          1 Reply Last reply
          0

          1/4

          18 Apr 2015, 22:39

          • Login

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