Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report: Arrow keys not working in Qt6 Console #1147

Closed
corranwebster opened this issue Jul 8, 2022 · 1 comment · Fixed by #1148
Closed

Bug report: Arrow keys not working in Qt6 Console #1147

corranwebster opened this issue Jul 8, 2022 · 1 comment · Fixed by #1148

Comments

@corranwebster
Copy link
Contributor

corranwebster commented Jul 8, 2022

Environment

OS: all
Python version: 3.8
Toolkit: Qt
Qt API: PyQt6/PySide6

Description

Using arrow keys to move around in the Console widget produces tracebacks.

Traceback (most recent call last):
  File "/Users/cwebster/.edm/envs/mayavi-38/lib/python3.8/site-packages/pyface/ui/qt4/console/console_widget.py", line 243, in eventFilter
    return self._event_filter_console_keypress(event)
  File "/Users/cwebster/.edm/envs/mayavi-38/lib/python3.8/site-packages/pyface/ui/qt4/python_shell.py", line 366, in _event_filter_console_keypress
    return super()._event_filter_console_keypress(event)
  File "/Users/cwebster/.edm/envs/mayavi-38/lib/python3.8/site-packages/pyface/ui/qt4/console/console_widget.py", line 1352, in _event_filter_console_keypress
    cursor.movePosition(QtGui.QTextCursor.MoveOperation.Right, mode=anchormode)
AttributeError: PySide6.QtGui.QTextCursor.movePosition(): unsupported keyword 'mode'

See enthought/mayavi#1158

corranwebster added a commit that referenced this issue Jul 8, 2022
@corranwebster
Copy link
Contributor Author

FWIW, this would seem to be a bug in PySide6 rather than the code in question: see the docs at https://doc.qt.io/qt-6/qtextcursor.html#movePosition

corranwebster added a commit that referenced this issue Jul 8, 2022
corranwebster added a commit that referenced this issue Jul 8, 2022
* Add regression test for #1146.

* Make tests fail for the right reasons.

* Add a regression test for #1147.

* Fix calls to font metrics width and cursor movePosition.

Fixes #1146 and #1147.

* Add a comment about #1147.
corranwebster added a commit that referenced this issue Jul 8, 2022
* Add regression test for #1146.

* Make tests fail for the right reasons.

* Add a regression test for #1147.

* Fix calls to font metrics width and cursor movePosition.

Fixes #1146 and #1147.

* Add a comment about #1147.
corranwebster added a commit that referenced this issue Jul 11, 2022
* Add regression test for #1146.

* Make tests fail for the right reasons.

* Add a regression test for #1147.

* Fix calls to font metrics width and cursor movePosition.

Fixes #1146 and #1147.

* Add a comment about #1147.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant