andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 38 forks source link

Can't set shortcuts with letters in "Application shortcuts" #56

Closed vi closed 12 years ago

vi commented 12 years ago

In latest (b83c92b82105a0bad13fd745a16be20535e9876f) Enki:

  1. Settings -> Application shortcuts...
  2. "Show completions"
  3. Try to assign "Ctrl+P"
Traceback (most recent call last):
  File "/mnt/sda8/src/git/enki/bin/../enki/plugins/appshortcuts/ActionShortcutEditor.py", line 38, in keyPressEvent
    self.setText( self.keySequence( event ) )
  File "/mnt/sda8/src/git/enki/bin/../enki/plugins/appshortcuts/ActionShortcutEditor.py", line 86, in keySequence
    self._keys |= event.key()
TypeError: unsupported operand type(s) for |=: 'KeyboardModifiers' and 'int'
andreikop commented 12 years ago

Has shortcuts editor worked for you earlier? Which Qt and PyQt version do you use? Could you please execute with interactive python next code:

from PyQt4.QtCore import Qt; from PyQt4.QtGui import QKeySequence; mod = Qt.KeyboardModifiers(Qt.ControlModifier); mod |= 0x01000005; print QKeySequence(mod).toString()
vi commented 12 years ago
Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40) 
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt4.QtCore import Qt; from PyQt4.QtGui import QKeySequence; mod = Qt.KeyboardModifiers(Qt.ControlModifier); mod |= 0x01000005; print QKeySequence(mod).toString()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for |=: 'KeyboardModifiers' and 'int'
cat /var/lib/dpkg/status | grep '^Package: python-qt4$' -A 10 | grep Version
Version: 4.7.3-1+b1
andreikop commented 12 years ago

Thanks

Fixed problem with old PyQt4