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


Python QApplication.processEvents方法代码示例

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


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

示例1: __init__

# 需要导入模块: from qwt.qt.QtGui import QApplication [as 别名]
# 或者: from qwt.qt.QtGui.QApplication import processEvents [as 别名]
    def __init__(self, max_n, parent=None, **kwargs):
        super(BMDemo, self).__init__(parent=parent)
        self.setWindowTitle('Curve benchmark')
        tabs = QTabWidget()
        self.setCentralWidget(tabs)
        contents = BMText()
        tabs.addTab(contents, 'Contents')
        self.resize(1000, 600)

        # Force window to show up and refresh (for test purpose only)
        self.show()
        QApplication.processEvents()

        t0g = time.time()
        for idx in range(4, -1, -1):
            points = max_n/10**idx
            t0 = time.time()
            widget = BMWidget(points)
            title = '%d points' % points
            tabs.addTab(widget, title)
            tabs.setCurrentWidget(widget)

            # Force widget to refresh (for test purpose only)
            QApplication.processEvents()

            time_str = "Elapsed time: %d ms" % ((time.time()-t0)*1000)
            widget.text.setText(time_str)
            contents.append("<br><i>%s:</i><br>%s" % (title, time_str))
        dt = time.time()-t0g
        contents.append("<br><br><u>Total elapsed time</u>: %d ms" % (dt*1000))
        tabs.setCurrentIndex(0)
开发者ID:gyenney,项目名称:Tools,代码行数:33,代码来源:CurveBenchmark.py

示例2: __init__

# 需要导入模块: from qwt.qt.QtGui import QApplication [as 别名]
# 或者: from qwt.qt.QtGui.QApplication import processEvents [as 别名]
    def __init__(self, max_n, parent=None, **kwargs):
        super(BMDemo, self).__init__(parent=parent)
        self.setWindowTitle('Curve styles')
        tabs = QTabWidget()
        self.resize(1000, 800)
        
        # Force window to show up and refresh (for test purpose only)
        self.show()
        QApplication.processEvents()

        self.setCentralWidget(tabs)
        pts = 1000
        for points, symbols in zip((pts/10, pts/10, pts, pts),
                                   (True, False)*2):
            t0 = time.time()
            widget = CSWidget(points, symbols)
            symtext = "with%s symbols" % ("" if symbols else "out")
            title = '%d points, %s' % (points, symtext)
            tabs.addTab(widget, title)
            tabs.setCurrentWidget(widget)

            # Force widget to refresh (for test purpose only)
            QApplication.processEvents()

            time_str = "Elapsed time: %d ms" % ((time.time()-t0)*1000)
            widget.text.setText(time_str)
        tabs.setCurrentIndex(0)
开发者ID:gyenney,项目名称:Tools,代码行数:29,代码来源:CurveStyles.py

示例3: process_iteration

# 需要导入模块: from qwt.qt.QtGui import QApplication [as 别名]
# 或者: from qwt.qt.QtGui.QApplication import processEvents [as 别名]
    def process_iteration(self, title, description, widget, t0):
        self.tabs.addTab(widget, title)
        self.tabs.setCurrentWidget(widget)

        # Force widget to refresh (for test purpose only)
        QApplication.processEvents()

        time_str = "Elapsed time: %d ms" % ((time.time()-t0)*1000)
        widget.text.setText(time_str)
        self.text.append("<br><i>%s:</i><br>%s" % (description, time_str))
开发者ID:PierreRaybaut,项目名称:PythonQwt,代码行数:12,代码来源:CurveBenchmark.py

示例4: __init__

# 需要导入模块: from qwt.qt.QtGui import QApplication [as 别名]
# 或者: from qwt.qt.QtGui.QApplication import processEvents [as 别名]
    def __init__(self, max_n, parent=None, **kwargs):
        super(BMDemo, self).__init__(parent=parent)
        title = self.TITLE
        if kwargs.get('only_lines', False):
            title = '%s (%s)' % (title, 'only lines')
        self.setWindowTitle(title)
        self.tabs = QTabWidget()
        self.setCentralWidget(self.tabs)
        self.text = BMText(self)
        self.tabs.addTab(self.text, 'Contents')
        self.resize(*self.SIZE)

        # Force window to show up and refresh (for test purpose only)
        self.show()
        QApplication.processEvents()
        
        t0g = time.time()
        self.run_benchmark(max_n, **kwargs)
        dt = time.time()-t0g
        self.text.append("<br><br><u>Total elapsed time</u>: %d ms" % (dt*1e3))
        self.tabs.setCurrentIndex(0)
开发者ID:PierreRaybaut,项目名称:PythonQwt,代码行数:23,代码来源:CurveBenchmark.py


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