Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Record a mouse movement
Is there a good method to record a cursor movement?. After recording it will be used to select an object that is circled by that movement.
lgeyer last edited by
An immediate solution that comes into mind is to push points into a QPolygon in the mouseMoveEvent(). You can then use containsPoint() or get the boundingRect() to determine which object has been selected.
QRubberBand might be another alternative if you are not bound to the circling gesture.
Thank you very much, I will explore more.
butterface last edited by
I am not quite sure if this only works with touch screens or if they will be recognised from mouse movement as well but if so you should have a look at "QGesture":http://qt-project.org/doc/qt-4.8/qgesture.html
I already read the help of QGesture, may be this will be the solution, thank you for advice. Is there any other tutorial about QGesture especially creating a custom Gesture?
Thank you in advance
Sam last edited by
You can have a look on "this":http://qt-project.org/forums/viewthread/18613/ thread.
dscyw last edited by
QpanGestureˊs delta property maybe helpful."Click here":http://qt-project.org/doc/qt-5/qpangesture.html