开发者

How to add a QPixmap to QGraphicsView that is static?

开发者 https://www.devze.com 2023-03-06 20:35 出处:网络
hope someone of you can help me. I have a QGraphicsView, that is displaying a jpeg. The jpeg is much bigger than the QGraphicsView, so you can drag the jpeg (with the mouse). Over that jpeg I want to

hope someone of you can help me. I have a QGraphicsView, that is displaying a jpeg. The jpeg is much bigger than the QGraphicsView, so you can drag the jpeg (with the mouse). Over that jpeg I want to add a QPixmap. But this QPixmap needs to be static. If I move the jpeg, the开发者_运维知识库 QPixmap needs to always on the same position. With a QLabel that has only text, it isn't a problem. But if I set a QPixmap to the QLabel, it isn't displayed. How can I solve my problem? Does anyone have an idea?

Best, Oli


You may try to subclass QGraphicsScene and reimplement drawBackground method to display your static QPixmap.

0

精彩评论

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