(self, *items)
Resize an image for the current row height.
Resize an image for the current row height.
Resize an image for the current row height .
def _resizeImages(self, *items):
        """Resize an image for the current row height."""
        for item in (items or self._itemList):
            if item is None:
                continue

            new_width = self._gridSize * self._itemList[item]['aspect']
            new_size = QtCore.QSize(new_width, self._gridSize)

            #Redraw the icon
            if self._itemList[item]['original_icon_size'] is not None:
                too_short = self._itemList[item]['original_icon_size'].height() < self._gridSize
                too_thin = self._itemList[item]['original_icon_size'].width() < self._gridSize * self._itemList[item]['aspect']
                if too_short or too_thin:
                    pixmap = self._itemList[item]['original_icon'].pixmap(self._itemList[item]['original_icon_size']).scaledToHeight(self._gridSize)
                    item._autoGridOriginalSetIcon(QtGui.QIcon(pixmap))

            item.setIconSize(new_size)
            item.setFixedSize(new_size)
            self._itemList[item]['width'] = new_width
            self._itemList[item]['height'] = self._gridSize
            self.setMinimumWidth(new_width)
def _resizeImages ( self , * items ) : for item in ( items or self . _itemList ) : if item is None : continue new_width = self . _gridSize * self . _itemList [ item ] [ 'aspect' ] new_size = QtCore . QSize ( new_width , self . _gridSize ) #Redraw the icon if self . _itemList [ item ] [ 'original_icon_size' ] is not None : too_short = self . _itemList [ item ] [ 'original_icon_size' ] . height ( ) < self . _gridSize too_thin = self . _itemList [ item ] [ 'original_icon_size' ] . width ( ) < self . _gridSize * self . _itemList [ item ] [ 'aspect' ] if too_short or too_thin : pixmap = self . _itemList [ item ] [ 'original_icon' ] . pixmap ( self . _itemList [ item ] [ 'original_icon_size' ] ) . scaledToHeight ( self . _gridSize ) item . _autoGridOriginalSetIcon ( QtGui . QIcon ( pixmap ) ) item . setIconSize ( new_size ) item . setFixedSize ( new_size ) self . _itemList [ item ] [ 'width' ] = new_width self . _itemList [ item ] [ 'height' ] = self . _gridSize self . setMinimumWidth ( new_width )