本文整理汇总了Python中PyQt4.QtGui.QMovie.setSpeed方法的典型用法代码示例。如果您正苦于以下问题:Python QMovie.setSpeed方法的具体用法?Python QMovie.setSpeed怎么用?Python QMovie.setSpeed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QMovie
的用法示例。
在下文中一共展示了QMovie.setSpeed方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ImagePlayer
# 需要导入模块: from PyQt4.QtGui import QMovie [as 别名]
# 或者: from PyQt4.QtGui.QMovie import setSpeed [as 别名]
class ImagePlayer(QWidget):
def __init__(self, filename, title, parent=None):
QWidget.__init__(self, parent)
# Load the file into a QMovie
self.movie = QMovie(filename, QByteArray(), self)
size = self.movie.scaledSize()
self.setGeometry(200, 200, size.width(), size.height())
self.setWindowTitle(title)
self.movie_screen = QLabel()
# Make label fit the gif
self.movie_screen.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
self.movie_screen.setAlignment(Qt.AlignCenter)
# Create the layout
main_layout = QVBoxLayout()
main_layout.addWidget(self.movie_screen)
self.setLayout(main_layout)
# Add the QMovie object to the label
self.movie.setCacheMode(QMovie.CacheAll)
self.movie.setSpeed(100)
self.movie_screen.setMovie(self.movie)
self.movie.start()
示例2: add_loading_widgets
# 需要导入模块: from PyQt4.QtGui import QMovie [as 别名]
# 或者: from PyQt4.QtGui.QMovie import setSpeed [as 别名]
def add_loading_widgets(self, children):
# Generate list if only one item was given
if not type(children) is list:
item_list = []
item_list.append(children)
children = item_list
# Add loading widgets to tree items
for child in children:
if child.tree_item == None:
return
# Create loading widget
load_widget = QtGui.QLabel()
load_widget.resize(50,50)
#load_widget.setMaximumSize(50,50)
load_widget.setStyleSheet("QLabel { background-color: transparent; }")
# Create animation
load_anim = QMovie(self.datahandler.datapath("ui/images/loading_tree.gif"), "GIF", load_widget)
load_anim.setCacheMode(QMovie.CacheAll)
load_anim.setSpeed(150)
load_anim.setScaledSize(QtCore.QSize(50,50))
# Add to data model and tree
child.set_load_widget(load_widget, load_anim)
self.tree.setItemWidget(child.tree_item, 1, load_widget)
示例3: notifyTimeout
# 需要导入模块: from PyQt4.QtGui import QMovie [as 别名]
# 或者: from PyQt4.QtGui.QMovie import setSpeed [as 别名]
def notifyTimeout(self):
self.timeoutCount += 1
if self.timeoutCount == self.notifyCount:
msg = self.tr(u'No fix for %s since more than %d seconds!') % (self.name, self.timeoutTime * self.timeoutCount / 1000)
w = self.iface.messageBar().createMessage(self.tr(u'PosiView Attention'), msg)
l = QLabel(w)
m = QMovie(':/plugins/PosiView/hand.gif')
m.setSpeed(75)
l.setMovie(m)
m.setParent(l)
m.start()
w.layout().addWidget(l)
self.iface.messageBar().pushWidget(w, QgsMessageBar.CRITICAL, duration=self.notifyDuration)
示例4: setStatus
# 需要导入模块: from PyQt4.QtGui import QMovie [as 别名]
# 或者: from PyQt4.QtGui.QMovie import setSpeed [as 别名]
def setStatus(self,status,message='',tooltip=None):
'''Sets indicator icon and statusbar message'''
self.parent.statusbar.showMessage(message)
self.parent.statusbar.setToolTip(tooltip if tooltip else '')
#progress
loc = os.path.abspath(os.path.join(IMG_LOC,self.imgset[status]))
#loc = os.path.abspath(os.path.join(os.path.dirname(__file__),self.parent.IMG_LOC,self.imgset[status]))
self.progressbar.setVisible(status in (self.STATUS.BUSY, self.STATUS.CLEAN))
#icon
anim = QMovie(loc, QByteArray(), self)
anim.setScaledSize(QSize(self.IMG_WIDTH,self.IMG_HEIGHT))
anim.setCacheMode(QMovie.CacheAll)
anim.setSpeed(self.IMG_SPEED)
self.view.clear()
self.view.setMovie(anim)
anim.start()
self.view.repaint()
QApplication.processEvents(QEventLoop.AllEvents)
示例5: MuteButtonLabel
# 需要导入模块: from PyQt4.QtGui import QMovie [as 别名]
# 或者: from PyQt4.QtGui.QMovie import setSpeed [as 别名]
class MuteButtonLabel(QWidget):
def __init__(self, parent=None):
QWidget.__init__(self, parent)
#self.setFixedSize(CustomSize)
self.movie_screen = QLabel()
self.movie_screen.setFixedSize(CustomSize)
self.movie_screen.setAlignment(Qt.AlignLeft)
main_layout = QVBoxLayout()
main_layout.addWidget(self.movie_screen)
self.setLayout(main_layout)
self.muted = False
#self.unmute() # this is for testpurpose only
def unmute(self):
"""start animation"""
self.movie = QMovie(":/unmute.gif", QByteArray(), self)
self.movie.setScaledSize(CustomSize*0.7)
self.movie.setCacheMode(QMovie.CacheAll)
self.movie.setSpeed(100)
self.movie_screen.setMovie(self.movie)
self.muted = False
#print("Emitted 'sig_unmute'")
self.emit(SIGNAL("sig_unmute"))
self.movie.start()
def show_unmute(self):
self.movie = QMovie(":/unmute.gif", QByteArray(), self)
self.movie.setScaledSize(CustomSize*0.7)
self.movie.setCacheMode(QMovie.CacheAll)
self.movie.setSpeed(100)
self.movie_screen.setMovie(self.movie)
self.muted = False
self.movie.start()
def mute(self):
"""stop the animation"""
self.movie = QMovie(":/mute.gif", QByteArray(), self)
self.movie.setScaledSize(CustomSize*0.7)
self.movie.setCacheMode(QMovie.CacheAll)
self.movie.setSpeed(100)
self.movie_screen.setMovie(self.movie)
self.muted = True
#print("Emitted 'sig_mute'")
self.emit(SIGNAL("sig_mute"))
self.movie.start()
def toggleMute(self):
if self.muted:
self.unmute()
else:
self.mute()
def mousePressEvent(self, QMouseEvent):
self.toggleMute()
QMouseEvent.accept()
示例6: animationLabel
# 需要导入模块: from PyQt4.QtGui import QMovie [as 别名]
# 或者: from PyQt4.QtGui.QMovie import setSpeed [as 别名]
def animationLabel(self, index, animationFile):
"""
Public slot to set an animated icon.
@param index tab index (integer)
@param animationFile name of the file containing the animation (string)
@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(50)
animation.setMovie(movie)
movie.start()
self.__tabBar.setTabButton(index, side, None)
self.__tabBar.setTabButton(index, side, animation)
return animation
else:
return None
示例7: MuWizard
# 需要导入模块: from PyQt4.QtGui import QMovie [as 别名]
# 或者: from PyQt4.QtGui.QMovie import setSpeed [as 别名]
#.........这里部分代码省略.........
layout = QGridLayout()
layout.addWidget(pathLbl, 0, 0)
layout.addWidget(loadLbl, 0, 1)
layout.addWidget(self.path, 1, 0)
layout.addWidget(getPath, 1, 1)
layout.addWidget(self.resultLbl, 2, 0, 1, 2)
layout.addWidget(self.preview, 3, 0, 1, 2)
load.setLayout(layout)
load.previewSeries = SeriesPreview()
self.previewSeries = load.previewSeries
# to be able to reference from class namespace
self.loadCheck = load.check
return load
def modelsPage(self):
models = WizardPageEx('modelCheck')
models.setTitle('Forecast')
lbl = QLabel("<font style='color: gray'>Forecast horizon:</font>")
self.steps = QSpinBox()
self.steps.setRange(MIN_FORECAST, MAX_FORECAST)
self.steps.setValue(10)
self.start = QPushButton('Forecast')
self.start.clicked.connect(self.modelling)
self.custom = QPushButton('Advanced')
self.processing = QLabel()
self.gifLoading = QMovie(RES + ICONS + PROGRESS, QByteArray(), self)
self.gifLoading.setCacheMode(QMovie.CacheAll)
self.gifLoading.setSpeed(100)
self.processing.setMovie(self.gifLoading)
self.processing.setAlignment(Qt.AlignCenter)
self.processing.hide()
self.status = QLabel()
self.status.setAlignment(Qt.AlignCenter)
self.status.hide()
layout = QGridLayout()
layout.addWidget(lbl, 0, 0)
layout.addWidget(self.steps, 0, 1)
layout.addWidget(self.start, 0, 2)
layout.addWidget(self.custom, 0, 3)
layout.addWidget(self.status, 1, 0, 1, 4)
layout.addWidget(self.processing, 2, 0, 1, 4)
models.setLayout(layout)
self.customOpt = CustomOption()
self.custom.clicked.connect(self.customOpt.show)
self.modelCheck = models.check
return models
def resultsPage(self):
results = QWizardPage()
results.setFinalPage(True)
results.setTitle('Results')
self.graph = QLabel("<font style='font-size: 16px;'>Plot</font>")
self.export = QLabel("<font style='font-size: 16px;'>Export</font>")
self.showData = QLabel("<font style='font-size: 16px;'>Data</font>")
示例8: MainWindow
# 需要导入模块: from PyQt4.QtGui import QMovie [as 别名]
# 或者: from PyQt4.QtGui.QMovie import setSpeed [as 别名]
class MainWindow(QDialog):
def __init__(self):
QDialog.__init__(self)
self.ui=Ui_Dialog()
self.ui.setupUi(self)
self.configFile, self.machinesData,configExists = localdata.loadData()
self.UIfixes()
self.fillTable()
self.adaptToOS(self.customForClient)
communication.listen(self) # we pass self to emmit a signal each time a
# machine is found
self.machinesItems = {} # for Bookeeping our table items
self.table = self.ui.machinesTable #because too long name
# buttons
self.ui.generateClientButton.clicked.connect(self.runCompilingJob)
self.ui.uploadButton.clicked.connect(self.prepareShipment)
# Ui events
self.connect(self,SIGNAL('droppedFile'),self.checkInput)
self.connect(self,SIGNAL('updateStatus'),self.updateMachinesTable)
self.connect(self,SIGNAL('toggleAnimation'),self.toggleWaiting)
self.connect(self,SIGNAL('addMachines'),self.addDetectedMachine)
self.ui.fileDropTextLine.editingFinished.connect(self.checkInput)
self.table.cellDoubleClicked.connect(self.deleteMachine)
self.ui.usernameTextBox.editingFinished.connect(self.saveConfig)
self.ui.passwordTextBox.editingFinished.connect(self.saveConfig)
machinesAlive(self.machinesItems)
def getMachineItem(self,ip):
return self.machinesItems[ip]
def toggleWaiting(self):
if self.movie.state() == 0:
self.ui.fileDropTextLine.setFixedHeight(0)
self.ui.movie_screen.setFixedHeight(26)
self.movie.start()
else:
self.movie.stop()
self.ui.fileDropTextLine.setFixedHeight(26)
self.ui.movie_screen.setFixedHeight(0)
def UIfixes(self):
''' Stuff you can't do on QtDesigner '''
# reimplementing drops
self.ui.fileDropTextLine.__class__.dragMoveEvent = self.mydragMoveEvent
self.ui.fileDropTextLine.__class__.dragEnterEvent =self.mydragEnterEvent
self.ui.fileDropTextLine.__class__.dropEvent = self.myDropEvent
# Waiting animation
self.ui.movie_screen.setFixedHeight(0)
self.movie = QMovie("loader.gif", QByteArray(), self)
self.movie.setCacheMode(QMovie.CacheAll)
self.movie.setSpeed(100)
self.ui.movie_screen.setMovie(self.movie)
if len(self.machinesData) != 0: # if the user already created clients.exe
self.ui.tabWidget.setCurrentWidget(self.ui.serverTab)
self.table.verticalHeader().setVisible(False) # QtDesigner miss this
self.ui.passwordTextBox.setEchoMode(2) # how to do this on Qtdesigner?
# darn it QtDesign get your stuff together
if configExists:
self.ui.usernameTextBox.setText(configFile['USERNAME'])
self.ui.passwordTextBox.setText(configFile['PASSWORD'])
def fillTable(self):
for name,ip in self.machinesData.items():
rowCount = self.table.rowCount()
nameItem = QTableWidgetItem(name)
ipItem = QTableWidgetItem(self.machinesData[name])
statusItem = QTableWidgetItem('desconocido')
self.table.insertRow(rowCount)
self.table.setItem(rowCount,NAME,nameItem)
self.table.setItem(rowCount,IP,ipItem)
self.table.setItem(rowCount,STATUS,statusItem)
self.machinesItems[ip] = ipItem #save QTableWidgetItem for later use
self.sortTable()
def addDetectedMachine(self,name,ip):
if not self.machinesData.has_key(name):
self.machinesData[name] = ip
rowCount = self.table.rowCount()
nameItem = QTableWidgetItem(name)
ipItem = QTableWidgetItem(self.machinesData[name])
statusItem = QTableWidgetItem('conectada')
self.table.insertRow(rowCount)
self.table.setItem(rowCount,NAME,nameItem)
self.table.setItem(rowCount,IP,ipItem)
self.table.setItem(rowCount,STATUS,statusItem)
self.machinesData.write() #and save our detected data to our machines dic
self.machinesItems[ip] = ipItem #save QTableWidgetItem for later use
#.........这里部分代码省略.........
示例9: __init__
# 需要导入模块: from PyQt4.QtGui import QMovie [as 别名]
# 或者: from PyQt4.QtGui.QMovie import setSpeed [as 别名]
#.........这里部分代码省略.........
self.manager_ui.button_new_folder.clicked.connect(self.item_new_folder)
self.manager_ui.sync_button.clicked.connect(self.synchronize_now)
self.last_dl_location = None
self.last_ul_location = None
### Console widget
self.console_widget = QWidget(self.main_widget, Qt.Window)
self.console_widget.setAttribute(Qt.WA_Maemo5StackedWindow)
self.console_ui = Ui_ConsoleWidget()
self.console_ui.setupUi(self.console_widget)
self.console_ui.button_save.clicked.connect(self.save_log_to_file)
self.console_ui.button_back.clicked.connect(self.hide_console)
### Settings widget
self.settings_widget = None
### Fill stacked layout
self.stacked_layout.addWidget(self.trusted_login_widget)
self.stacked_layout.addWidget(self.manager_widget)
self.stacked_layout.setCurrentWidget(self.trusted_login_widget)
### Loading Widget
self.loading_widget = QWidget(self.manager_widget)
self.loading_ui = Ui_LoadingWidget()
self.loading_ui.setupUi(self.loading_widget)
self.manager_ui.action_layout.insertWidget(3, self.loading_widget)
self.loading_widget.hide()
self.tree_controller.set_loading_ui(self.loading_ui)
# Init loading animation
self.loading_animation = QMovie(self.datahandler.datapath("ui/images/loading.gif"), "GIF", self.loading_ui.load_animation_label)
self.loading_animation.setCacheMode(QMovie.CacheAll)
self.loading_animation.setSpeed(150)
self.loading_animation.setScaledSize(QtCore.QSize(48,48))
self.loading_ui.load_animation_label.setMovie(self.loading_animation)
# Init hide timer and icons for information messages
self.information_message_timer = QTimer()
self.information_message_timer.setSingleShot(True)
self.information_message_timer.timeout.connect(self.hide_information_message)
self.information_icon_ok = QPixmap(self.datahandler.datapath("ui/icons/check.png")).scaled(24,24)
self.information_icon_error = QPixmap(self.datahandler.datapath("ui/icons/cancel.png")).scaled(24,24)
self.information_icon_queue = QPixmap(self.datahandler.datapath("ui/icons/queue.png")).scaled(24,24)
### About dialog
self.about_dialog = AboutDialog(self)
self.set_synching(False)
def set_synching(self, syncing):
self.manager_ui.sync_button.setVisible(not syncing)
self.manager_ui.sync_label.setVisible(syncing)
def set_settings_widget(self, settings_widget):
self.settings_widget = settings_widget
def set_transfer_widget(self, transfer_widget):
self.transfer_widget = transfer_widget
def synchronize_now(self):
self.settings_widget.sync_now_clicked()
def synchronize_now_photos(self):
self.controller.sync_manager.sync_media()