diff options
author | Florian Bruhin <me@the-compiler.org> | 2023-07-19 17:07:04 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2023-07-19 17:08:24 +0200 |
commit | 92dea988c01e74596cc6ed698e88ac56df392c14 (patch) | |
tree | 3fa4099b4ead84d5f057e532c44b3c605979fe04 /qutebrowser/mainwindow/statusbar/command.py | |
parent | 3b04cb1d99244516b21084545d06daa7e58cd756 (diff) | |
download | qutebrowser-92dea988c01e74596cc6ed698e88ac56df392c14.tar.gz qutebrowser-92dea988c01e74596cc6ed698e88ac56df392c14.zip |
Initial upgrade to new PyQt6 stubs
Diffstat (limited to 'qutebrowser/mainwindow/statusbar/command.py')
-rw-r--r-- | qutebrowser/mainwindow/statusbar/command.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/qutebrowser/mainwindow/statusbar/command.py b/qutebrowser/mainwindow/statusbar/command.py index b9c78d623..68bacd0b0 100644 --- a/qutebrowser/mainwindow/statusbar/command.py +++ b/qutebrowser/mainwindow/statusbar/command.py @@ -264,13 +264,14 @@ class Command(misc.CommandLineEdit): text = cast(str, text) super().setText(text) - def keyPressEvent(self, e: QKeyEvent) -> None: + def keyPressEvent(self, e: Optional[QKeyEvent]) -> None: """Override keyPressEvent to ignore Return key presses, and add Shift-Ins. If this widget is focused, we are in passthrough key mode, and Enter/Shift+Enter/etc. will cause QLineEdit to think it's finished without command_accept to be called. """ + assert e is not None if machinery.IS_QT5: # FIXME:v4 needed for Qt 5 typing shift = cast(Qt.KeyboardModifiers, Qt.KeyboardModifier.ShiftModifier) else: |