本文整理汇总了Python中PyQt5.QtGui.QMovie.start方法的典型用法代码示例。如果您正苦于以下问题:Python QMovie.start方法的具体用法?Python QMovie.start怎么用?Python QMovie.start使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtGui.QMovie
的用法示例。
在下文中一共展示了QMovie.start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: GifWidget
# 需要导入模块: from PyQt5.QtGui import QMovie [as 别名]
# 或者: from PyQt5.QtGui.QMovie import start [as 别名]
class GifWidget(QLabel):
def __init__(self, parent = None, path = None):
super(GifWidget, self).__init__(parent)
self.setPath(path)
def __del__(self):
print("GifWidget __del__")
if hasattr(self, "_movie"):
self._movie.stop()
del self._movie
def setPath(self, path):
if hasattr(self, "_movie"):
self._movie.stop()
del self._movie
if not path:
return
self._movie = QMovie(path)
self.setMovie(self._movie)
self._movie.start()
def start(self):
if hasattr(self, "_movie"):
self._movie.start()
def stop(self):
if hasattr(self, "_movie"):
self._movie.stop()
示例2: MoviePlayer
# 需要导入模块: from PyQt5.QtGui import QMovie [as 别名]
# 或者: from PyQt5.QtGui.QMovie import start [as 别名]
class MoviePlayer(QWidget):
def __init__(self):
super(MoviePlayer, self).__init__()
self.setAttribute(Qt.WA_TranslucentBackground)
self.setWindowFlags(Qt.FramelessWindowHint)
self.movie = QMovie(self)
self.movieLabel = QLabel("No movie loaded")
self.movieLabel.setAlignment(Qt.AlignAbsolute)
self.movieLabel.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored)
self.mainLayout = QVBoxLayout()
self.mainLayout.addWidget(self.movieLabel)
self.setLayout(self.mainLayout)
#self.resize(400, 500)
self.movieLabel.setMovie(self.movie)
self.movie.setFileName('icon/gears.gif')
pos = kp.pos()
x = pos.x() - ((self.width()/2) - (kp.width()/2)) +220
y = pos.y() - ((self.height()/2) - (kp.height()/2)) +160
self.setGeometry(x,y, 400, 500)
self.movie.start()
示例3: animationLabel
# 需要导入模块: from PyQt5.QtGui import QMovie [as 别名]
# 或者: from PyQt5.QtGui.QMovie import start [as 别名]
def animationLabel(self, index, animationFile, speed=100):
"""
Public slot to set an animated icon.
@param index tab index (integer)
@param animationFile name of the file containing the animation (string)
@param speed animation speed of the icon in percent of the original
icon's speed (integer)
@return reference to the created label (QLabel)
"""
if index == -1:
return None
if hasattr(self.__tabBar, 'setTabButton'):
side = self.__freeSide()
animation = QLabel(self)
if animationFile and not animation.movie():
movie = QMovie(animationFile, QByteArray(), animation)
movie.setSpeed(speed)
animation.setMovie(movie)
movie.start()
self.__tabBar.setTabButton(index, side, None)
self.__tabBar.setTabButton(index, side, animation)
return animation
else:
return None
示例4: StatusBarView
# 需要导入模块: from PyQt5.QtGui import QMovie [as 别名]
# 或者: from PyQt5.QtGui.QMovie import start [as 别名]
class StatusBarView(QStatusBar):
"""
The model of Navigation component
"""
def __init__(self, parent):
super().__init__(parent)
self.status_label = QLabel("", parent)
self.status_label.setTextFormat(Qt.RichText)
self.label_time = QLabel("", parent)
self.combo_referential = QComboBox(parent)
self.movie_loader = QMovie(":/icons/loader")
self.label_loading = QLabel(parent)
self.label_loading.setMovie(self.movie_loader)
self.label_loading.setMaximumHeight(self.height())
self.movie_loader.setScaledSize(QSize(16, 16))
self.movie_loader.start()
self.movie_loader.setPaused(True)
self.addPermanentWidget(self.label_loading)
self.addPermanentWidget(self.status_label, 2)
self.addPermanentWidget(self.label_time)
self.addPermanentWidget(self.combo_referential)
def start_loading(self):
self.movie_loader.setPaused(False)
def stop_loading(self):
self.movie_loader.setPaused(True)
示例5: initoptionspanel
# 需要导入模块: from PyQt5.QtGui import QMovie [as 别名]
# 或者: from PyQt5.QtGui.QMovie import start [as 别名]
def initoptionspanel(self):
label = QLabel('Filter')
filtertype = QComboBox()
filtertype.addItem('None')
filtertype.addItem('Lowpass')
filtertype.addItem('Highpass')
filtertype.addItem('Bandreject')
filtertype.addItem('Bandpass')
filtertype.currentIndexChanged.connect(self.filtertypelistener)
self.filterfunction = QComboBox()
self.filterfunction.addItem('Ideal')
self.filterfunction.addItem('Butterworth')
self.filterfunction.addItem('Gaussian')
self.filterfunction.currentIndexChanged.connect(self.filterfunctionlistener)
self.filterfunction.setEnabled(False)
self.filtercutoff = QDoubleSpinBox()
self.filtercutoff.setValue(0.0)
self.filtercutoff.setRange(0.0, 10000.0)
self.filtercutoff.valueChanged.connect(self.filtercutofflistener)
self.filtercutoff.setEnabled(False)
self.filterbandwidth = QDoubleSpinBox()
self.filterbandwidth.setValue(1.0)
self.filterbandwidth.setRange(0.0, 10000.0)
self.filterbandwidth.valueChanged.connect(self.filterbandwidthlistener)
self.filterbandwidth.setEnabled(False)
self.filterorder = QDoubleSpinBox()
self.filterorder.setValue(1.0)
self.filterorder.setRange(0.0, 10000.0)
self.filterorder.valueChanged.connect(self.filterorderlistener)
self.filterorder.setEnabled(False)
loader = QMovie('loader.gif')
loader.start()
self.loadercontainer = QLabel()
self.loadercontainer.setMovie(loader)
self.loadercontainer.setVisible(False)
formlayout = QFormLayout()
formlayout.addRow('Type', filtertype)
formlayout.addRow('Function', self.filterfunction)
formlayout.addRow('Cut off', self.filtercutoff)
formlayout.addRow('Bandwidth', self.filterbandwidth)
formlayout.addRow('Order', self.filterorder)
formlayout.addRow('', self.loadercontainer)
filterbox = QGroupBox('Filter')
filterbox.setLayout(formlayout)
options = QDockWidget('Options')
options.setFeatures(QDockWidget.DockWidgetFloatable)
options.setFeatures(QDockWidget.DockWidgetMovable)
options.setWidget(filterbox)
self.addDockWidget(Qt.RightDockWidgetArea, options)
示例6: LoadingGifWin
# 需要导入模块: from PyQt5.QtGui import QMovie [as 别名]
# 或者: from PyQt5.QtGui.QMovie import start [as 别名]
class LoadingGifWin( QWidget):
def __init__(self,parent=None):
super(LoadingGifWin, self).__init__(parent)
self.label = QLabel('', self)
self.setFixedSize(128,128)
self.setWindowFlags( Qt.Dialog| Qt.CustomizeWindowHint)
self.movie = QMovie("./images/loading.gif")
self.label.setMovie(self.movie)
self.movie.start()
示例7: open
# 需要导入模块: from PyQt5.QtGui import QMovie [as 别名]
# 或者: from PyQt5.QtGui.QMovie import start [as 别名]
def open(self):
self.file = QFileDialog.getOpenFileName(self, "Open File", self.pwd)[0]
if self.file == "":
return
self.information = info.Information(self, self.file)
movie = QMovie(self.file, QByteArray(), self)
movie.setCacheMode(QMovie.CacheAll)
movie.setSpeed(100)
self.label.setMovie(movie)
movie.start()
示例8: __makeAnimatedLabel
# 需要导入模块: from PyQt5.QtGui import QMovie [as 别名]
# 或者: from PyQt5.QtGui.QMovie import start [as 别名]
def __makeAnimatedLabel(self, fileName, label):
"""
Private slot to create an animated label.
@param fileName name of the file containing the animation (string)
@param label reference to the label to be animated (QLabel)
"""
movie = QMovie(fileName, QByteArray(), label)
movie.setSpeed(100)
label.setMovie(movie)
movie.start()
示例9: WaitDialog
# 需要导入模块: from PyQt5.QtGui import QMovie [as 别名]
# 或者: from PyQt5.QtGui.QMovie import start [as 别名]
class WaitDialog(QWidget):
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()
示例10: LoadingItem
# 需要导入模块: from PyQt5.QtGui import QMovie [as 别名]
# 或者: from PyQt5.QtGui.QMovie import start [as 别名]
class LoadingItem(QLabel):
def __init__(self):
super(LoadingItem, self).__init__()
self.movie = QMovie(resources.IMAGES['loading'])
self.setMovie(self.movie)
self.movie.setScaledSize(QSize(16, 16))
self.movie.start()
def add_item_to_tree(self, folder, tree, item_type=None, parent=None):
if item_type is None:
item = QTreeWidgetItem()
item.setText(0, (_translate("LoadingItem", " LOADING: '%s'") % folder))
else:
item = item_type(parent, (
_translate("LoadingItem", " LOADING: '%s'") % folder), folder)
tree.addTopLevelItem(item)
tree.setItemWidget(item, 0, self)
return item
示例11: __init__
# 需要导入模块: from PyQt5.QtGui import QMovie [as 别名]
# 或者: from PyQt5.QtGui.QMovie import start [as 别名]
def __init__(self, parent, text=""):
QDialog.__init__(self, parent)
# Create waiting image
waitingImage = QMovie(qtUtils.getAbsoluteImagePath('waiting.gif'))
waitingImage.start()
waitingImageLabel = QLabel(self)
waitingImageLabel.setMovie(waitingImage)
waitingLabel = QLabel(text, self)
hbox = QHBoxLayout()
hbox.addStretch(1)
hbox.addWidget(waitingImageLabel)
hbox.addSpacing(10)
hbox.addWidget(waitingLabel)
hbox.addStretch(1)
self.setLayout(hbox)
示例12: setupWidget1
# 需要导入模块: from PyQt5.QtGui import QMovie [as 别名]
# 或者: from PyQt5.QtGui.QMovie import start [as 别名]
def setupWidget1(self):
#setup the tree
movie = QMovie()
movie.setFileName("res/tree.gif")
self.ui.lb_tree.setMovie(movie)
self.ui.lb_tree_big.setMovie(movie)
movie.start()
#setup the statistics
self.ui.gridLayout.setHorizontalSpacing(60)
self.ui.gridLayout.setVerticalSpacing(10)
self.ui.gridLayout.setGeometry(QRect(0, 51, 291, 224))
self.ui.gridLayout.setAlignment(QtCore.Qt.AlignCenter)
self.statLabels = []
for i in range(7):
self.statLabels.append([])
for j in range(4):
self.statLabels[i].append(QLabel())
self.statLabels[i][j].setScaledContents(True)
self.statLabels[i][j].setAutoFillBackground(False)
self.statLabels[i][j].setAlignment(QtCore.Qt.AlignCenter)
self.ui.gridLayout.addWidget(self.statLabels[i][j], i, j, 1, 1)
示例13: IconManagement
# 需要导入模块: from PyQt5.QtGui import QMovie [as 别名]
# 或者: from PyQt5.QtGui.QMovie import start [as 别名]
class IconManagement(object):
def __init__(self, tray, interval = 100):
self.tray = tray
self.movie = QMovie(":/images/tray_animations/tray.gif")
self.movie.setSpeed(interval)
self.movie.frameChanged.connect(self.next_icon)
self.icons = Enum(
ok = QIcon(":/images/demerio.png"),
problem = QIcon(":/images/demerio-problem.png"),
conductor_problem = QIcon(":/images/demerio-conductor-problem.png")
)
self.icon = self.icons.ok
self.update_icon()
def internet_is_ok(self, internet_is_ok):
self.icon = self.icons.ok if internet_is_ok else self.icons.problem
self.update_icon()
@pyqtSlot(int)
def next_icon(self, i):
self.tray.setIcon(QIcon(self.movie.currentPixmap()))
def start(self):
self.movie.start()
def stop(self):
self.update_icon()
self.movie.stop()
def update_icon(self):
self.tray.setIcon(self.icon)
def conductor_problem(self):
if self.movie.state() == QMovie.Running:
self.movie.stop()
self.icon = self.icons.conductor_problem
self.update_icon()
示例14: MainWindow
# 需要导入模块: from PyQt5.QtGui import QMovie [as 别名]
# 或者: from PyQt5.QtGui.QMovie import start [as 别名]
class MainWindow(QMainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
self.setGeometry(50, 50, 600, 750)
self.setFixedSize(500, 500)
self.startUIWindow()
self.movie = QMovie("mail.gif")
self.movie.frameChanged.connect(self.repaint)
self.movie.start()
def startUIWindow(self):
self.Window = UIWindow(self)
self.setWindowTitle("Email Dialog")
self.show()
def paintEvent(self, event):
currentFrame = self.movie.currentPixmap()
frameRect = currentFrame.rect()
frameRect.moveCenter(self.rect().center())
if frameRect.intersects(event.rect()):
painter = QPainter(self)
painter.drawPixmap(frameRect.left(), frameRect.top(), currentFrame)
示例15: QConnectingWidget
# 需要导入模块: from PyQt5.QtGui import QMovie [as 别名]
# 或者: from PyQt5.QtGui.QMovie import start [as 别名]
class QConnectingWidget(QWidget):
def __init__(self, parent=None):
QWidget.__init__(self, parent)
# Create connecting image
self.connectingGif = QMovie(qtUtils.getAbsoluteImagePath('waiting.gif'))
self.connectingGif.start()
self.connetingImageLabel = QLabel(self)
self.connetingImageLabel.setMovie(self.connectingGif)
self.connectingLabel = QLabel(self)
hbox = QHBoxLayout()
hbox.addStretch(1)
hbox.addWidget(self.connetingImageLabel, alignment=Qt.AlignCenter)
hbox.addSpacing(10)
hbox.addWidget(self.connectingLabel, alignment=Qt.AlignCenter)
hbox.addStretch(1)
self.setLayout(hbox)
def setConnectingToNick(self, nick):
self.connectingLabel.setText("Connecting to " + nick + "...")