Python QLabel大小未在QGRAPHICSCENE scale上更新

Python QLabel大小未在QGRAPHICSCENE scale上更新,python,qt,pyqt,qt4,Python,Qt,Pyqt,Qt4,我想在pyqt中使用QGraphicsView和QLabel垂直显示一些图像 我正在使用scale方法缩放QGraphicsView。问题是,当我缩放(放大)QGraphicsView标签的大小时,标签没有更新,因此当我缩放QGraphicsView并再次设置标签的pixmap时,结果图像质量很差 这是我的密码: my_graphics_view = QtGui.QGraphicsView() scene = QtGui.QGraphicsScene() graphics_widget = Qt

我想在pyqt中使用
QGraphicsView
QLabel
垂直显示一些图像

我正在使用
scale
方法缩放
QGraphicsView
。问题是,当我缩放(放大)
QGraphicsView
标签的大小时,标签没有更新,因此当我缩放
QGraphicsView
并再次设置标签的pixmap时,结果图像质量很差

这是我的密码:

my_graphics_view = QtGui.QGraphicsView()
scene = QtGui.QGraphicsScene()
graphics_widget = QtGui.QGraphicsWidget()
layout = QtGui.QGraphicsLinearLayout(QtCore.Qt.Vertical)
default_size = QtCore.QSize(400 , 400)
for number in xrange(num_pages):
    lbl = QtGui.QLabel()
    lbl.setMinimumSize(default_size)
    lbl.setStyleSheet("background-color : white")
    lbl.setContentsMargins(0, 0, 0, 0)
    lbl.setScaledContents(True)
    widget = scene.addWidget(lbl)
    layout.addItem(widget)
graphics_widget.setLayout(layout)
scene.addItem(graphics_widget)
my_graphics_view.setScene(scene)
my_graphics_view.show()