Quantcast
Channel: Installation and Deployment
Viewing all articles
Browse latest Browse all 22112

Smooth Dragging of Items

$
0
0
I’m trying to use the mouse to drag a series of items all at the same time. So far, I have overriden the mousePressEvent, mouseMoveEvent, and mouseReleaseEvent in order to provide a nice way of dragging everything. However, now I want to incorporate a smooth slowdown of the items when the mouse button is released, instead of an abrupt stop. To do this, I’ve calculated the velocity of the items. However, I’m not exactly sure how to continually move the items in that direction and decay the velocity until it reaches ~0. Is there any type of animation that can do this, or should I look into timers of some sort?

Viewing all articles
Browse latest Browse all 22112

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>