self.setViewportUpdateMode(QGraphicsView.FullViewportUpdate)
时间: 2024-06-01 19:12:11 浏览: 74
Qt plugin+QGraphicsView
As an AI language model, I don't have access to the full context of your code, but generally speaking, the line "self.setViewportUpdateMode(QGraphicsView.FullViewportUpdate)" sets the update mode for a QGraphicsView object to "FullViewportUpdate".
In QGraphicsView, the viewport is the widget that displays the contents of the scene. The update mode determines how the viewport updates itself when the scene changes.
The FullViewportUpdate mode means that the entire viewport will be updated every time the scene changes, regardless of the size or location of the changes. This can be more computationally expensive than other update modes, but ensures that the viewport always shows an accurate representation of the scene.
Other possible update modes include MinimalViewportUpdate (only updates the part of the viewport that has changed), BoundingRectViewportUpdate (updates the bounding rectangle of the changes), and SmartViewportUpdate (a combination of Full and BoundingRect modes).
阅读全文