enthought / pyface

pyface: traits-capable windowing framework
Other
105 stars 55 forks source link

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

Closed corranwebster closed 2 years ago

corranwebster commented 2 years ago

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 https://github.com/enthought/mayavi/pull/1158

corranwebster commented 2 years ago

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