def __init__(self, pixmapPath, parent=None): super(GraphicsPixmapWidget, self).__init__(parent) self.setCacheMode(self.ItemCoordinateCache) self._pixmap = QtWidgets.QGraphicsPixmapItem(QtGui.QPixmap(pixmapPath)) self._pixmapSize = QtCore.QSizeF() self.setSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
def setPixmap(self, path): self.pixmap = QtGui.QPixmap(path) self.pixItem = QtWidgets.QGraphicsPixmapItem(self.pixmap, self)
def __init__(self, pixmap, parent): super(HeaderPixmap, self).__init__(parent) self.setPixmap(pixmap) self.pixmap = QtGui.QPixmap() self.pixItem = QtWidgets.QGraphicsPixmapItem()