當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。