Skip to content

EventLoop

Qt Base Class: QEventLoop

Signature: QEventLoop(self, parent: Optional[PySide6.QtCore.QObject] = None) -> None

Base classes

Name Children Inherits
ObjectMixin
prettyqt.core.object
QEventLoop
PySide6.QtCore
QEventLoop(self, parent: Optional[PySide6.QtCore.QObject] \= None) -> None

⋔ Inheritance diagram

graph TD
  1473299823808["core.EventLoop"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473288924224["QtCore.QEventLoop"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473299815024 --> 1473299823808
  140713234304496 --> 1473299815024
  1473288924224 --> 1473299823808
  1473288842240 --> 1473288924224
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: ObjectMixin, QEventLoop

Means of entering and leaving an event loop.

Source code in prettyqt\core\eventloop.py
class EventLoop(core.ObjectMixin, core.QEventLoop):
    """Means of entering and leaving an event loop."""

    def __init__(self, *args, **kwargs) -> None:
        super().__init__(*args, **kwargs)
        self._executing = False

    def execute(
        self,
        user_input: bool = True,
        socket_notifiers: bool = True,
        wait_for_more: bool = False,
    ) -> int:
        if self._executing:
            raise AssertionError("Eventloop is already running!")
        self._executing = True
        flag = core.QEventLoop.ProcessEventsFlag(0)
        if not user_input:
            flag |= 1
        if not socket_notifiers:
            flag |= 2
        if wait_for_more:
            flag |= 4
        status = self.exec(flag)
        self._executing = False
        return status

⌗ Property table

Qt Property Type Doc
objectName QString