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. Custom gesture

Custom gesture

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.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.
  • R Offline
    R Offline
    romeo.rbw
    wrote on last edited by
    #1

    Hi...
    Is there any idea how to make a custom gesture for many grab points of a mouse cursor?
    If a user move a cursor like a circle, so the program recognize it for a special task.
    Now my idea is to record every mouse pixel using mousePressEvent(), and from a number of pixels I will calculate the center of the circle gesture to find its center.
    Is there any opinion to help, I appreciate your suggestion. Thank you

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Sam
      wrote on last edited by
      #2

      For custom gesture you can subclass "QGestureRecognizer":http://qt-project.org/doc/qt-5.0/qtwidgets/qgesturerecognizer.html#details class but for that you need to check for Gesture Programming Examples first.

      "Check this":http://www.developer.nokia.com/Community/Wiki/Custom_Swipe_Gestures_in_Qt

      1 Reply Last reply
      0
      • R Offline
        R Offline
        romeo.rbw
        wrote on last edited by
        #3

        Thank for suggestion, but it was for swipe. I found just now about a product like StrokeIt and mention about plugin. Is it possible using Qt and plugin, is there a suggestion and tutorial about plugin and Qt. Thanks..

        1 Reply Last reply
        0
        • jazzycamelJ Offline
          jazzycamelJ Offline
          jazzycamel
          wrote on last edited by
          #4

          There was an excellent article in Qt Quarterly by John Thelin on the subject of custom mouse gestures which you can find "here":http://doc.qt.digia.com/qq/qq18-mousegestures.html. I've produced two derivative examples of this: the "first":http://www.gulon.co.uk/2013/01/09/recognising-mouse-gestures-with-pyqt4/ mirrors John's work and the "second":http://www.gulon.co.uk/2013/01/14/pyqt4-mouse-gestures-part-deux/ uses/subclasses "QGestureRecognizer":http://qt-project.org/doc/qt-5.0/qtwidgets/qgesturerecognizer.html#details (as mentioned by Sam). They are written in/for Python/PyQt4 but the general principles and mechanisms are relevant to Qt whatever the language.

          Hope this helps ;o)

          For the avoidance of doubt:

          1. All my code samples (C++ or Python) are tested before posting
          2. As of 23/03/20, my Python code is formatted to PEP-8 standards using black from the PSF (https://github.com/psf/black)
          1 Reply Last reply
          0
          • R Offline
            R Offline
            romeo.rbw
            wrote on last edited by
            #5

            Thank you very much for the references... This is very helpful... :)

            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