# eric4.E4Gui.E4Action

Module implementing an Action class extending QAction.

This extension is necessary in order to support alternate keyboard shortcuts.

### Global Attributes

None

### Classes

ArgumentsError | Class implementing an exception, which is raised, if the wrong number of arguments are given.
E4Action | Class implementing an Action class extending QAction.

### Functions

addActions | Module function to add a list of actions to a widget.
createActionGroup | Module function to create an action group.

## ArgumentsError

Class implementing an exception, which is raised, if the wrong number of arguments are given.

### Derived from

RuntimeError

### Class Attributes

None

### Methods

ArgumentsError | Constructor
__repr__ | Private method returning a representation of the exception.
__str__ | Private method returning a string representation of the exception.

#### ArgumentsError (Constructor)

ArgumentsError(error)

Constructor

#### ArgumentsError.__repr__

__repr__()

Private method returning a representation of the exception.

Returns:
  string representing the error message

#### ArgumentsError.__str__

__str__()

Private method returning a string representation of the exception.

Returns:
  string representing the error message

Up

## E4Action

Class implementing an Action class extending QAction.

### Derived from

QAction

### Class Attributes

None

### Methods

E4Action | Constructor
alternateShortcut | Public method to retrieve the alternative keyboard shortcut.
setAlternateShortcut | Public slot to set the alternative keyboard shortcut.

#### E4Action (Constructor)

E4Action(*args)

Constructor

args
  argument list of the constructor. This list is one of
  - text (string or QString), icon (QIcon), menu text (string or QString), accelarator (QKeySequence), alternative accelerator (QKeySequence), parent (QObject), name (string or QString), toggle (boolean)
  - text (string or QString), icon (QIcon), menu text (string or QString), accelarator (QKeySequence), alternative accelerator (QKeySequence), parent (QObject), name (string or QString)
  - text (string or QString), menu text (string or QString), accelarator (QKeySequence), alternative accelerator (QKeySequence), parent (QObject), name (string or QString), toggle (boolean)
  - text (string or QString), menu text (string or QString), accelarator (QKeySequence), alternative accelerator (QKeySequence), parent (QObject), name (string or QString)

#### E4Action.alternateShortcut

alternateShortcut()

Public method to retrieve the alternative keyboard shortcut.

Returns:
  the alternative accelerator (QKeySequence)

#### E4Action.setAlternateShortcut

setAlternateShortcut(shortcut)

Public slot to set the alternative keyboard shortcut.

shortcut
  the alternative accelerator (QKeySequence)

Up

## addActions

addActions(target, actions)

Module function to add a list of actions to a widget.

target
  reference to the target widget (QWidget)
actions
  list of actions to be added to the target. A None indicates a separator (list of QActions)

Up

## createActionGroup

createActionGroup(parent, name = None, exclusive = False)

Module function to create an action group.

parent
  parent object of the action group (QObject)
name
  name of the action group object (string or QString)
exclusive
  flag indicating an exclusive action group (boolean)

Returns:
  reference to the created action group (QActionGroup)

Up