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.

New in version 2.16: Enums

Methods

childEvent
connectNotify
customEvent
disconnectNotify
eventFilter
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.

Attributes

childEvent()
connectNotify()
customEvent()
disconnectNotify()
eventFilter(self, obj: QObject, event: QEvent) → bool
focusChanged

Emitted when parent object’s focus changes.

Parameters:focusedTrue 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()