Class: QgsFocusWatcher¶
- class qgis.gui.QgsFocusWatcher(parent: QObject)¶
Bases:
PyQt5.QtCore.QObject
Constructor for QgsFocusWatcher.
- Parameters
parent – parent widget to catch focus events for. This class will automatically be installed as an event filter for parent.
A event filter for watching for focus events on a parent object. Usually QObjects must subclass and override methods like focusOutEvent to handle focus events. Using this class as an event filter avoids the need to subclass objects and the focus events can be directly caught using the emitted signals.
Methods
- param obj
Signals
Emitted when parent object’s focus changes.
Emitted when parent object gains focus.
Emitted when parent object loses focus.
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- customEvent(self, QEvent)¶
- disconnectNotify(self, QMetaMethod)¶
- eventFilter(self, obj: QObject, event: QEvent) → bool¶
- Parameters
obj (QObject) –
event (QEvent) –
- Return type
bool
- focusChanged¶
Emitted when parent object’s focus changes.
- Parameters
focused (bool) –
True
if object gained focus,False
if object lost focus [signal]
- focusIn¶
Emitted when parent object gains focus. [signal]
- focusOut¶
Emitted when parent object loses focus. [signal]
- isSignalConnected(self, QMetaMethod) → bool¶
- receivers(self, PYQT_SIGNAL) → int¶
- sender(self) → QObject¶
- senderSignalIndex(self) → int¶
- timerEvent(self, QTimerEvent)¶