开发者

How do I create a rotating cube effect in Qt?

开发者 https://www.devze.com 2023-01-17 12:39 出处:网络
I have a QGraphicsView and a slide show of QGraphicsScenes, at the moment when the user switches to the next slide I just change the Scene that the View is looking at and it changes instantly to refle

I have a QGraphicsView and a slide show of QGraphicsScenes, at the moment when the user switches to the next slide I just change the Scene that the View is looking at and it changes instantly to reflect that.

What I would like to do it create some transition effects, such as the rotating cube or the slide in/out.

However looking at the QPropertyAnimation class it seems to be about moving an object not transitioning from one to another.

As in I would need a view for each scen开发者_如何学Ce and then transition between each view.

What other strategy could I employ?


Instead of changing the scene that the view sees, you could use property animations to slide graphic items in and out of the view from a single scene. That would give you the slide in/out transition without too much effort. The rotating cube effect would be trickier but I think a reasonable facsimile could be produced with property animations.

You could also simulate other effects by subclassing the view widget and adding some custom properties that you could animate and use to direct background or foreground painting.

0

精彩评论

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