Python PyQt5.QtGui 模块,QMovie() 实例源码

我们从Python开源项目中,提取了以下8个代码示例,用于说明如何使用PyQt5.QtGui.QMovie()

项目:BadPlayer    作者:SebastienTr    | 项目源码 | 文件源码
def initVLC(self, config):
        self.instance = vlc.Instance()
        self.mediaplayer = self.instance.media_player_new()
        # self.mediaplayer_list = self.instance.media_list_player_new()
        self.mediaplayer.audio_set_volume(config['default_volume'])
        self.media_event = self.mediaplayer.event_manager()
        self.media_event.event_attach(vlc.EventType.MediaPlayerEndReached, self.SongFinished, 1)
        self.media_event.event_attach(vlc.EventType.MediaPlayerMediaChanged, self.nextItemSet, 1)
        # self.media_event.event_attach(vlc.EventType.MediaPlayerTimeChanged, self.vlc_time_changed, self.mediaplayer)

        logging.getLogger("vlc").setLevel(logging.NOTSET)
        logging.getLogger("mpgatofixed32").setLevel(logging.NOTSET)     
        logging.getLogger("core vout").setLevel(logging.NOTSET)

        gifpath = os.path.join("app", "images", "player", "animation.gif")
        self.labelframe = QLabel(self.parent)
        self.labelframe.setScaledContents(True)
        self.labelframe.setFrameStyle(QFrame.Panel | QFrame.Sunken)
        self.anim = QMovie(gifpath)
        self.labelframe.setMovie(self.anim)
        self.parent.framelayout.addWidget(self.labelframe)
        self.labelframe.hide()
        self.musicplayed = False
项目:binja_dynamics    作者:nccgroup    | 项目源码 | 文件源码
def __init__(self, text="Loading..."):
        super(MessageBox, self).__init__()
        self.setWindowTitle("Messages")

        self.setLayout(QtWidgets.QHBoxLayout())
        self._layout = self.layout()

        self._gif = QtWidgets.QLabel()
        movie = QtGui.QMovie("loading.gif")
        self._gif.setMovie(movie)
        movie.start()
        self._layout.addWidget(self._gif)

        self._message = QtWidgets.QLabel()
        self._message.setText(text)
        self._layout.addWidget(self._message)
        self.setObjectName('Message_Window')
项目:BATS-Bayesian-Adaptive-Trial-Simulator    作者:ContaTP    | 项目源码 | 文件源码
def __init__(self, parent=None):

        QtWidgets.QWidget.__init__(self, parent)
        # Layout
        self.runmenulayout = QtWidgets.QVBoxLayout()
        # Widget
        self.runmenuLabel = QtWidgets.QLabel()
        self.runmenuLabel.setText("Task is running\nPlease wait...")
        # self.runmenuMovieLabel = QtWidgets.QLabel()
        # self.runmenuMovie = QtGui.QMovie(":/resources/runmenu.gif")
        # self.runmenuMovieLabel.setMovie(self.runmenuMovie)
        # self.runmenuMovieLabel.show()
        # Add Widget
        self.runmenulayout.addWidget(self.runmenuLabel)
        # self.runmenulayout.addWidget(self.runmenuMovieLabel)
        # Set layout
        self.runmenulayout.setAlignment(QtCore.Qt.AlignCenter)
        self.runmenulayout.setSpacing(0)
        self.runmenulayout.setContentsMargins(10, 0, 10, 0)        
        self.setLayout(self.runmenulayout)

        # Stylesheet
        self.setStyleSheet("QLabel{background:transparent; color:#3d5159; font-family:'Segoe UI'; font-size:13pt; border:none;}")
项目:binja_dynamics    作者:ehennenfent    | 项目源码 | 文件源码
def __init__(self, text="Loading..."):
        super(MessageBox, self).__init__()
        self.setWindowTitle("Messages")

        self.setLayout(QtWidgets.QHBoxLayout())
        self._layout = self.layout()

        self._gif = QtWidgets.QLabel()
        movie = QtGui.QMovie("loading.gif")
        self._gif.setMovie(movie)
        movie.start()
        self._layout.addWidget(self._gif)

        self._message = QtWidgets.QLabel()
        self._message.setText(text)
        self._layout.addWidget(self._message)
        self.setObjectName('Message_Window')
项目:vidcutter    作者:ozmartian    | 项目源码 | 文件源码
def initNoVideo(self) -> None:
        self.novideoWidget = QWidget(self)
        self.novideoWidget.setObjectName('novideoWidget')
        self.novideoWidget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.MinimumExpanding)
        self.novideoLabel = QLabel(self)
        self.novideoLabel.setAlignment(Qt.AlignCenter)
        self.novideoMovie = QMovie(':/images/novideotext.gif', b'GIF', self)
        self.novideoMovie.setScaledSize(QSize(250, 30))
        self.novideoMovie.frameChanged.connect(lambda: self.novideoLabel.setPixmap(self.novideoMovie.currentPixmap()))
        self.novideoMovie.start()
        novideoLayout = QVBoxLayout()
        novideoLayout.addStretch(3)
        novideoLayout.addWidget(self.novideoLabel)
        novideoLayout.addStretch(1)
        self.novideoWidget.setLayout(novideoLayout)
项目:HearthPacks    作者:Arzaroth    | 项目源码 | 文件源码
def images_loaded(self, result):
        self.midLabel.setText("Last submitted pack:")
        for (card, filename), label in zip(result, self.cardLabels):
            label.card = card
            if card.golden:
                res = QtGui.QMovie(filename)
                label.card_data = res
                label.setMovie(res)
                res.start()
            else:
                res = QtGui.QPixmap(filename)
                label.card_data = res
                label.setPixmap(res)
            label.show()
项目:uitester    作者:IfengAutomation    | 项目源码 | 文件源码
def __init__(self, parent=None, *args, **kwargs):
        super(WaitDialog, self).__init__(parent)
        self.label = QLabel(self)
        self.label.setAlignment(Qt.AlignCenter)
        self.setFixedSize(551, 401)
        self.setWindowOpacity(0.5)  # set transparent
        self.setWindowFlags(Qt.Dialog | Qt.CustomizeWindowHint | Qt.FramelessWindowHint)
        self.setAttribute(Qt.WA_TranslucentBackground)  # background transparent
        self.setContentsMargins(0, 0, 0, 0)
        config = Config()
        self.movie = QMovie(os.path.join(config.images, 'wait.gif'))
        self.label.setMovie(self.movie)
        self.movie.start()
项目:desktop-stream-viewer    作者:AbiosGaming    | 项目源码 | 文件源码
def setup_loading_gif(self):
        """Creates the loading gear as QMovie and its label."""
        self.movie = QtGui.QMovie(self)
        self.movie.setFileName("ui/res/loading.gif")
        self.movie.setCacheMode(QtGui.QMovie.CacheAll)
        self.movie.start()
        self.loading = QtWidgets.QLabel(self)
        self.loading.setAlignment(QtCore.Qt.AlignCenter)
        self.loading.setMovie(self.movie)
        self.loading.hide()