开发者

qt- how to move a picture in a slow motion

开发者 https://www.devze.com 2023-01-05 08:05 出处:网络
I am trying to move a picture slowly from one position to another in QGraphicsScene. So I tried to use sleep, after that much o开发者_如何学Cf milli seconds I tried \"setPos\". But is not doing as I t

I am trying to move a picture slowly from one position to another in QGraphicsScene. So I tried to use sleep, after that much o开发者_如何学Cf milli seconds I tried "setPos". But is not doing as I thought. Some body please help me


sleep() is never what you want in an UI thread, as it blocks everything. Have a look at QGraphicsItemAnimation (setPosAt()) and QTimeLine.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号