📅  最后修改于: 2022-03-11 14:45:51.490000             🧑  作者: Mango
self.loading = QLabel() # create the QLabel
self.layout.addWidget(self.loading) # add it to our layout
movie = QMovie("myGifLoading.gif") # Create a QMovie from our gif
self.loading.setMovie(movie) # use setMovie function in our QLabel
self.loading.setFixedSize(60, 60) # set its size
self.loading.setMaximumWidth(50) # set Max width
movie.start() # now start the gif
# and to stop the gif
movie.stop()
# you use show() and hide() function to make it visible or not where you want it