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. QtQuick Flickable kinetic movement
QtWS25 Last Chance

QtQuick Flickable kinetic movement

Scheduled Pinned Locked Moved QML and Qt Quick
8 Posts 3 Posters 3.2k 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.
  • P Offline
    P Offline
    Peppy
    wrote on last edited by
    #1

    How to make (using Flickable) kinetic movement of any item on scene? I mean object is able to move (with inertia) although mouse/touch are gone...

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Did you try flickDeceleration (property of Flickable)?

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Peppy
        wrote on last edited by
        #3

        No, I will look at that...

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Peppy
          wrote on last edited by
          #4

          Hmm... I am thinking wrong (again)... I can't move with rectangle inside flickable element (what am I doing wrong?!)
          @

          // Nothing really happens
          Flickable
          {
          id: flickable
          boundsBehavior: Flickable.DragAndOvershootBounds
          flickDeceleration: 0.5
          contentHeight: rect.height
          contentWidth: rect.width

          Rectangle
          {
                id: rect
          
                width: 60
                height: 60
          
               color: "red"
          }
          

          }
          @

          Well I think, I am thinking wrong once again ... flickable is just working inside the area of flickable, but not outside??

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mbrasser
            wrote on last edited by
            #5

            Hi,

            I'm not sure if I understand exactly what you are after, but adding a width and height to the Flickable, e.g.

            @width: 400; height: 400@

            should make it possible to flick the Rectangle. If you want to flick the Rectangle, and not have it snap back to its original position, you can use a larger contentWidth and contentHeight and play around with the positioning/hierarchy/etc, e.g.

            @Flickable
            {
            id: flickable
            width: 400; height: 400
            boundsBehavior: Flickable.DragAndOvershootBounds
            contentWidth: 740; contentHeight: 740

            Rectangle
            {
                id: rect
            
                width: 60
                height: 60
                x: 340; y: 340
            
                color: "red"
            }
            

            }@

            Regards,
            Michael

            1 Reply Last reply
            0
            • P Offline
              P Offline
              Peppy
              wrote on last edited by
              #6

              The problem is I can't have Flickable through the whole scene because there are also other active objects...hmm... I just want to move that rectangle on scene, but not to affect other objects...

              okay that flicking is working, but it means Flickable is just an area, where I can flick?...

              1 Reply Last reply
              0
              • M Offline
                M Offline
                mbrasser
                wrote on last edited by
                #7

                [quote author="Peppy" date="1342210863"]okay that flicking is working, but it means Flickable is just an area, where I can flick?...[/quote]

                Yes, that sounds correct.

                You might be able to get something working using the Flickable in a non-traditional manner, for example overlaying the scene with a Flickable with the Flick dynamics you are looking for, and then binding the Rectangle's position based on contextX/contentY (rather than the Rectangle being a child of the Flickable).

                Regards,
                Michael

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  Peppy
                  wrote on last edited by
                  #8

                  I thought, the Flickable is container that allows to move with the object inside over the scene.

                  Yes, I am looking for kinetic movement with inertia...

                  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