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. Controlling Flickable with 2 fingers
Forum Updated to NodeBB v4.3 + New Features

Controlling Flickable with 2 fingers

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 606 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.
  • DuBuD Offline
    DuBuD Offline
    DuBu
    wrote on last edited by
    #1

    Hi all,

    is there a way I can tell the Flickable QML component to be scrolled/flicked by two or more fingers? If not natively, how could one achieve this?

    Best!

    KH-219DesignK 1 Reply Last reply
    0
    • DuBuD DuBu

      Hi all,

      is there a way I can tell the Flickable QML component to be scrolled/flicked by two or more fingers? If not natively, how could one achieve this?

      Best!

      KH-219DesignK Offline
      KH-219DesignK Offline
      KH-219Design
      wrote on last edited by
      #2

      @DuBu I have never attempted what you describe, but it seems like a good feature. I am intrigued.

      Maybe you can simply constrain the existing scroll feature to only operate when two touchpoints are active? This seems risky though. I feel that if I were to attempt this I would probably create a bad user experience.

      Apparently this is also called "two finger panning" (in case that helps your searching).


      Ahhhhhhh....

      OK. Based on my own further searching (due to insatiable curiosity)...

      It seems that if the operating system (OS) is configured properly, then (in some cases?) Qt will make this "just work", but in the GUI app you will not necessarily know that a two-finger scroll (or two-finger pan gesture) is happening. It will have been translated into some other mouse action. That's at least the rough idea I get from looking at this: https://stackoverflow.com/questions/70037430/qt-how-to-implement-panning-zooming-in-qgraphicsscene-with-two-finger-gestures


      Just in case, you might want to look at the multitouch examples:

      ▶ https://github.com/qt/qtdeclarative/blob/dev/examples/quick/pointerhandlers/multiflame.qml

      (Qt5 had one called "bearwhack" which seems removed in qt6, perhaps for reasons of cruelty-to-cartoon-animals ?) https://github.com/qt/qtdeclarative/tree/5.15/examples/quick/touchinteraction/multipointtouch

      ▶ https://doc.qt.io/qt-6/qtquick-touchinteraction-example.html

      There seems to be a QML Gesture (https://doc.qt.io/qt-6/qml-qtquick-gestureevent.html), but at least in the online doc it doesn't appear to have nearly the number of members that (non-qml) QGestureEvent has: https://doc.qt.io/qt-6/qgestureevent.html

      www.219design.com
      Software | Electrical | Mechanical | Product Design

      DuBuD 1 Reply Last reply
      0
      • KH-219DesignK KH-219Design

        @DuBu I have never attempted what you describe, but it seems like a good feature. I am intrigued.

        Maybe you can simply constrain the existing scroll feature to only operate when two touchpoints are active? This seems risky though. I feel that if I were to attempt this I would probably create a bad user experience.

        Apparently this is also called "two finger panning" (in case that helps your searching).


        Ahhhhhhh....

        OK. Based on my own further searching (due to insatiable curiosity)...

        It seems that if the operating system (OS) is configured properly, then (in some cases?) Qt will make this "just work", but in the GUI app you will not necessarily know that a two-finger scroll (or two-finger pan gesture) is happening. It will have been translated into some other mouse action. That's at least the rough idea I get from looking at this: https://stackoverflow.com/questions/70037430/qt-how-to-implement-panning-zooming-in-qgraphicsscene-with-two-finger-gestures


        Just in case, you might want to look at the multitouch examples:

        ▶ https://github.com/qt/qtdeclarative/blob/dev/examples/quick/pointerhandlers/multiflame.qml

        (Qt5 had one called "bearwhack" which seems removed in qt6, perhaps for reasons of cruelty-to-cartoon-animals ?) https://github.com/qt/qtdeclarative/tree/5.15/examples/quick/touchinteraction/multipointtouch

        ▶ https://doc.qt.io/qt-6/qtquick-touchinteraction-example.html

        There seems to be a QML Gesture (https://doc.qt.io/qt-6/qml-qtquick-gestureevent.html), but at least in the online doc it doesn't appear to have nearly the number of members that (non-qml) QGestureEvent has: https://doc.qt.io/qt-6/qgestureevent.html

        DuBuD Offline
        DuBuD Offline
        DuBu
        wrote on last edited by
        #3

        @KH-219Design Hi, thanks for your effort to answer my question. I'll have a look at your links.
        Regarding the bad user experience: I also don't like to scroll with only two fingers much, but I need the one finger gesture to move something on top of the flickable without scrolling the flickable at the same time.

        KH-219DesignK 1 Reply Last reply
        0
        • DuBuD DuBu

          @KH-219Design Hi, thanks for your effort to answer my question. I'll have a look at your links.
          Regarding the bad user experience: I also don't like to scroll with only two fingers much, but I need the one finger gesture to move something on top of the flickable without scrolling the flickable at the same time.

          KH-219DesignK Offline
          KH-219DesignK Offline
          KH-219Design
          wrote on last edited by
          #4

          @DuBu I'll be curious to know what kind of fix you might devise in the end.

          To clarify my "bad user experience" remark: I did not actually intend to disparage the general idea of two-finger scroll. I was saying that if I tried to implement it myself from scratch I feel like I would easily implement it poorly. The more I think about what the touchpad driver would even be doing to distinguish two fingers scrolling from two fingers rotating or pinching, it makes my head hurt.

          www.219design.com
          Software | Electrical | Mechanical | Product Design

          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