• PySide 模块
  • PySide.QtCore
  • 内容表

    上一话题

    QAbstractEventDispatcher

    下一话题

    QCoreApplication

    QEventLoop

    概要

    函数

    详细描述

    PySide.QtCore.QEventLoop class provides a means of entering and leaving an event loop.

    At any time, you can create a PySide.QtCore.QEventLoop object and call exec() on it to start a local event loop. From within the event loop, calling PySide.QtCore.QEventLoop.exit() will force exec() to return.

    class PySide.QtCore. QEventLoop ( [ parent=None ] )
    参数: parent PySide.QtCore.QObject

    构造事件循环对象采用给定 parent .

    PySide.QtCore.QEventLoop. ProcessEventsFlag

    此枚举控制处理事件的类型通过 PySide.QtCore.QEventLoop.processEvents() 函数。

    常量 描述
    QEventLoop.AllEvents 所有事件。注意: DeferredDelete 事件会被特殊处理。见 QObject.deleteLater() 了解更多细节。
    QEventLoop.ExcludeUserInputEvents 不处理用户输入事件,譬如 ButtonPress 和 KeyPress。注意,事件未被丢弃;会交付他们当下次 PySide.QtCore.QEventLoop.processEvents() is called without the ExcludeUserInputEvents 标志。
    QEventLoop.ExcludeSocketNotifiers 不处理套接字通知事件。注意,事件未被丢弃;会交付他们当下次 PySide.QtCore.QEventLoop.processEvents() is called without the ExcludeSocketNotifiers 标志。
    QEventLoop.WaitForMoreEvents 等待事件,若没有待决事件可用。
    QEventLoop.DeferredDeletion deprecated - do not use.
    PySide.QtCore.QEventLoop. exec_ ( [ flags=QEventLoop.AllEvents ] )
    参数: flags PySide.QtCore.QEventLoop.ProcessEventsFlags
    返回类型: PySide.QtCore.int
    PySide.QtCore.QEventLoop. exit ( [ returnCode=0 ] )
    参数: returnCode PySide.QtCore.int

    告诉事件循环,采用返回代码退出。

    在此函数被调用之后,事件循环返回从调用 exec() exec() function returns returnCode .

    按约定, returnCode 0 意味着成功,而任何非零值指示出错。

    注意:不像同名 C 库函数,此函数 does return to the caller – it is event processing that stops.

    PySide.QtCore.QEventLoop. isRunning ( )
    返回类型: PySide.QtCore.bool

    Returns true if the event loop is running; otherwise returns false. The event loop is considered running from the time when exec() is called until PySide.QtCore.QEventLoop.exit() 被调用。

    PySide.QtCore.QEventLoop. processEvents ( [ flags=QEventLoop.AllEvents ] )
    参数: flags PySide.QtCore.QEventLoop.ProcessEventsFlags
    返回类型: PySide.QtCore.bool
    PySide.QtCore.QEventLoop. processEvents ( flags , maximumTime )
    参数:
    • flags PySide.QtCore.QEventLoop.ProcessEventsFlags
    • maximumTime PySide.QtCore.int
    PySide.QtCore.QEventLoop. quit ( )

    告诉事件循环要正常退出。

    如同 exit(0)。

    PySide.QtCore.QEventLoop. wakeUp ( )

    唤醒事件循环。