• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

KToggleAction Class Reference

Checkbox like action. More...

#include <ktoggleaction.h>

Inheritance diagram for KToggleAction:
KAction QWidgetAction KToggleFullScreenAction KToggleToolBarAction

List of all members.

Public Member Functions

 KToggleAction (const KIcon &icon, const QString &text, QObject *parent)
 KToggleAction (const QString &text, QObject *parent)
 KToggleAction (QObject *parent)
void setCheckedState (const KGuiItem &checkedItem)
virtual ~KToggleAction ()

Protected Slots

virtual void slotToggled (bool checked)

Detailed Description

Checkbox like action.

This action provides two states: checked or not.

Definition at line 40 of file ktoggleaction.h.


Constructor & Destructor Documentation

KToggleAction::KToggleAction ( QObject *  parent  )  [explicit]

Constructs an action with the specified parent.

Parameters:
parent The action's parent object.

Definition at line 60 of file ktoggleaction.cpp.

KToggleAction::KToggleAction ( const QString &  text,
QObject *  parent 
)

Constructs an action with text; a shortcut may be specified by the ampersand character (e.g.

"&amp;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...).

Parameters:
text The text that will be displayed.
parent The action's parent object.

Definition at line 67 of file ktoggleaction.cpp.

KToggleAction::KToggleAction ( const KIcon &  icon,
const QString &  text,
QObject *  parent 
)

Constructs an action with text and an icon; a shortcut may be specified by the ampersand character (e.g.

"&amp;Option" creates a shortcut with key O )

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

Parameters:
icon The icon to display.
text The text that will be displayed.
parent The action's parent object.

Definition at line 74 of file ktoggleaction.cpp.

KToggleAction::~KToggleAction (  )  [virtual]

Destructor.

Definition at line 81 of file ktoggleaction.cpp.


Member Function Documentation

void KToggleAction::setCheckedState ( const KGuiItem &  checkedItem  ) 

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.

Definition at line 87 of file ktoggleaction.cpp.

void KToggleAction::slotToggled ( bool  checked  )  [protected, virtual, slot]

Definition at line 93 of file ktoggleaction.cpp.


The documentation for this class was generated from the following files:
  • ktoggleaction.h
  • ktoggleaction.cpp

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal