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


Python QApplication.processEvents方法代码示例

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


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

示例1: test_delete_save

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import processEvents [as 别名]
def test_delete_save(modeler, mgr, model):
    path = "test_delete_save.uamodel"
    val = 0.99
    modeler.tree_ui.expand_to_node("Objects")
    obj_node = mgr.add_folder(1, "myobj")
    obj2_node = mgr.add_folder(1, "myobj2")
    QApplication.processEvents()
    modeler.tree_ui.expand_to_node("myobj2")
    var_node = mgr.add_variable(1, "myvar", val)
    mgr.save_ua_model(path)
    mgr.save_xml(path)

    QApplication.processEvents()
    modeler.tree_ui.expand_to_node(obj2_node)
    mgr.delete_node(obj2_node)
    mgr.save_ua_model(path)
    mgr.save_xml(path)
    assert obj2_node not in mgr.new_nodes
    assert var_node not in mgr.new_nodes 
开发者ID:FreeOpcUa,项目名称:opcua-modeler,代码行数:21,代码来源:test_uamodeler.py

示例2: _click_js

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import processEvents [as 别名]
def _click_js(self, _click_target: usertypes.ClickTarget) -> None:
        # FIXME:qtwebengine Have a proper API for this
        # pylint: disable=protected-access
        view = self._tab._widget
        assert view is not None
        # pylint: enable=protected-access
        attribute = QWebEngineSettings.JavascriptCanOpenWindows
        could_open_windows = view.settings().testAttribute(attribute)
        view.settings().setAttribute(attribute, True)

        # Get QtWebEngine do apply the settings
        # (it does so with a 0ms QTimer...)
        # This is also used in Qt's tests:
        # https://github.com/qt/qtwebengine/commit/5e572e88efa7ba7c2b9138ec19e606d3e345ac90
        QApplication.processEvents(  # type: ignore[call-overload]
            QEventLoop.ExcludeSocketNotifiers |
            QEventLoop.ExcludeUserInputEvents)

        def reset_setting(_arg: typing.Any) -> None:
            """Set the JavascriptCanOpenWindows setting to its old value."""
            assert view is not None
            try:
                view.settings().setAttribute(attribute, could_open_windows)
            except RuntimeError:
                # Happens if this callback gets called during QWebEnginePage
                # destruction, i.e. if the tab was closed in the meantime.
                pass

        self._js_call('click', callback=reset_setting) 
开发者ID:qutebrowser,项目名称:qutebrowser,代码行数:31,代码来源:webengineelem.py

示例3: start

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import processEvents [as 别名]
def start(self, text, maximum):
        """Start showing a progress dialog."""
        self._progress = QProgressDialog()
        self._progress.setMinimumDuration(500)
        self._progress.setLabelText(text)
        self._progress.setMaximum(maximum)
        self._progress.setCancelButton(None)
        self._progress.show()
        QApplication.processEvents() 
开发者ID:qutebrowser,项目名称:qutebrowser,代码行数:11,代码来源:history.py

示例4: tick

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import processEvents [as 别名]
def tick(self):
        """Increase the displayed progress value."""
        self._value += 1
        if self._progress is not None:
            self._progress.setValue(self._value)
            QApplication.processEvents() 
开发者ID:qutebrowser,项目名称:qutebrowser,代码行数:8,代码来源:history.py

示例5: clear_widgets

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import processEvents [as 别名]
def clear_widgets(self):
        item = self.layout().takeAt(0)
        if item:
            item.widget().hide()
            item.widget().setParent(None)
        QApplication.processEvents() 
开发者ID:Scille,项目名称:parsec-cloud,代码行数:8,代码来源:instance_widget.py

示例6: UpdateSurface

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import processEvents [as 别名]
def UpdateSurface(self):
        ''' Update Video Surface only is is stopped or paused '''
        if self.parent.playerState in (QMediaPlayer.StoppedState,
                                       QMediaPlayer.PausedState):
            self.update()
        QApplication.processEvents() 
开发者ID:All4Gis,项目名称:QGISFMV,代码行数:8,代码来源:QgsVideo.py

示例7: resizeEvent

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import processEvents [as 别名]
def resizeEvent(self, _):
        """
        @type _: QMouseEvent
        @param _:
        @return:
        """
        self.surface.updateVideoRect()
        self.update()
        # Magnifier Glass
        if self._interaction.magnifier and not self.dragPos.isNull():
            draw.drawMagnifierOnVideo(self, self.dragPos, self.currentFrame(), self.painter)
        # QApplication.processEvents() 
