Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. How to implement mouse gesture by python or pyqt ?
Forum Updated to NodeBB v4.3 + New Features

How to implement mouse gesture by python or pyqt ?

Scheduled Pinned Locked Moved Language Bindings
5 Posts 2 Posters 7.8k 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
    redstoneleo
    wrote on 8 Jan 2013, 00:44 last edited by
    #1

    It would be better to give me some examples .thanks in advance !

    P.S. which module or lib are needed ?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      redstoneleo
      wrote on 9 Jan 2013, 03:04 last edited by
      #2

      what I wanna perhaps like this:
      when a right mouse button is pressed and we go down and right with a cursor. As in letter 'L'. Our mouse gesture will close the window.
      I googled such gesture examples on PyQt4 ,but hard to find one ,so your help will be greatly appreciated !
      thanks inadvance !

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jazzycamel
        wrote on 9 Jan 2013, 11:58 last edited by
        #3

        Johan Thelin wrote a really nice example of this (in C++) for Qt Quarterly back in 2006: "Recognizing Mouse Gestures":http://doc.qt.digia.com/qq/qq18-mousegestures.html. I've created a Python/PyQt port of this but as its 350+ lines I've posted it on my "blog":http://www.gulon.co.uk/2013/01/09/recognising-mouse-gestures-with-pyqt4/ rather than here.

        Hope this helps.

        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
          redstoneleo
          wrote on 10 Jan 2013, 01:31 last edited by
          #4

          [quote author="jazzycamel" date="1357732711"]Johan Thelin wrote a really nice example of this (in C++) for Qt Quarterly back in 2006: "Recognizing Mouse Gestures":http://doc.qt.digia.com/qq/qq18-mousegestures.html. I've created a Python/PyQt port of this but as its 350+ lines I've posted it on my "blog":http://www.gulon.co.uk/2013/01/09/recognising-mouse-gestures-with-pyqt4/ rather than here.

          Hope this helps.[/quote]

          Thanks very very very much jazzycamel.Your help is greatly appreciated.
          But I think Qt already have framework for mouse gesture .see here
          http://doc.qt.digia.com/qt/gestures-overview.html
          Although I cannot make use of the knowledge there due to a lack of PyQt programming experience ,but I still think it can helps us simplify the mouse gesture program design.
          please forgive my greedy request ,can you give a another version by using the knowledge aforementioned .thanks in advance !

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jazzycamel
            wrote on 14 Jan 2013, 10:27 last edited by
            #5

            I am aware of the existence of QGesture, QGestureRecognizer etc., the example (and my Python port) probably predates this framework, I did create it sometime ago and only refreshed it in response to your original request for an example.

            In response to your subsequent request I have created an example with almost equivalent functionality using the newer methods. As before, it can be found on my blog "here":http://www.gulon.co.uk/2013/01/14/pyqt4-mouse-gestures-part-deux/.

            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

            1/5

            8 Jan 2013, 00:44

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved