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. [SOLVED] Flickable.flick() doesn't work
Qt 6.11 is out! See what's new in the release blog

[SOLVED] Flickable.flick() doesn't work

Scheduled Pinned Locked Moved QML and Qt Quick
qt quickflickable
4 Posts 3 Posters 3.9k 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.
  • L Offline
    L Offline
    Leonardo
    wrote on last edited by Leonardo
    #1

    Hello. I would like to slide the content of a Flickable control programmatically. Based on the documentation, I believe the flick() method is the one I need.

    http://doc.qt.io/qt-5/qml-qtquick-flickable.html#flick-method

    But it doesn't work. I can move the content perfectly dragging it with the mouse, but not when I call this method. Let's say I want to move it vertically. I try:

    myFlickable.flick(0, 10);
    

    And nothing happens. No error, no movement. What's wrong?

    Thank you.

    p3c0P 1 Reply Last reply
    0
    • L Leonardo

      Hello. I would like to slide the content of a Flickable control programmatically. Based on the documentation, I believe the flick() method is the one I need.

      http://doc.qt.io/qt-5/qml-qtquick-flickable.html#flick-method

      But it doesn't work. I can move the content perfectly dragging it with the mouse, but not when I call this method. Let's say I want to move it vertically. I try:

      myFlickable.flick(0, 10);
      

      And nothing happens. No error, no movement. What's wrong?

      Thank you.

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

      @Leonardo flick function takes value in pixels/sec. Flicking 10 pixels/sec will be hardly noticeable. Try some higher values. Also note that you may need to provide positive or negative value for it depending upon the direction.

      157

      1 Reply Last reply
      0
      • L Offline
        L Offline
        Leonardo
        wrote on last edited by
        #3

        Hi. I've tried higher values and saw some movement. Then I realized that deceleration was acting on it. I thought the speed would be constant. Now I'm setting flickDeceleration to zero before calling the method and restoring it to its default value when I'm done. It works nicely.

        Thank you for your help.

        S 1 Reply Last reply
        0
        • L Leonardo

          Hi. I've tried higher values and saw some movement. Then I realized that deceleration was acting on it. I thought the speed would be constant. Now I'm setting flickDeceleration to zero before calling the method and restoring it to its default value when I'm done. It works nicely.

          Thank you for your help.

          S Offline
          S Offline
          Shubham Gupta
          wrote on last edited by
          #4

          @Leonardo
          Can u tell me what value u passed inside method.

          Actually i have ListView in horizontal direction. on Passing flick(0,-100) it moves in upward direction but is should be moved in Left or right direction. So, what values should be passed for doing this.

          Shubham Gupta

          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