How to flip an image in Qt?

女生的网名这么多〃 提交于 2019-12-23 04:53:31

问题


I found that video on Youtube. It shows how to flip something called QML Flipable. I'm completely unfamiliar with QML so I have the following questions:

1) Is it possible to flip an ordinary QLabel like this? If yes how do I do that?

2) If it's not possible then how do I add that Flipable entity to my QMainWindow?

Thanks, everyone


回答1:


You could use the QGraphicsPixmap with your image , set the rotation center with setTransformOriginPoint and animate the transformation matrix with QProertyAnimation




回答2:


There's no convenient way to do this. Desktop OS's don't provide this functionality.

One option is to use QGraphicsView. You can add widgets to a QGraphicsScene using QGraphicsScene::addWidget(), for example, and then transform the view the way you want.




回答3:


Quick google search points me to a blog article where author of the video (Kunal Parmar) describing how this particular effect was done.



来源:https://stackoverflow.com/questions/13217380/how-to-flip-an-image-in-qt

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!