当前位置: 首页>>代码示例>>Python>>正文


Python QTimer.singleShot方法代码示例

本文整理汇总了Python中PyQt4.QtCore.QTimer.singleShot方法的典型用法代码示例。如果您正苦于以下问题:Python QTimer.singleShot方法的具体用法?Python QTimer.singleShot怎么用?Python QTimer.singleShot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyQt4.QtCore.QTimer的用法示例。


在下文中一共展示了QTimer.singleShot方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: enterEvent

# 需要导入模块: from PyQt4.QtCore import QTimer [as 别名]
# 或者: from PyQt4.QtCore.QTimer import singleShot [as 别名]
def enterEvent(self, event):
        self.setFixedSize(self._activeSize)
        QTimer.singleShot(500, lambda : self.setFixedSize(self.sizeHint())) 
开发者ID:Acer54,项目名称:Webradio_v2,代码行数:5,代码来源:virt_keyboard.py

示例2: goToHome

# 需要导入模块: from PyQt4.QtCore import QTimer [as 别名]
# 或者: from PyQt4.QtCore.QTimer import singleShot [as 别名]
def goToHome(self):
        self.GoTo(homepage)
        loop = QEventLoop()
        QTimer.singleShot(10, loop.quit)
        loop.exec_()
        document = self.tabWidget.currentWidget().page().mainFrame().documentElement()
        gallery = document.findFirst('div')
        for i, fav in enumerate(self.favourites):
            title, url, img = fav[0], fav[1], thumbnails_dir+fav[2]
            child = '<div class="photo"> <a href="{}"><img src="{}"></a><div class="desc">{}</div></div>'.format(url, img, title)
            gallery.appendInside(child) 
开发者ID:ksharindam,项目名称:quartz-browser,代码行数:13,代码来源:main.py

示例3: tick

# 需要导入模块: from PyQt4.QtCore import QTimer [as 别名]
# 或者: from PyQt4.QtCore.QTimer import singleShot [as 别名]
def tick(self):
        logging.debug('TICK')
        features = []
        for f in self.features:
            p1 = (f.attribute('From X'),
                  f.attribute('From Y'),
                  f.attribute('From Z'))
            p2 = (f.attribute('To X'),
                  f.attribute('To Y'),
                  f.attribute('To Z'))
            geom = LineString([p1, p2])
            new_feature = QgsFeature()
            new_feature.setGeometry(qgeom_from_wkt(geom.wkt.replace(' Z', 'Z')))

            attrs = f.attributes()
            attrs += [self.my_id]
            new_feature.setAttributes(attrs)
            self.my_id = self.my_id + 1
            features += [new_feature]

            self.dialog.setValue(self.my_id)

            if len(features) == 1000:
                break

        insert_features_in_layer(features, self.new_layer)

        if self.dialog.wasCanceled():
            pass
        elif self.features.isClosed():
            pass
        else:
            self.timer = QTimer.singleShot(0, self.tick) 
开发者ID:Oslandia,项目名称:albion,代码行数:35,代码来源:convert_data_layer.py

示例4: test_PyQt4_QtWebKit

# 需要导入模块: from PyQt4.QtCore import QTimer [as 别名]
# 或者: from PyQt4.QtCore.QTimer import singleShot [as 别名]
def test_PyQt4_QtWebKit(pyi_builder):
    pyi_builder.test_source(
        """
        from PyQt4.QtGui import QApplication
        from PyQt4.QtWebKit import QWebView
        from PyQt4.QtCore import QTimer

        app = QApplication([])
        view = QWebView()
        view.show()
        # Exit Qt when the main loop becomes idle.
        QTimer.singleShot(0, app.exit)
        # Run the main loop, displaying the WebKit widget.
        app.exec_()
        """) 
开发者ID:nortd,项目名称:driveboardapp,代码行数:17,代码来源:test_libraries.py

示例5: _start_timer

# 需要导入模块: from PyQt4.QtCore import QTimer [as 别名]
# 或者: from PyQt4.QtCore.QTimer import singleShot [as 别名]
def _start_timer(self, wait_seconds):
        self._stop_timer()
        if wait_seconds is not None:
            self._timer = QTimer.singleShot(wait_seconds * 1000, self._process_jobs) 
开发者ID:Jeremy-Friedman,项目名称:metrics,代码行数:6,代码来源:qt.py

示例6: adjustSizeWithTimer

# 需要导入模块: from PyQt4.QtCore import QTimer [as 别名]
# 或者: from PyQt4.QtCore.QTimer import singleShot [as 别名]
def adjustSizeWithTimer(self):
        self.ensurePolished()
        if self.layout():
            self.layout().activate()
        QTimer.singleShot(0, self.adjustSize) 
开发者ID:axanthos,项目名称:orange3-textable,代码行数:7,代码来源:TextableUtils.py

示例7: ledLogic

# 需要导入模块: from PyQt4.QtCore import QTimer [as 别名]
# 或者: from PyQt4.QtCore.QTimer import singleShot [as 别名]
def ledLogic(self, led, state):
        if state == True:
            if led == 1:
                if self.settings.LED1Autoflash.isChecked():
                    self.timerLED1.start(500)
                if self.settings.LED1Timedflash.isChecked():
                    self.timerLED1.start(500)
                    QTimer.singleShot(20000, self.unsetLED1)
                self.setLED1(state)
            if led == 2:
                if self.settings.LED2Autoflash.isChecked():
                    self.timerLED2.start(500)
                if self.settings.LED2Timedflash.isChecked():
                    self.timerLED2.start(500)
                    QTimer.singleShot(20000, self.unsetLED2)
                self.setLED2(state)
            if led == 3:
                if self.settings.LED3Autoflash.isChecked():
                    self.timerLED3.start(500)
                if self.settings.LED3Timedflash.isChecked():
                    self.timerLED3.start(500)
                    QTimer.singleShot(20000, self.unsetLED3)
                self.setLED3(state)
            if led == 4:
                if self.settings.LED4Autoflash.isChecked():
                    self.timerLED4.start(500)
                if self.settings.LED4Timedflash.isChecked():
                    self.timerLED4.start(500)
                    QTimer.singleShot(20000, self.unsetLED4)
                self.setLED4(state)

        if state == False:
            if led == 1:
                self.setLED1(state)
                self.timerLED1.stop()
            if led == 2:
                self.setLED2(state)
                self.timerLED2.stop()
            if led == 3:
                self.setLED3(state)
                self.timerLED3.stop()
            if led == 4:
                self.setLED4(state)
                self.timerLED4.stop() 
开发者ID:saschaludwig,项目名称:OnAirScreen,代码行数:46,代码来源:start.py


注:本文中的PyQt4.QtCore.QTimer.singleShot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。