Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Separating x/y components of pinch gesture
Qt 6.11 is out! See what's new in the release blog

Separating x/y components of pinch gesture

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 1.2k Views 1 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.
  • espocjoE Offline
    espocjoE Offline
    espocjo
    wrote on last edited by
    #1

    Hi guys.
    Making a mobile application where the user will be interacting with a graph (zooming, scaling).
    I thought the most intuitive way to do this would be through a QPinchGesture, but have found that it does not allow the x/y components to be considered separately natively.

    Does anyone know a class that can handle them separately, or alternatively is there a simple way to get around this?
    Could I capture the x/y positions from the individual QGestureEvents (or QEvents) and use that to determine whether the user is trying to scale in x or y?

    Thanks,
    ~Chris

    jsulmJ 1 Reply Last reply
    0
    • espocjoE espocjo

      Hi guys.
      Making a mobile application where the user will be interacting with a graph (zooming, scaling).
      I thought the most intuitive way to do this would be through a QPinchGesture, but have found that it does not allow the x/y components to be considered separately natively.

      Does anyone know a class that can handle them separately, or alternatively is there a simple way to get around this?
      Could I capture the x/y positions from the individual QGestureEvents (or QEvents) and use that to determine whether the user is trying to scale in x or y?

      Thanks,
      ~Chris

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @espocjo Why do you need it? Do you want to resize only one axis? This would change the aspect ratio.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      espocjoE 1 Reply Last reply
      0
      • E Offline
        E Offline
        Eligijus
        wrote on last edited by
        #3

        const QList< QTouchEvent::TouchPoint > &QTouchEvent::touchPoints() const
        http://doc.qt.io/qt-5/qtouchevent.html#touchPoints

        You get a list of touch points(fingers touching the screen) and you can check touchpoint x/y by calling pos() method.

        1 Reply Last reply
        0
        • jsulmJ jsulm

          @espocjo Why do you need it? Do you want to resize only one axis? This would change the aspect ratio.

          espocjoE Offline
          espocjoE Offline
          espocjo
          wrote on last edited by
          #4

          @jsulm said in Separating x/y components of pinch gesture:

          @espocjo Why do you need it? Do you want to resize only one axis? This would change the aspect ratio.

          It's for plotting. You want to be able to change the aspect ratio. :)

          @Eligijus said in Separating x/y components of pinch gesture:

          const QList< QTouchEvent::TouchPoint > &QTouchEvent::touchPoints() const
          http://doc.qt.io/qt-5/qtouchevent.html#touchPoints

          You get a list of touch points(fingers touching the screen) and you can check touchpoint x/y by calling pos() method.

          Thanks. I'll look into that this afternoon.

          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