开发者ID:All4Gis,项目名称:QGISFMV,代码行数:14,代码来源:QgsVideo.py

示例8: initProgressbar

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import processEvents [as 别名]
def initProgressbar(self, maximum):
        if self.pb is not None:
            self.pb.setValue(0)
            self.pb.setMaximum(maximum)
            QApplication.processEvents() 
开发者ID:jagodki,项目名称:Offline-MapMatching,代码行数:7,代码来源:hidden_model.py

示例9: updateProgressbar

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import processEvents [as 别名]
def updateProgressbar(self):
        if self.pb is not None:
            self.pb.setValue(self.pb.value() + 1)
            QApplication.processEvents() 
开发者ID:jagodki,项目名称:Offline-MapMatching,代码行数:6,代码来源:hidden_model.py

示例10: _repr_png_

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import processEvents [as 别名]
def _repr_png_(self):
        """This is used by ipython to plot inline.
        """
        app.process_events()
        QApplication.processEvents()

        img = read_pixels()
        return bytes(_make_png(img)) 
开发者ID:wonambi-python,项目名称:wonambi,代码行数:10,代码来源:base.py

示例11: update

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import processEvents [as 别名]
def update(self, value):
            if self.dialog:
                self.dialog.setValue(value)
                QApplication.processEvents()
            else:
                print('Progress: %.2f%% done' % value) 
开发者ID:TUDelft-CNS-ATM,项目名称:bluesky,代码行数:8,代码来源:load_visuals_txt.py

示例12: showMessage

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import processEvents [as 别名]
def showMessage(self, msg):
        """Show the progress message on the splash image"""
        super(SplashScreen, self).showMessage(msg, self.labelAlignment, Qt.white)
        QApplication.processEvents() 
开发者ID:hustlei,项目名称:QssStylesheetEditor,代码行数:6,代码来源:splash.py

示例13: clearMessage

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import processEvents [as 别名]
def clearMessage(self):
        """Clear message on the splash image"""
        super(SplashScreen, self).clearMessage()
        QApplication.processEvents() 
开发者ID:hustlei,项目名称:QssStylesheetEditor,代码行数:6,代码来源:splash.py

示例14: test_participant_table

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import processEvents [as 别名]
def test_participant_table(self):
        stc = self.form.simulator_tab_controller  # type: SimulatorTabController
        stc.ui.tabWidget.setCurrentIndex(2)
        self.assertEqual(stc.participant_table_model.rowCount(), 0)

        for i in range(3):
            stc.ui.btnAddParticipant.click()

        QApplication.processEvents()
        self.assertEqual(stc.participant_table_model.rowCount(), 3)

        participants = stc.project_manager.participants
        self.assertEqual(participants[0].name, "Alice")
        self.assertEqual(participants[1].name, "Bob")
        self.assertEqual(participants[2].name, "Carl")

        stc.ui.tableViewParticipants.selectRow(1)
        stc.ui.btnUp.click()

        self.assertEqual(participants[0].name, "Bob")
        self.assertEqual(participants[1].name, "Alice")
        self.assertEqual(participants[2].name, "Carl")

        stc.ui.btnDown.click()

        self.assertEqual(participants[0].name, "Alice")
        self.assertEqual(participants[1].name, "Bob")
        self.assertEqual(participants[2].name, "Carl")

        stc.ui.btnDown.click()

        self.assertEqual(participants[0].name, "Alice")
        self.assertEqual(participants[1].name, "Carl")
        self.assertEqual(participants[2].name, "Bob") 
开发者ID:jopohl,项目名称:urh,代码行数:36,代码来源:test_simulator_tab_gui.py

示例15: updateSigProgress

# 需要导入模块: from PyQt5.QtWidgets import QApplication [as 别名]
# 或者: from PyQt5.QtWidgets.QApplication import processEvents [as 别名]
def updateSigProgress(self, percent):
        messageText = self.messageText + "Signature Progress: <b style='color:red'>" + str(percent) + " %</b>"
        self.mBox2.setText(messageText)
        QApplication.processEvents() 
开发者ID:PIVX-Project,项目名称:PIVX-SPMT,代码行数:6,代码来源:ledgerClient.py


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