def __init__(self): QDialog.__init__(self) # Define the instance that handles all the # Image processing functionality. self._thumbnailMaker = ThumbnailMaker(self) # Define the instance to access the the UI elements defined in # class Ui_ThumbnailMakerDialog. self._dialog = Ui_ThumbnailMakerDialog() self._dialog.setupUi(self) self._dialog.retranslateUi(self) # Initialize some other variables. self._filePath = '' self._dirPath = '' # Aspect ratio checkbox is checked by default. self.maintainAspectRatio = True #Graphics scene for right hand panel. # see self._previiewImage() for details. self._graphicsScene = QGraphicsScene() # Connect slots with signals. self._connect() # Show the dialog. self.show()
class CoverView(QGraphicsView, ImageDropMixin): # {{{ cover_changed = pyqtSignal(object) def __init__(self, *args, **kwargs): QGraphicsView.__init__(self, *args, **kwargs) ImageDropMixin.__init__(self) def get_pixmap(self): for item in self.scene.items(): if hasattr(item, 'pixmap'): return item.pixmap() def set_pixmap(self, pmap): self.scene = QGraphicsScene() self.scene.addPixmap(pmap) self.setScene(self.scene)
def set_pixmap(self, pmap): self.scene = QGraphicsScene() self.scene.addPixmap(pmap) self.setScene(self.scene)