當前位置: 首頁>>代碼示例>>Python>>正文


Python QtCore.QTimer方法代碼示例

本文整理匯總了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) 
開發者ID:pkkid,項目名稱:pkmeter,代碼行數:18,代碼來源:pkmixins.py

示例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() 
開發者ID:BasioMeusPuga,項目名稱:Lector,代碼行數:23,代碼來源:dockwidgets.py

示例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) 
開發者ID:leapcode,項目名稱:bitmask-dev,代碼行數:26,代碼來源:app.py

示例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 
開發者ID:XIVN1987,項目名稱:JRTTView,代碼行數:19,代碼來源:RTTView.py

示例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) 
開發者ID:vrtadmin,項目名稱:FIRST-plugin-ida,代碼行數:21,代碼來源:first.py

示例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) 
開發者ID:HuberTRoy,項目名稱:MusicBox,代碼行數:25,代碼來源:player.py

示例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) 
開發者ID:Ultimaker,項目名稱:Cura,代碼行數:21,代碼來源:PlatformPhysics.py

示例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 
開發者ID:Ultimaker,項目名稱:Cura,代碼行數:26,代碼來源:CuraSplashScreen.py

示例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() 
開發者ID:Ultimaker,項目名稱:Cura,代碼行數:23,代碼來源:GlobalStacksModel.py

示例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() 
開發者ID:Ultimaker,項目名稱:Cura,代碼行數:18,代碼來源:SettingInheritanceManager.py

示例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) 
開發者ID:Ultimaker,項目名稱:Cura,代碼行數:19,代碼來源:ModelChecker.py

示例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() 
開發者ID:pyrocko,項目名稱:kite,代碼行數:27,代碼來源:spool.py

示例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)) 
開發者ID:kanishka-linux,項目名稱:kawaii-player,代碼行數:20,代碼來源:optionwidgets.py

示例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_() 
開發者ID:kanishka-linux,項目名稱:kawaii-player,代碼行數:23,代碼來源:player_functions.py


注:本文中的PyQt5.QtCore.QTimer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。