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