def setupBusyIcon(self): busyWidget = QtGui.QWidget() layout = QtGui.QVBoxLayout(busyWidget) busy = WImageLabel() busy.setMovie(self.busyMovie) layout.addWidget(busy) layout.setAlignment(QtCore.Qt.AlignCenter) busyWidget.setLayout(layout) return busyWidget
def __init__(self, smiley, parent=None): super(WSmileyWidget, self).__init__(parent) self._smiley = smiley self.smileyLabel = WImageLabel(self) self.smileyLabel.setToolTip(smiley.name) self.smileyLabel.clicked.connect(self._smileyClicked) # Before the animation starts, WImageLabel knows nothing # about the size of the image. And we don't want to start # it now (for CPU and memory usage). # So, we must specific the width and height here. self.smileyLabel.setImageFile(smiley.path, smiley.width, smiley.height)
def __init__(self, parent=None): super(WSwitchLabel, self).__init__(parent) self._imagesList = [] self._currentImage = None self._layout = QtGui.QHBoxLayout(self) self._leftLabel = WImageLabel(self) self._leftLabel.setText("<-") self._leftLabel.clicked.connect(self._last) self._layout.addWidget(self._leftLabel) self._imageLabel = WAsyncLabel(self) self._imageLabel.setAlignment(QtCore.Qt.AlignCenter) self._imageLabel.clicked.connect(self.clicked) self._layout.addWidget(self._imageLabel) self._rightLabel = WImageLabel(self) self._rightLabel.setText("->") self._rightLabel.clicked.connect(self._next) self._layout.addWidget(self._rightLabel) self.setLayout(self._layout)