class MyGraphicsView(QGraphicsView):
def __init__(self):
super(MyGraphicsView, self).__init__()
scene = QGraphicsScene(self)
self.tic_tac_toe = TicTacToe()
scene.addItem(self.tic_tac_toe)
self.m = QPixmap("exit.png")
scene.addPixmap(self.m)
self.setScene(scene)
self.setCacheMode(QGraphicsView.CacheBackground)
self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
巴布亚新几内亚已经存在了。在屏幕上显示滚动条时要增加它的大小?在
目的是要有一个按钮,点击这个按钮,图片的大小应该会增加。在
您必须使用
setScale()
。另外,当您使用addPixmap()
时,这将返回创建的QGraphicsPixmapItem
。在此外,缩放是一种变换,因此它有一个变换原点,默认情况下是
(0, 0)
,但在这种情况下,更好的选择是将其放在图像的中心。在相关问题 更多 >
编程相关推荐