# class KToggleAction

###

Module | kdeui
Namespace |
Class | KToggleAction
Inherits | KAction

Checkbox like action.

This action provides two states: checked or not.

### methods

- KToggleAction (parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  parent | QObject |

  Constructs an action with the specified parent.

  parent - The action's parent object.

- KToggleAction (text, parent)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  text | QString |
  parent | QObject |

  Constructs an action with text; a shortcut may be specified by the ampersand character (e.g. "&Option" creates a shortcut with key O )

  This is the most common KAction used when you do not have a corresponding icon (note that it won't appear in the current version of the "Edit ToolBar" dialog, because an action needs an icon to be plugged in a toolbar...).

  text - The text that will be displayed.

  parent - The action's parent object.

- KToggleAction (icon, text, parent)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  icon | KIcon |
  text | QString |
  parent | QObject |

  Constructs an action with text and an icon; a shortcut may be specified by the ampersand character (e.g. "&Option" creates a shortcut with key O )

  This is the other common KAction used. Use it when you do have a corresponding icon.

  icon - The icon to display.

  text - The text that will be displayed.

  parent - The action's parent object.

- KToggleAction (a0)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QObject |

- setCheckedState (checkedItem)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  checkedItem | KGuiItem |

  Defines the text (and icon, tooltip, whatsthis) that should be displayed instead of the normal text, when the action is checked. Note that this does not replace the check box in front of the menu. So you should not use it to replace the text "Show <foo>" with "Hide <foo>", for example.

  If hasIcon(), the icon is kept for the 'checked state', unless checkedItem defines an icon explicitly. Same thing for tooltip and whatsthis.

- slotToggled (checked)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  checked | bool |