Class: QgsFocusWatcher

class qgis.gui.QgsFocusWatcher(parent: QObject)

Bases: PyQt5.QtCore.QObject

Constructor for QgsFocusWatcher.

Parameters

parent (QObject) – 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

childEvent

connectNotify

customEvent

disconnectNotify

eventFilter

param obj

isSignalConnected

receivers

sender

senderSignalIndex

timerEvent

Signals

focusChanged

Emitted when parent object’s focus changes.

focusIn

Emitted when parent object gains focus.

focusOut

Emitted when parent object loses focus.

childEvent()
connectNotify()
customEvent()
disconnectNotify()
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()
receivers()
sender()
senderSignalIndex()
timerEvent()