# eric7.Preferences.ShortcutDialog

Module implementing a dialog for the configuration of a keyboard shortcut.

### Global Attributes

None

### Classes

ShortcutDialog | Class implementing a dialog for the configuration of a keyboard shortcut.

### Functions

None

## ShortcutDialog

Class implementing a dialog for the configuration of a keyboard shortcut.

### Signals

shortcutChanged(QKeySequence, QKeySequence, bool, string)
  emitted after the OK button was pressed

### Derived from

QDialog, Ui_ShortcutDialog

### Class Attributes

None

### Class Methods

None

### Methods

ShortcutDialog | Constructor
__clear | Private slot to handle the Clear button press.
__clearKeys | Private method to clear the list of recorded keys.
__setKeyEditText | Private method to set the text of a key edit.
__typeChanged | Private slot to handle the change of the shortcuts type.
eventFilter | Public method called to filter the event queue.
keyPressEvent | Protected method to handle a key press event.
on_buttonBox_accepted | Private slot to handle the OK button press.
setKeys | Public method to set the key to be configured.

### Static Methods

None

#### ShortcutDialog (Constructor)

ShortcutDialog(parent=None, name=None, modal=False)

Constructor

parent
  The parent widget of this dialog. (QWidget)
name
  The name of this dialog. (string)
modal
  Flag indicating a modal dialog. (boolean)

#### ShortcutDialog.__clear

__clear()

Private slot to handle the Clear button press.

#### ShortcutDialog.__clearKeys

__clearKeys()

Private method to clear the list of recorded keys.

#### ShortcutDialog.__setKeyEditText

__setKeyEditText(txt)

Private method to set the text of a key edit.

txt
  text to be set (string)

#### ShortcutDialog.__typeChanged

__typeChanged()

Private slot to handle the change of the shortcuts type.

#### ShortcutDialog.eventFilter

eventFilter(watched, event)

Public method called to filter the event queue.

watched
  the QObject being watched
event
  the event that occurred

Return:
  always False

#### ShortcutDialog.keyPressEvent

keyPressEvent(evt)

Protected method to handle a key press event.

evt
  the key event (QKeyEvent)

#### ShortcutDialog.on_buttonBox_accepted

on_buttonBox_accepted()

Private slot to handle the OK button press.

#### ShortcutDialog.setKeys

setKeys(key, alternateKey, noCheck, objectType)

Public method to set the key to be configured.

key
  key sequence to be changed (QKeySequence)
alternateKey
  alternate key sequence to be changed (QKeySequence)
noCheck
  flag indicating that no uniqueness check should be performed (boolean)
objectType
  type of the object (string).

Up