本文整理汇总了Python中PyQt5.QtCore.QTimer方法的典型用法代码示例。如果您正苦于以下问题:Python QtCore.QTimer方法的具体用法?Python QtCore.QTimer怎么用?Python QtCore.QTimer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore
的用法示例。
在下文中一共展示了QtCore.QTimer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QTimer [as 别名]
def __init__(self, username):
QWidget.__init__(self)
uic.loadUi("UI/rawscripts.ui", self)
self.setWindowTitle("Script Select Menu")
self.loggedinas.setText("Logged in as: %s" % username)
self.treeWidget.currentItemChanged.connect(self.changeSelected)
self.startEditing.clicked.connect(self.startVideoEditor)
self.refreshScripts.clicked.connect(self.refreshScriptsRequest)
self.flagQuality.clicked.connect(lambda : self.flagScript("QUALITY"))
self.addscript.clicked.connect(self.addScriptFromURL)
self.update_table.connect(self.updateColors)
self.add_url_response.connect(self.addedNewScript)
self.reset_editing_status.connect(self.resetEditingStatus)
self.timer = QtCore.QTimer(self)
self.timer.timeout.connect(self.updateTime)
self.timer.start(4000)
self.currentScriptSelected = None
self.isEditing = False
开发者ID:HA6Bots,项目名称:Automatic-Youtube-Reddit-Text-To-Speech-Video-Generator-and-Uploader,代码行数:20,代码来源:rawscriptsmenu.py
示例2: attribute_iter
# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QTimer [as 别名]
def attribute_iter(self, data, value):
count = 0
length = len(value) if value else 0
for i in range(length):
count += 1
subwidget = self._get_subwidget(i)
data['this'] = value[i]
for action in subwidget.actions:
action.apply(data)
if self.itermax and i >= self.itermax-1:
break
for subwidget in self.subwidgets[count:]:
utils.remove_widget(subwidget)
self.subwidgets = self.subwidgets[:count]
timer = QtCore.QTimer()
timer.singleShot(10, self.control.resize_to_min)
示例3: __init__
# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QTimer [as 别名]
def __init__(self, parent):
self.parent = parent
self.parentTab = self.parent.parent
self.searchThread = BackGroundTextSearch()
self.searchOptionsLayout = QtWidgets.QHBoxLayout()
self.searchTabLayout = QtWidgets.QVBoxLayout()
self.searchTimer = QtCore.QTimer(self.parent)
self.searchLineEdit = QtWidgets.QLineEdit(self.parent)
self.searchBookButton = QtWidgets.QToolButton(self.parent)
self.caseSensitiveSearchButton = QtWidgets.QToolButton(self.parent)
self.matchWholeWordButton = QtWidgets.QToolButton(self.parent)
self.searchResultsTreeView = QtWidgets.QTreeView(self.parent)
self._translate = QtCore.QCoreApplication.translate
self.search_string = self._translate('SideDock', 'Search')
self.search_book_string = self._translate('SideDock', 'Search entire book')
self.case_sensitive_string = self._translate('SideDock', 'Match case')
self.match_word_string = self._translate('SideDock', 'Match word')
self.create_widgets()
示例4: shutdown
# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QTimer [as 别名]
def shutdown(self, *args):
global bitmaskd
if self.closing:
return
self.closing = True
bitmaskd.join()
terminate(pid)
cleanup()
print('[bitmask] shutting down gui...')
try:
self.stop()
try:
global pixbrowser
pixbrowser.stop()
del pixbrowser
except:
pass
QtCore.QTimer.singleShot(0, qApp.deleteLater)
except Exception as ex:
print('exception catched: %r' % ex)
sys.exit(1)
示例5: __init__
# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QTimer [as 别名]
def __init__(self, parent=None):
super(RTTView, self).__init__(parent)
uic.loadUi('RTTView.ui', self)
self.initSetting()
self.initQwtPlot()
self.rcvbuff = b''
self.tmrRTT = QtCore.QTimer()
self.tmrRTT.setInterval(10)
self.tmrRTT.timeout.connect(self.on_tmrRTT_timeout)
self.tmrRTT.start()
self.tmrRTT_Cnt = 0
示例6: __init__
# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QTimer [as 别名]
def __init__(self, parent, dialog, **kwargs):
super(FIRSTUI.Dialog, self).__init__(parent)
self.parent = parent
self.data = None
self.ui = dialog(**kwargs)
self.ui.setupUi(self)
self.should_show = self.ui.should_show
self.accepted.connect(self.success_callback)
self.rejected.connect(self.reject_callback)
self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint)
self.hide_attempts = 0
self.timer = QtCore.QTimer()
self.timer.timeout.connect(self.__hide)
self.timer.start(500)
示例7: __init__
# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QTimer [as 别名]
def __init__(self, parent=None):
super(DesktopLyric, self).__init__()
self.lyric = QString('Lyric Show.')
self.intervel = 0
self.maskRect = QRectF(0, 0, 0, 0)
self.maskWidth = 0
self.widthBlock = 0
self.t = QTimer()
self.screen = QApplication.desktop().availableGeometry()
self.setObjectName(_fromUtf8("Dialog"))
self.setWindowFlags(Qt.CustomizeWindowHint | Qt.FramelessWindowHint | Qt.Dialog | Qt.WindowStaysOnTopHint | Qt.Tool)
self.setMinimumHeight(65)
self.setAttribute(Qt.WA_TranslucentBackground)
self.handle = lyric_handle(self)
self.verticalLayout = QVBoxLayout(self)
self.verticalLayout.setSpacing(0)
self.verticalLayout.setContentsMargins(0, 0, 0, 0)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.font = QFont(_fromUtf8('微软雅黑, verdana'), 50)
self.font.setPixelSize(50)
# QMetaObject.connectSlotsByName(self)
self.handle.lyricmoved.connect(self.newPos)
self.t.timeout.connect(self.changeMask)
示例8: __init__
# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QTimer [as 别名]
def __init__(self, controller, volume):
super().__init__()
self._controller = controller
self._controller.getScene().sceneChanged.connect(self._onSceneChanged)
self._controller.toolOperationStarted.connect(self._onToolOperationStarted)
self._controller.toolOperationStopped.connect(self._onToolOperationStopped)
self._build_volume = volume
self._enabled = True
self._change_timer = QTimer()
self._change_timer.setInterval(100)
self._change_timer.setSingleShot(True)
self._change_timer.timeout.connect(self._onChangeTimerFinished)
self._move_factor = 1.1 # By how much should we multiply overlap to calculate a new spot?
self._max_overlap_checks = 10 # How many times should we try to find a new spot per tick?
self._minimum_gap = 2 # It is a minimum distance (in mm) between two models, applicable for small models
Application.getInstance().getPreferences().addPreference("physics/automatic_push_free", False)
Application.getInstance().getPreferences().addPreference("physics/automatic_drop_down", True)
示例9: __init__
# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QTimer [as 别名]
def __init__(self):
super().__init__()
self._scale = 0.7
self._version_y_offset = 0 # when extra visual elements are in the background image, move version text down
if ApplicationMetadata.IsEnterpriseVersion:
splash_image = QPixmap(Resources.getPath(Resources.Images, "cura_enterprise.png"))
self._version_y_offset = 26
else:
splash_image = QPixmap(Resources.getPath(Resources.Images, "cura.png"))
self.setPixmap(splash_image)
self._current_message = ""
self._loading_image_rotation_angle = 0
self._to_stop = False
self._change_timer = QTimer()
self._change_timer.setInterval(50)
self._change_timer.setSingleShot(False)
self._change_timer.timeout.connect(self.updateLoadingImage)
self._last_update_time = None
示例10: __init__
# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QTimer [as 别名]
def __init__(self, parent = None) -> None:
super().__init__(parent)
self._catalog = i18nCatalog("cura")
self.addRoleName(self.NameRole, "name")
self.addRoleName(self.IdRole, "id")
self.addRoleName(self.HasRemoteConnectionRole, "hasRemoteConnection")
self.addRoleName(self.MetaDataRole, "metadata")
self.addRoleName(self.DiscoverySourceRole, "discoverySource")
self._change_timer = QTimer()
self._change_timer.setInterval(200)
self._change_timer.setSingleShot(True)
self._change_timer.timeout.connect(self._update)
# Listen to changes
CuraContainerRegistry.getInstance().containerAdded.connect(self._onContainerChanged)
CuraContainerRegistry.getInstance().containerMetaDataChanged.connect(self._onContainerChanged)
CuraContainerRegistry.getInstance().containerRemoved.connect(self._onContainerChanged)
self._updateDelayed()
示例11: __init__
# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QTimer [as 别名]
def __init__(self, parent = None) -> None:
super().__init__(parent)
self._global_container_stack = None # type: Optional[ContainerStack]
self._settings_with_inheritance_warning = [] # type: List[str]
self._active_container_stack = None # type: Optional[ExtruderStack]
self._update_timer = QTimer()
self._update_timer.setInterval(500)
self._update_timer.setSingleShot(True)
self._update_timer.timeout.connect(self._update)
Application.getInstance().globalContainerStackChanged.connect(self._onGlobalContainerChanged)
ExtruderManager.getInstance().activeExtruderChanged.connect(self._onActiveExtruderChanged)
self._onGlobalContainerChanged()
self._onActiveExtruderChanged()
示例12: __init__
# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QTimer [as 别名]
def __init__(self):
super().__init__()
self._button_view = None
self._caution_message = Message("", #Message text gets set when the message gets shown, to display the models in question.
lifetime = 0,
title = catalog.i18nc("@info:title", "3D Model Assistant"))
self._change_timer = QTimer()
self._change_timer.setInterval(200)
self._change_timer.setSingleShot(True)
self._change_timer.timeout.connect(self.onChanged)
Application.getInstance().initializationFinished.connect(self._pluginsInitialized)
Application.getInstance().getController().getScene().sceneChanged.connect(self._onChanged)
Application.getInstance().globalContainerStackChanged.connect(self._onChanged)
示例13: progressStarted
# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QTimer [as 别名]
def progressStarted(self, args):
if self.progress.isVisible():
return
nargs = len(args)
text = args[0]
maximum = 0 if nargs < 2 else args[1]
progress_func = None if nargs < 3 else args[2]
self.progress.setWindowTitle('Processing...')
self.progress.setLabelText(text)
self.progress.setMaximum(maximum)
self.progress.setValue(0)
@QtCore.pyqtSlot()
def updateProgress():
if progress_func:
self.progress.setValue(progress_func())
self.progress_timer = QtCore.QTimer()
self.progress_timer.timeout.connect(updateProgress)
self.progress_timer.start(250)
self.progress.show()
示例14: info_preview
# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QTimer [as 别名]
def info_preview(self, command, picn, length, change_aspect, tsec, counter, x, y, use_existing=None, lock=None):
if self.preview_process.processId() != 0:
self.preview_process.kill()
if self.preview_process.processId() == 0 and lock is False and not use_existing:
ui.logger.debug('\npreview_generating - {} - {}\n'.format(length, tsec))
self.preview_process = QtCore.QProcess()
self.preview_process.finished.connect(partial(self.preview_generated, picn, length, change_aspect, tsec, counter, x, y))
QtCore.QTimer.singleShot(1, partial(self.preview_process.start, command))
elif use_existing:
newpicn = os.path.join(self.preview_dir, "{}.jpg".format(int(tsec)))
if ui.live_preview == 'fast':
self.apply_pic(newpicn, x, y, length)
ui.logger.debug('\n use existing preview image \n')
else:
self.preview_process = QtCore.QProcess()
command = 'echo "hello"'
self.preview_process.finished.connect(partial(self.preview_generated, picn, length, change_aspect, tsec, counter, x, y))
QtCore.QTimer.singleShot(1, partial(self.preview_process.start, command))
示例15: qmsg_message
# 需要导入模块: from PyQt5 import QtCore [as 别名]
# 或者: from PyQt5.QtCore import QTimer [as 别名]
def qmsg_message(txt):
print(txt)
#root = tkinter.Tk()
#width = root.winfo_screenwidth()
#height = root.winfo_screenheight()
#print(width, height, '--screen--tk--')
msg = QtWidgets.QMessageBox()
msg.setGeometry(0, 0, 50, 20)
#msg.setWindowFlags(QtCore.Qt.Window | QtCore.Qt.FramelessWindowHint)
msg.setWindowModality(QtCore.Qt.NonModal)
msg.setWindowTitle("Kawaii-Player MessageBox")
msg.setIcon(QtWidgets.QMessageBox.Information)
msg.setText(txt+'\n\n(Message Will Autohide in 5 seconds)')
msg.show()
frame_timer = QtCore.QTimer()
frame_timer.timeout.connect(lambda x=0: frame_options(msg))
frame_timer.setSingleShot(True)
frame_timer.start(5000)
msg.exec_()