How to implement mouse gesture by qt
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 think Qt already have framework for mouse gesture .see here
Although I cannot make use of the knowledge there due to a lack of Qt programming experience ,but I still think it can helps us simplify the mouse gesture program design.
please forgive my greedy request ,can you give me an code example ?
I googled such gesture examples on Qt4 ,but hard to find one ,so your help will be greatly appreciated !
thanks inadvance !
You can take a look at "this":http://qt-project.org/forums/viewthread/18613/ thread, there are some links for tutorials and implementations.
You need to subclass "QGestureRecognizer":http://qt-project.org/doc/qt-5.0/qtwidgets/qgesturerecognizer.html class and create a custom gesture to handle the required effect.