summaryrefslogtreecommitdiff
path: root/qutebrowser/keyinput/eventfilter.py
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2020-01-13 08:07:16 +0100
committerFlorian Bruhin <me@the-compiler.org>2020-01-13 08:17:04 +0100
commit9d4de0163a9db8cfaa4e08b7f6189445ef02bfd9 (patch)
tree76fa5d37febb38c1c7e2eb09d055744071672736 /qutebrowser/keyinput/eventfilter.py
parent29e0127034b8ed08425bde902d46b227e669c49f (diff)
downloadqutebrowser-9d4de0163a9db8cfaa4e08b7f6189445ef02bfd9.tar.gz
qutebrowser-9d4de0163a9db8cfaa4e08b7f6189445ef02bfd9.zip
Add types for eventfilter/quitter
Diffstat (limited to 'qutebrowser/keyinput/eventfilter.py')
-rw-r--r--qutebrowser/keyinput/eventfilter.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/qutebrowser/keyinput/eventfilter.py b/qutebrowser/keyinput/eventfilter.py
index 72b82e7c1..7916f16fe 100644
--- a/qutebrowser/keyinput/eventfilter.py
+++ b/qutebrowser/keyinput/eventfilter.py
@@ -47,11 +47,11 @@ class EventFilter(QObject):
QEvent.ShortcutOverride: self._handle_key_event,
}
- def install(self):
+ def install(self) -> None:
QApplication.instance().installEventFilter(self)
@pyqtSlot()
- def shutdown(self):
+ def shutdown(self) -> None:
QApplication.instance().removeEventFilter(self)
def _handle_key_event(self, event: QKeyEvent) -> bool:
@@ -105,7 +105,8 @@ class EventFilter(QObject):
raise
-def init():
+def init() -> None:
+ """Initialize the global EventFilter instance."""
event_filter = EventFilter(parent=QApplication.instance())
event_filter.install()
quitter.instance.shutting_down.connect(event_filter.shutdown)