Skip to content

TextUpdateEventFilter

Qt Base Class: QObject

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

Base classes

Name Children Inherits
BaseEventFilter
prettyqt.eventfilters.baseeventfilter

Subclasses

Class Module Description
TimeLabelEventFilter prettyqt.eventfilters.timelabeleventfilter
DateLabelEventFilter prettyqt.eventfilters.timelabeleventfilter

⋔ Inheritance diagram

graph TD
  1473367051120["eventfilters.TextUpdateEventFilter"]
  1473367044288["eventfilters.BaseEventFilter"]
  1473299782816["core.Object"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473288842240["QtCore.QObject"]
  1473291690208["Shiboken.Object"]
  1473367044288 --> 1473367051120
  1473299782816 --> 1473367044288
  1473299815024 --> 1473299782816
  140713234304496 --> 1473299815024
  1473288842240 --> 1473299782816
  1473291690208 --> 1473288842240
  140713234304496 --> 1473291690208

🛈 DocStrings

Bases: BaseEventFilter

Source code in prettyqt\eventfilters\timelabeleventfilter.py
class TextUpdateEventFilter(eventfilters.BaseEventFilter):
    def __init__(self, parent, interval: int = 1000, **kwargs):
        super().__init__(parent, **kwargs)
        parent.startTimer(interval)
        self._update_text()

    def eventFilter(self, obj, event: core.QEvent) -> bool:
        # if obj is not self.parent():
        #     return super().eventFilter(obj, event)
        match event.type():
            case core.Event.Type.Timer:
                self._update_text()
                return True
        return super().eventFilter(obj, event)

    def _update_text(self):
        return NotImplemented

⌗ Property table

Qt Property Type Doc
objectName QString