(self, pixmap)
Set the pixmap and store information for resizing.
Set the pixmap and store information for resizing.
Set the pixmap and store information for resizing .
def setPixmap(self, pixmap):
        """Set the pixmap and store information for resizing."""
        if isinstance(pixmap, str):
            pixmap = QtGui.QPixmap(pixmap)
        self._pixmapOriginal = pixmap
        self._pixmapWidth = pixmap.width()
        self._pixmapHeight = pixmap.height()
        self._pixmapAspect = self._pixmapWidth / self._pixmapHeight
        self._pixmapImage = None

        #Cancel if the pixmap is empty
        if not self._pixmapWidth or not self._pixmapHeight:
            self._pixmapOriginal = None
            self.sizePolicy().setHeightForWidth(False)
            return

        self.sizePolicy().setHeightForWidth(True)

        super(QResizableImage, self).setPixmap(pixmap)
def setPixmap ( self , pixmap ) : if isinstance ( pixmap , str ) : pixmap = QtGui . QPixmap ( pixmap ) self . _pixmapOriginal = pixmap self . _pixmapWidth = pixmap . width ( ) self . _pixmapHeight = pixmap . height ( ) self . _pixmapAspect = self . _pixmapWidth / self . _pixmapHeight self . _pixmapImage = None #Cancel if the pixmap is empty if not self . _pixmapWidth or not self . _pixmapHeight : self . _pixmapOriginal = None self . sizePolicy ( ) . setHeightForWidth ( False ) return self . sizePolicy ( ) . setHeightForWidth ( True ) super ( QResizableImage , self ) . setPixmap ( pixmap )