\section{KAction Class Reference}
\label{classKAction}\index{KAction@{KAction}}
Class to encapsulate user-driven action or event.  


{\tt \#include $<$kaction.h$>$}

Inheritance diagram for KAction:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=163pt]{classKAction__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KAction:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=96pt]{classKAction__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf Activation\-Reason} \{ \par
{\bf Unknown\-Activation}, 
{\bf Emulated\-Activation}, 
{\bf Accel\-Activation}, 
{\bf Popup\-Menu\-Activation}, 
\par
{\bf Tool\-Bar\-Activation}
 \}
\end{CompactItemize}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
virtual void {\bf set\-Text} (const {\bf QString} \&text)
\item 
virtual bool {\bf set\-Shortcut} (const {\bf KShortcut} \&)
\item 
virtual void {\bf set\-Group} (const {\bf QString} \&)\label{classKAction_i2}

\item 
virtual void {\bf set\-Whats\-This} (const {\bf QString} \&text)
\item 
virtual void {\bf set\-Tool\-Tip} (const {\bf QString} \&)
\item 
virtual void {\bf set\-Icon\-Set} (const {\bf QIcon\-Set} \&icon\-Set)
\item 
virtual void {\bf set\-Icon} (const {\bf QString} \&icon)\label{classKAction_i6}

\item 
virtual void {\bf set\-Enabled} (bool enable)
\item 
virtual void {\bf set\-Shortcut\-Configurable} (bool)
\item 
virtual void {\bf activate} ()
\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf activated} ()
\item 
void {\bf activated} ({\bf KAction::Activation\-Reason} reason, Qt::Button\-State state)
\item 
void {\bf enabled} (bool)\label{classKAction_l2}

\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KAction} (const {\bf QString} \&text, const {\bf KShortcut} \&cut, const {\bf QObject} $\ast$receiver, const char $\ast$slot, {\bf KAction\-Collection} $\ast${\bf parent}, const char $\ast${\bf name})
\item 
{\bf KAction} (const {\bf QString} \&text, const {\bf QIcon\-Set} \&pix, const {\bf KShortcut} \&cut, const {\bf QObject} $\ast$receiver, const char $\ast$slot, {\bf KAction\-Collection} $\ast${\bf parent}, const char $\ast${\bf name})
\item 
{\bf KAction} (const {\bf QString} \&text, const {\bf QString} \&pix, const {\bf KShortcut} \&cut, const {\bf QObject} $\ast$receiver, const char $\ast$slot, {\bf KAction\-Collection} $\ast${\bf parent}, const char $\ast${\bf name})
\item 
{\bf KAction} (const {\bf KGui\-Item} \&item, const {\bf KShortcut} \&cut, const {\bf QObject} $\ast$receiver, const char $\ast$slot, {\bf KAction\-Collection} $\ast${\bf parent}, const char $\ast${\bf name})
\item 
{\bf KAction} (const {\bf QString} \&text, const {\bf KShortcut} \&cut={\bf KShortcut}(), {\bf QObject} $\ast${\bf parent}=0, const char $\ast${\bf name}=0)
\item 
{\bf KAction} (const {\bf QString} \&text, const {\bf KShortcut} \&cut, const {\bf QObject} $\ast$receiver, const char $\ast$slot, {\bf QObject} $\ast${\bf parent}, const char $\ast${\bf name}=0)
\item 
{\bf KAction} (const {\bf QString} \&text, const {\bf QIcon\-Set} \&pix, const {\bf KShortcut} \&cut={\bf KShortcut}(), {\bf QObject} $\ast${\bf parent}=0, const char $\ast${\bf name}=0)
\item 
{\bf KAction} (const {\bf QString} \&text, const {\bf QString} \&pix, const {\bf KShortcut} \&cut={\bf KShortcut}(), {\bf QObject} $\ast${\bf parent}=0, const char $\ast${\bf name}=0)
\item 
{\bf KAction} (const {\bf QString} \&text, const {\bf QIcon\-Set} \&pix, const {\bf KShortcut} \&cut, const {\bf QObject} $\ast$receiver, const char $\ast$slot, {\bf QObject} $\ast${\bf parent}, const char $\ast${\bf name}=0)
\item 
{\bf KAction} (const {\bf QString} \&text, const {\bf QString} \&pix, const {\bf KShortcut} \&cut, const {\bf QObject} $\ast$receiver, const char $\ast$slot, {\bf QObject} $\ast${\bf parent}, const char $\ast${\bf name}=0)
\item 
{\bf KAction} ({\bf QObject} $\ast${\bf parent}=0, const char $\ast${\bf name}=0)
\item 
virtual {\bf $\sim$KAction} ()
\item 
virtual int {\bf plug} ({\bf QWidget} $\ast$widget, int index=-1)
\item 
virtual void {\bf plug\-Accel} ({\bf KAccel} $\ast$accel, bool configurable=true) KDE\_\-DEPRECATED
\item 
virtual void {\bf unplug} ({\bf QWidget} $\ast$w)
\item 
virtual void {\bf unplug\-Accel} () KDE\_\-DEPRECATED
\item 
virtual bool {\bf is\-Plugged} () const 
\item 
bool {\bf is\-Plugged} (const {\bf QWidget} $\ast$container) const 
\item 
virtual bool {\bf is\-Plugged} (const {\bf QWidget} $\ast$container, int id) const 
\item 
virtual bool {\bf is\-Plugged} (const {\bf QWidget} $\ast$container, const {\bf QWidget} $\ast$\_\-representative) const 
\item 
{\bf QWidget} $\ast$ {\bf container} (int index) const \label{classKAction_a20}

\item 
int {\bf item\-Id} (int index) const \label{classKAction_a21}

\item 
{\bf QWidget} $\ast$ {\bf representative} (int index) const \label{classKAction_a22}

\item 
int {\bf container\-Count} () const \label{classKAction_a23}

\item 
uint {\bf kaccel\-Count} () const 
\item 
virtual bool {\bf has\-Icon} () const \label{classKAction_a25}

\item 
bool {\bf has\-Icon\-Set} () const \label{classKAction_a26}

\item 
virtual {\bf QString} {\bf plain\-Text} () const \label{classKAction_a27}

\item 
virtual {\bf QString} {\bf text} () const 
\item 
virtual const {\bf KShortcut} \& {\bf shortcut} () const 
\item 
virtual const {\bf KShortcut} \& {\bf shortcut\-Default} () const 
\item 
{\bf QString} {\bf shortcut\-Text} () const \label{classKAction_a31}

\item 
void {\bf set\-Shortcut\-Text} (const {\bf QString} \&)\label{classKAction_a32}

\item 
virtual bool {\bf is\-Enabled} () const 
\item 
virtual bool {\bf is\-Shortcut\-Configurable} () const 
\item 
virtual {\bf QString} {\bf group} () const \label{classKAction_a35}

\item 
virtual {\bf QString} {\bf whats\-This} () const 
\item 
virtual {\bf QString} {\bf tool\-Tip} () const 
\item 
virtual {\bf QIcon\-Set} {\bf icon\-Set} ({\bf KIcon::Group} group, int size=0) const 
\item 
{\bf QIcon\-Set} {\bf icon\-Set} () const \label{classKAction_a39}

\item 
virtual {\bf QString} {\bf icon} () const \label{classKAction_a40}

\item 
{\bf KAction\-Collection} $\ast$ {\bf parent\-Collection} () const \label{classKAction_a41}

\item 
void {\bf unplug\-All} ()\label{classKAction_a42}

\item 
int {\bf accel} () const KDE\_\-DEPRECATED
\item 
{\bf QString} {\bf status\-Text} () const \label{classKAction_a44}

\item 
void {\bf set\-Accel} (int key) KDE\_\-DEPRECATED
\item 
void {\bf set\-Status\-Text} (const {\bf QString} \&text)
\item 
int {\bf menu\-Id} (int i)
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static int {\bf get\-Tool\-Button\-ID} ()
\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
virtual void {\bf slot\-Destroyed} ()\label{classKAction_j0}

\item 
virtual void {\bf slot\-Keycode\-Changed} ()\label{classKAction_j1}

\item 
virtual void {\bf slot\-Activated} ()\label{classKAction_j2}

\item 
void {\bf slot\-Popup\-Activated} ()
\item 
void {\bf slot\-Button\-Clicked} (int, Qt::Button\-State state)
\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
{\bf KTool\-Bar} $\ast$ {\bf tool\-Bar} (int index) const \label{classKAction_b0}

\item 
{\bf QPopup\-Menu} $\ast$ {\bf popup\-Menu} (int index) const \label{classKAction_b1}

\item 
void {\bf remove\-Container} (int index)\label{classKAction_b2}

\item 
int {\bf find\-Container} (const {\bf QWidget} $\ast$widget) const \label{classKAction_b3}

\item 
int {\bf find\-Container} (int id) const \label{classKAction_b4}

\item 
void {\bf plug\-Main\-Window\-Accel} ({\bf QWidget} $\ast$w)\label{classKAction_b5}

\item 
void {\bf add\-Container} ({\bf QWidget} $\ast${\bf parent}, int id)\label{classKAction_b6}

\item 
void {\bf add\-Container} ({\bf QWidget} $\ast${\bf parent}, {\bf QWidget} $\ast$representative)\label{classKAction_b7}

\item 
virtual void {\bf update\-Shortcut} (int i)\label{classKAction_b8}

\item 
virtual void {\bf update\-Shortcut} ({\bf QPopup\-Menu} $\ast$menu, int id)\label{classKAction_b9}

\item 
virtual void {\bf update\-Group} (int id)\label{classKAction_b10}

\item 
virtual void {\bf update\-Text} (int i)\label{classKAction_b11}

\item 
virtual void {\bf update\-Enabled} (int i)\label{classKAction_b12}

\item 
virtual void {\bf update\-Icon\-Set} (int i)\label{classKAction_b13}

\item 
virtual void {\bf update\-Icon} (int i)\label{classKAction_b14}

\item 
virtual void {\bf update\-Tool\-Tip} (int id)\label{classKAction_b15}

\item 
virtual void {\bf update\-Whats\-This} (int i)\label{classKAction_b16}

\item 
{\bf QString} {\bf whats\-This\-With\-Icon} () const \label{classKAction_b17}

\item 
const {\bf KGui\-Item} \& {\bf gui\-Item} () const 
\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKAction_b19}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf KAction\-Collection} $\ast$ {\bf m\_\-parent\-Collection}\label{classKAction_p0}

\end{CompactItemize}
\subsection*{Properties}
\begin{CompactItemize}
\item 
int {\bf container\-Count}\label{classKAction_00}

\item 
{\bf QString} {\bf plain\-Text}\label{classKAction_01}

\item 
{\bf QString} {\bf text}\label{classKAction_02}

\item 
{\bf QString} {\bf shortcut}\label{classKAction_03}

\item 
bool {\bf enabled}\label{classKAction_04}

\item 
{\bf QString} {\bf group}\label{classKAction_05}

\item 
{\bf QString} {\bf whats\-This}\label{classKAction_06}

\item 
{\bf QString} {\bf tool\-Tip}\label{classKAction_07}

\item 
{\bf QString} {\bf icon}\label{classKAction_08}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf KAction\-Collection}\label{classKAction_n0}

\end{CompactItemize}


\subsection{Detailed Description}
Class to encapsulate user-driven action or event. 

The KAction class (and derived and super classes) provides a way to easily encapsulate a \char`\"{}real\char`\"{} user-selected action or event in your program.

For instance, a user may want to {\tt paste} the contents of the clipboard or {\tt scroll} {\tt down} a document or {\tt quit} the application. These are all {\tt actions} -- events that the user causes to happen. The KAction class allows the developer to deal with these actions in an easy and intuitive manner.

Specifically, the KAction class encapsulated the various attributes to an event/action. For instance, an action might have an icon that goes along with it (a clipboard for a \char`\"{}paste\char`\"{} action or scissors for a \char`\"{}cut\char`\"{} action). The action might have some text to describe the action. It will certainly have a method or function that actually {\tt executes} the action! All these attributes are contained within the KAction object.

The advantage of dealing with Actions is that you can manipulate the Action without regard to the GUI representation of it. For instance, in the \char`\"{}normal\char`\"{} way of dealing with actions like \char`\"{}cut\char`\"{}, you would manually insert a item for Cut into a menu and a button into a toolbar. If you want to disable the cut action for a moment (maybe nothing is selected), you would have to hunt down the pointer to the menu item and the toolbar button and disable both individually. Setting the menu item and toolbar item up uses very similar code - but has to be done twice!

With the Action concept, you simply \char`\"{}plug\char`\"{} the Action into whatever GUI element you want. The KAction class will then take care of correctly defining the menu item (with icons, accelerators, text, etc) or toolbar button.. or whatever. From then on, if you manipulate the Action at all, the effect will propogate through all GUI representations of it. Back to the \char`\"{}cut\char`\"{} example: if you want to disable the Cut Action, you would simply do 'cut\-Action-$>$set\-Enabled(false)' and the menuitem and button would instantly be disabled!

This is the biggest advantage to the Action concept -- there is a one-to-one relationship between the \char`\"{}real\char`\"{} action and {\tt all} GUI representations of it.

KAction emits the {\bf activated()}{\rm (p.\,\pageref{classKAction_l0})} signal if the user activated the corresponding GUI element ( menu item, toolbar button, etc. )

If you are in the situation of wanting to map the {\bf activated()}{\rm (p.\,\pageref{classKAction_l0})} signal of multiple action objects to one slot, with a special argument bound to each action, then you might consider using {\bf QSignal\-Mapper} . A tiny example:



\footnotesize\begin{verbatim} QSignalMapper *desktopNumberMapper = new QSignalMapper( this );
 connect( desktopNumberMapper, SIGNAL( mapped( int ) ),
          this, SLOT( moveWindowToDesktop( int ) ) );

 for ( uint i = 0; i < numberOfDesktops; ++i ) {
     KAction *desktopAction = new KAction( i18n( "Move Window to Desktop %i" ).arg( i ), ... );
     connect( desktopAction, SIGNAL( activated() ), desktopNumberMapper, SLOT( map() ) );
     desktopNumberMapper->setMapping( desktopAction, i );
 }
\end{verbatim}
\normalsize


{\bf General Usage:}\par


The steps to using actions are roughly as follows

\begin{itemize}
\item Decide which attributes you want to associate with a given action (icons, text, keyboard shortcut, etc) \item Create the action using KAction (or derived or super class). \item \char`\"{}Plug\char`\"{} the Action into whatever GUI element you want. Typically, this will be a menu or toolbar.\end{itemize}
{\bf Detailed Example:}\par


Here is an example of enabling a \char`\"{}New [document]\char`\"{} action 

\footnotesize\begin{verbatim} KAction *newAct = new KAction(i18n("&New"), "filenew",
                               KStdAccel::shortcut(KStdAccel::New),
                               this, SLOT(fileNew()),
                               actionCollection(), "new");
\end{verbatim}
\normalsize
 This line creates our action. It says that wherever this action is displayed, it will use \char`\"{}\&New\char`\"{} as the text, the standard icon, and the standard shortcut. It further says that whenever this action is invoked, it will use the file\-New() slot to execute it.



\footnotesize\begin{verbatim} QPopupMenu *file = new QPopupMenu;
 newAct->plug(file);
\end{verbatim}
\normalsize
 That just inserted the action into the File menu. The point is, it's not important in which menu it is: all manipulation of the item is done through the new\-Act object.



\footnotesize\begin{verbatim} newAct->plug(toolBar());
\end{verbatim}
\normalsize
 And this inserted the Action into the main toolbar as a button.

That's it!

If you want to disable that action sometime later, you can do so with 

\footnotesize\begin{verbatim} newAct->setEnabled(false)
\end{verbatim}
\normalsize
 and both the menuitem in File and the toolbar button will instantly be disabled.

Do not delete a KAction object without unplugging it from all its containers. The simplest way to do that is to use the unplug\-All() as in the following example: 

\footnotesize\begin{verbatim} newAct->unplugAll();
 delete newAct;
\end{verbatim}
\normalsize
 Normally you will not need to do this as {\bf KAction\-Collection}{\rm (p.\,\pageref{classKActionCollection})} manages everything for you.

Note: if you are using a \char`\"{}standard\char`\"{} action like \char`\"{}new\char`\"{}, \char`\"{}paste\char`\"{}, \char`\"{}quit\char`\"{}, or any other action described in the {\bf KDE} UI Standards, please use the methods in the {\bf KStd\-Action}{\rm (p.\,\pageref{namespaceKStdAction})} class rather than defining your own.

{\bf Usage Within the XML Framework:}\par


If you are using KAction within the context of the XML menu and toolbar building framework, then there are a few tiny changes. The first is that you must insert your new action into an action collection. The action collection (a {\bf KAction\-Collection}{\rm (p.\,\pageref{classKActionCollection})}) is, logically enough, a central collection of all of the actions defined in your application. The XML UI framework code in KXMLGUI classes needs access to this collection in order to build up the GUI (it's how the builder code knows which actions are valid and which aren't).

Also, if you use the XML builder framework, then you do not ever have to plug your actions into containers manually. The framework does that for you.

\begin{Desc}
\item[See also:]{\bf KStd\-Action}{\rm (p.\,\pageref{namespaceKStdAction})} \end{Desc}




Definition at line 202 of file kaction.h.

\subsection{Member Enumeration Documentation}
\index{KAction@{KAction}!ActivationReason@{ActivationReason}}
\index{ActivationReason@{ActivationReason}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf KAction::Activation\-Reason}}\label{classKAction_w5}


\begin{Desc}
\item[Since:]3.4 \end{Desc}




Definition at line 490 of file kaction.h.

\subsection{Constructor \& Destructor Documentation}
\index{KAction@{KAction}!KAction@{KAction}}
\index{KAction@{KAction}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAction::KAction (const {\bf QString} \& {\em text}, const {\bf KShortcut} \& {\em cut}, const {\bf QObject} $\ast$ {\em receiver}, const char $\ast$ {\em slot}, {\bf KAction\-Collection} $\ast$ {\em parent}, const char $\ast$ {\em name})}\label{classKAction_a0}


Constructs an action with text, potential keyboard shortcut, and a SLOT to call when this action is invoked by the user. 

If you do not want or have a keyboard shortcut, set the {\tt cut} param to 0.

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 \char`\"{}Edit Tool\-Bar\char`\"{} dialog, because an action needs an icon to be plugged in a toolbar...).

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]The text that will be displayed. \item[{\em cut}]The corresponding keyboard shortcut. \item[{\em receiver}]The SLOT's parent. \item[{\em slot}]The SLOT to invoke to execute this action. \item[{\em parent}]This action's parent. \item[{\em name}]An internal name for this action. \end{description}
\end{Desc}


Definition at line 113 of file kaction.cpp.\index{KAction@{KAction}!KAction@{KAction}}
\index{KAction@{KAction}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAction::KAction (const {\bf QString} \& {\em text}, const {\bf QIcon\-Set} \& {\em pix}, const {\bf KShortcut} \& {\em cut}, const {\bf QObject} $\ast$ {\em receiver}, const char $\ast$ {\em slot}, {\bf KAction\-Collection} $\ast$ {\em parent}, const char $\ast$ {\em name})}\label{classKAction_a1}


Constructs an action with text, icon, potential keyboard shortcut, and a SLOT to call when this action is invoked by the user. 

If you do not want or have a keyboard shortcut, set the {\tt cut} param to 0.

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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]The text that will be displayed. \item[{\em pix}]The icon to display. \item[{\em cut}]The corresponding keyboard shortcut. \item[{\em receiver}]The SLOT's parent. \item[{\em slot}]The SLOT to invoke to execute this action. \item[{\em parent}]This action's parent. \item[{\em name}]An internal name for this action. \end{description}
\end{Desc}


Definition at line 130 of file kaction.cpp.\index{KAction@{KAction}!KAction@{KAction}}
\index{KAction@{KAction}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAction::KAction (const {\bf QString} \& {\em text}, const {\bf QString} \& {\em pix}, const {\bf KShortcut} \& {\em cut}, const {\bf QObject} $\ast$ {\em receiver}, const char $\ast$ {\em slot}, {\bf KAction\-Collection} $\ast$ {\em parent}, const char $\ast$ {\em name})}\label{classKAction_a2}


Constructs an action with text, icon, potential keyboard shortcut, and a SLOT to call when this action is invoked by the user. 

The icon is loaded on demand later based on where it is plugged in.

If you do not want or have a keyboard shortcut, set the {\tt cut} param to 0.

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

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em text}]The text that will be displayed. \item[{\em pix}]The icon to display. \item[{\em cut}]The corresponding keyboard shortcut (shortcut). \item[{\em receiver}]The SLOT's parent. \item[{\em slot}]The SLOT to invoke to execute this action. \item[{\em parent}]This action's parent. \item[{\em name}]An internal name for this action. \end{description}
\end{Desc}


Definition at line 121 of file kaction.cpp.\index{KAction@{KAction}!KAction@{KAction}}
\index{KAction@{KAction}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAction::KAction (const {\bf KGui\-Item} \& {\em item}, const {\bf KShortcut} \& {\em cut}, const {\bf QObject} $\ast$ {\em receiver}, const char $\ast$ {\em slot}, {\bf KAction\-Collection} $\ast$ {\em parent}, const char $\ast$ {\em name})}\label{classKAction_a3}


The same as the above constructor, but with a {\bf KGui\-Item}{\rm (p.\,\pageref{classKGuiItem})} providing the text and icon. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em item}]The {\bf KGui\-Item}{\rm (p.\,\pageref{classKGuiItem})} with the label and (optional) icon. \item[{\em cut}]The corresponding keyboard shortcut (shortcut). \item[{\em receiver}]The SLOT's parent. \item[{\em slot}]The SLOT to invoke to execute this action. \item[{\em parent}]This action's parent. \item[{\em name}]An internal name for this action. \end{description}
\end{Desc}


Definition at line 139 of file kaction.cpp.

References set\-Tool\-Tip(), and set\-Whats\-This().\index{KAction@{KAction}!KAction@{KAction}}
\index{KAction@{KAction}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAction::KAction (const {\bf QString} \& {\em text}, const {\bf KShortcut} \& {\em cut} = {\tt {\bf KShortcut}()}, {\bf QObject} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})}\label{classKAction_a4}


\begin{Desc}
\item[{\bf Deprecated}]\end{Desc}


Definition at line 152 of file kaction.cpp.\index{KAction@{KAction}!KAction@{KAction}}
\index{KAction@{KAction}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAction::KAction (const {\bf QString} \& {\em text}, const {\bf KShortcut} \& {\em cut}, const {\bf QObject} $\ast$ {\em receiver}, const char $\ast$ {\em slot}, {\bf QObject} $\ast$ {\em parent}, const char $\ast$ {\em name} = {\tt 0})}\label{classKAction_a5}


\begin{Desc}
\item[{\bf Deprecated}]\end{Desc}


Definition at line 159 of file kaction.cpp.\index{KAction@{KAction}!KAction@{KAction}}
\index{KAction@{KAction}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAction::KAction (const {\bf QString} \& {\em text}, const {\bf QIcon\-Set} \& {\em pix}, const {\bf KShortcut} \& {\em cut} = {\tt {\bf KShortcut}()}, {\bf QObject} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})}\label{classKAction_a6}


\begin{Desc}
\item[{\bf Deprecated}]\end{Desc}


Definition at line 167 of file kaction.cpp.

References set\-Icon\-Set().\index{KAction@{KAction}!KAction@{KAction}}
\index{KAction@{KAction}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAction::KAction (const {\bf QString} \& {\em text}, const {\bf QString} \& {\em pix}, const {\bf KShortcut} \& {\em cut} = {\tt {\bf KShortcut}()}, {\bf QObject} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})}\label{classKAction_a7}


\begin{Desc}
\item[{\bf Deprecated}]\end{Desc}


Definition at line 176 of file kaction.cpp.\index{KAction@{KAction}!KAction@{KAction}}
\index{KAction@{KAction}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAction::KAction (const {\bf QString} \& {\em text}, const {\bf QIcon\-Set} \& {\em pix}, const {\bf KShortcut} \& {\em cut}, const {\bf QObject} $\ast$ {\em receiver}, const char $\ast$ {\em slot}, {\bf QObject} $\ast$ {\em parent}, const char $\ast$ {\em name} = {\tt 0})}\label{classKAction_a8}


\begin{Desc}
\item[{\bf Deprecated}]\end{Desc}


Definition at line 185 of file kaction.cpp.

References set\-Icon\-Set().\index{KAction@{KAction}!KAction@{KAction}}
\index{KAction@{KAction}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAction::KAction (const {\bf QString} \& {\em text}, const {\bf QString} \& {\em pix}, const {\bf KShortcut} \& {\em cut}, const {\bf QObject} $\ast$ {\em receiver}, const char $\ast$ {\em slot}, {\bf QObject} $\ast$ {\em parent}, const char $\ast$ {\em name} = {\tt 0})}\label{classKAction_a9}


\begin{Desc}
\item[{\bf Deprecated}]\end{Desc}


Definition at line 195 of file kaction.cpp.\index{KAction@{KAction}!KAction@{KAction}}
\index{KAction@{KAction}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAction::KAction ({\bf QObject} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})}\label{classKAction_a10}


\begin{Desc}
\item[{\bf Deprecated}]\end{Desc}


Definition at line 205 of file kaction.cpp.\index{KAction@{KAction}!~KAction@{$\sim$KAction}}
\index{~KAction@{$\sim$KAction}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAction::$\sim${\bf KAction} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKAction_a11}


Standard destructor. 



Definition at line 212 of file kaction.cpp.

References QValue\-List::const\-Begin(), QValue\-List::const\-End(), endl(), kd\-Debug(), QObject::name(), QValue\-List::remove(), KAction\-Collection::take(), and unplug\-Accel().

\subsection{Member Function Documentation}
\index{KAction@{KAction}!plug@{plug}}
\index{plug@{plug}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KAction::plug ({\bf QWidget} $\ast$ {\em widget}, int {\em index} = {\tt -1})\hspace{0.3cm}{\tt  [virtual]}}\label{classKAction_a12}


\char`\"{}Plug\char`\"{} or insert this action into a given widget. 

This will typically be a menu or a toolbar. From this point on, you will never need to directly manipulate the item in the menu or toolbar. You do all enabling/disabling/manipulation directly with your KAction object.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em widget}]The GUI element to display this action \item[{\em index}]The position into which the action is plugged. If this is negative, the action is inserted at the end. \end{description}
\end{Desc}


Reimplemented in {\bf KToggle\-Action} {\rm (p.\,\pageref{classKToggleAction_a8})}, {\bf KSelect\-Action} {\rm (p.\,\pageref{classKSelectAction_a8})}, {\bf KRecent\-Files\-Action} {\rm (p.\,\pageref{classKRecentFilesAction_a8})}, {\bf KAction\-Menu} {\rm (p.\,\pageref{classKActionMenu_a13})}, {\bf KTool\-Bar\-Popup\-Action} {\rm (p.\,\pageref{classKToolBarPopupAction_a4})}, {\bf KToggle\-Tool\-Bar\-Action} {\rm (p.\,\pageref{classKToggleToolBarAction_a3})}, {\bf KWidget\-Action} {\rm (p.\,\pageref{classKWidgetAction_a4})}, and {\bf KPaste\-Text\-Action} {\rm (p.\,\pageref{classKPasteTextAction_a3})}.

Definition at line 618 of file kaction.cpp.

References QTool\-Tip::add(), QWhats\-This::add(), QObject::connect(), KAction\-Collection::connect\-Highlight(), KAction\-Collection::count(), QObject::destroyed(), endl(), KTool\-Bar::get\-Button(), get\-Tool\-Button\-ID(), icon\-Set(), KTool\-Bar::insert\-Button(), QPopup\-Menu::insert\-Item(), KGlobal::instance(), KAction\-Collection::instance(), QString::is\-Empty(), kd\-Debug(), kd\-Warning(), QObject::name(), QPopup\-Menu::set\-Item\-Enabled(), QPopup\-Menu::set\-Whats\-This(), slot\-Button\-Clicked(), and slot\-Popup\-Activated().

Referenced by KPaste\-Text\-Action::plug(), KTool\-Bar\-Popup\-Action::plug(), and KToggle\-Action::plug().\index{KAction@{KAction}!plugAccel@{plugAccel}}
\index{plugAccel@{plugAccel}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAction::plug\-Accel ({\bf KAccel} $\ast$ {\em accel}, bool {\em configurable} = {\tt true})\hspace{0.3cm}{\tt  [virtual]}}\label{classKAction_a13}


\begin{Desc}
\item[{\bf Deprecated}]. Shouldn't be used. No substitute available. \end{Desc}
\char`\"{}Plug\char`\"{} or insert this action into a given {\bf KAccel}.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em accel}]The {\bf KAccel} collection which holds this accel \item[{\em configurable}]If the shortcut is configurable via the {\bf KAccel} configuration dialog (this is somehow deprecated since there is now a KAction key configuration dialog). \end{description}
\end{Desc}


Definition at line 763 of file kaction.cpp.

References QObject::connect(), QObject::destroyed(), endl(), is\-Enabled(), kd\-Backtrace(), kd\-Debug(), kd\-Warning(), QObject::name(), and unplug\-Accel().\index{KAction@{KAction}!unplug@{unplug}}
\index{unplug@{unplug}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAction::unplug ({\bf QWidget} $\ast$ {\em w})\hspace{0.3cm}{\tt  [virtual]}}\label{classKAction_a14}


\char`\"{}Unplug\char`\"{} or remove this action from a given widget. 

This will typically be a menu or a toolbar. This is rarely used in \char`\"{}normal\char`\"{} application. Typically, it would be used if your application has several views or modes, each with a completely different menu structure. If you simply want to disable an action for a given period, use {\bf set\-Enabled()}{\rm (p.\,\pageref{classKAction_i7})} instead.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em w}]Remove the action from this GUI element. \end{description}
\end{Desc}


Reimplemented in {\bf KWidget\-Action} {\rm (p.\,\pageref{classKWidgetAction_a5})}.

Definition at line 735 of file kaction.cpp.

References KAction\-Collection::disconnect\-Highlight(), QMenu\-Bar::remove\-Item(), QPopup\-Menu::remove\-Item(), and KTool\-Bar::remove\-Item\-Delayed().

Referenced by KWidget\-Action::unplug().\index{KAction@{KAction}!unplugAccel@{unplugAccel}}
\index{unplugAccel@{unplugAccel}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAction::unplug\-Accel ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKAction_a15}


\begin{Desc}
\item[{\bf Deprecated}]. Complement method to {\bf plug\-Accel()}{\rm (p.\,\pageref{classKAction_a13})}. Disconnect this action from the {\bf KAccel}. \end{Desc}


Definition at line 791 of file kaction.cpp.

References QObject::name().

Referenced by plug\-Accel(), and $\sim$KAction().\index{KAction@{KAction}!isPlugged@{isPlugged}}
\index{isPlugged@{isPlugged}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAction::is\-Plugged () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKAction_a16}


returns whether the action is plugged into any container widget or not. 

\begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 263 of file kaction.cpp.

Referenced by KDCOPAction\-Proxy::process\-Action(), and KWidget\-Action::unplug().\index{KAction@{KAction}!isPlugged@{isPlugged}}
\index{isPlugged@{isPlugged}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAction::is\-Plugged (const {\bf QWidget} $\ast$ {\em container}) const}\label{classKAction_a17}


returns whether the action is plugged into the given container 



Definition at line 268 of file kaction.cpp.\index{KAction@{KAction}!isPlugged@{isPlugged}}
\index{isPlugged@{isPlugged}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAction::is\-Plugged (const {\bf QWidget} $\ast$ {\em container}, int {\em id}) const\hspace{0.3cm}{\tt  [virtual]}}\label{classKAction_a18}


returns whether the action is plugged into the given container with the given, container specific, id (often menu or toolbar id ) . 



Definition at line 273 of file kaction.cpp.\index{KAction@{KAction}!isPlugged@{isPlugged}}
\index{isPlugged@{isPlugged}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAction::is\-Plugged (const {\bf QWidget} $\ast$ {\em container}, const {\bf QWidget} $\ast$ {\em \_\-representative}) const\hspace{0.3cm}{\tt  [virtual]}}\label{classKAction_a19}


returns whether the action is plugged into the given container with the given, container specific, representative container widget item. 



Definition at line 279 of file kaction.cpp.\index{KAction@{KAction}!kaccelCount@{kaccelCount}}
\index{kaccelCount@{kaccelCount}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}uint KAction::kaccel\-Count () const}\label{classKAction_a24}


\begin{Desc}
\item[Since:]3.1 \end{Desc}




Definition at line 1067 of file kaction.cpp.\index{KAction@{KAction}!text@{text}}
\index{text@{text}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QString} KAction::text () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKAction_a28}


Get the text associated with this action. 



Referenced by KAction\-Menu::plug(), and KSelect\-Action::plug().\index{KAction@{KAction}!shortcut@{shortcut}}
\index{shortcut@{shortcut}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual const {\bf KShortcut}\& KAction::shortcut () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKAction_a29}


Get the keyboard shortcut associated with this action. 

\index{KAction@{KAction}!shortcutDefault@{shortcutDefault}}
\index{shortcutDefault@{shortcutDefault}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf KShortcut} \& KAction::shortcut\-Default () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKAction_a30}


Get the default shortcut for this action. 



Definition at line 545 of file kaction.cpp.\index{KAction@{KAction}!isEnabled@{isEnabled}}
\index{isEnabled@{isEnabled}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAction::is\-Enabled () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKAction_a33}


Returns true if this action is enabled. 



Definition at line 586 of file kaction.cpp.

Referenced by KCommand\-History::add\-Command(), KPaste\-Text\-Action::plug(), KTool\-Bar\-Popup\-Action::plug(), KAction\-Menu::plug(), KRecent\-Files\-Action::plug(), KSelect\-Action::plug(), plug\-Accel(), and KCommand\-History::redo().\index{KAction@{KAction}!isShortcutConfigurable@{isShortcutConfigurable}}
\index{isShortcutConfigurable@{isShortcutConfigurable}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAction::is\-Shortcut\-Configurable () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKAction_a34}


Returns true if this action's shortcut is configurable. 



Definition at line 591 of file kaction.cpp.\index{KAction@{KAction}!whatsThis@{whatsThis}}
\index{whatsThis@{whatsThis}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QString} KAction::whats\-This () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKAction_a36}


Get the What's this text for the action. 



Referenced by KPaste\-Text\-Action::plug(), KWidget\-Action::plug(), KTool\-Bar\-Popup\-Action::plug(), KAction\-Menu::plug(), KRecent\-Files\-Action::plug(), and KSelect\-Action::plug().\index{KAction@{KAction}!toolTip@{toolTip}}
\index{toolTip@{toolTip}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf QString} KAction::tool\-Tip () const\hspace{0.3cm}{\tt  [virtual]}}\label{classKAction_a37}


Get the tooltip text for the action. 



Reimplemented in {\bf KToggle\-Action} {\rm (p.\,\pageref{classKToggleAction_a13})}.

Referenced by KSelect\-Action::plug(), and KToggle\-Action::tool\-Tip().\index{KAction@{KAction}!iconSet@{iconSet}}
\index{iconSet@{iconSet}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QIcon\-Set} KAction::icon\-Set ({\bf KIcon::Group} {\em group}, int {\em size} = {\tt 0}) const\hspace{0.3cm}{\tt  [virtual]}}\label{classKAction_a38}


Get the {\bf QIcon\-Set} from which the icons used to display this action will be chosen. 



Definition at line 985 of file kaction.cpp.

Referenced by KTool\-Bar\-Popup\-Action::plug(), KAction\-Menu::plug(), KSelect\-Action::plug(), and plug().\index{KAction@{KAction}!getToolButtonID@{getToolButtonID}}
\index{getToolButtonID@{getToolButtonID}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KAction::get\-Tool\-Button\-ID ()\hspace{0.3cm}{\tt  [static]}}\label{classKAction_e0}


How it works. 

{\bf KAction\-Collection}{\rm (p.\,\pageref{classKActionCollection})} is an organizing container for KActions. {\bf KAction\-Collection}{\rm (p.\,\pageref{classKActionCollection})} keeps track of the information necessary to handle configuration and shortcuts.

Focus Widget pointer: This is the widget which is the focus for action shortcuts. It is set either by passing a QWidget$\ast$ to the {\bf KAction\-Collection}{\rm (p.\,\pageref{classKActionCollection})} constructor or by calling set\-Widget() if the widget wasn't known when the object was initially constructed (as in {\bf KXMLGUIClient}{\rm (p.\,\pageref{classKXMLGUIClient})} and KParts::Part\-Base)

Shortcuts: An action's shortcut will not not be connected unless a focus widget has been specified in {\bf KAction\-Collection}{\rm (p.\,\pageref{classKActionCollection})}.

XML Filename: This is used to save user-modified settings back to the $\ast$ui.rc file. It is set by {\bf KXMLGUIFactory}{\rm (p.\,\pageref{classKXMLGUIFactory})}. 

Definition at line 66 of file kaction.cpp.

Referenced by KPaste\-Text\-Action::plug(), KWidget\-Action::plug(), KTool\-Bar\-Popup\-Action::plug(), KAction\-Menu::plug(), KRecent\-Files\-Action::plug(), KSelect\-Action::plug(), and plug().\index{KAction@{KAction}!setText@{setText}}
\index{setText@{setText}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAction::set\-Text (const {\bf QString} \& {\em text})\hspace{0.3cm}{\tt  [virtual, slot]}}\label{classKAction_i0}


Sets the text associated with this action. 

The text is used for menu and toolbar labels etc. 

Reimplemented in {\bf KTool\-Bar\-Label\-Action} {\rm (p.\,\pageref{classKToolBarLabelAction_a4})}.

Definition at line 863 of file kaction.cpp.

References QValue\-List::const\-Begin(), QValue\-List::const\-End(), and QObject::name().

Referenced by KCommand\-History::add\-Command(), KCommand\-History::clear(), KCommand\-History::redo(), KToggle\-Full\-Screen\-Action::set\-Checked(), KTool\-Bar\-Label\-Action::set\-Text(), and KCommand\-History::undo().\index{KAction@{KAction}!setShortcut@{setShortcut}}
\index{setShortcut@{setShortcut}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAction::set\-Shortcut (const {\bf KShortcut} \&)\hspace{0.3cm}{\tt  [virtual, slot]}}\label{classKAction_i1}


Sets the keyboard shortcut associated with this action. 



Definition at line 404 of file kaction.cpp.

References QValue\-List::const\-Begin(), QValue\-List::const\-End(), and QObject::name().

Referenced by set\-Accel().\index{KAction@{KAction}!setWhatsThis@{setWhatsThis}}
\index{setWhatsThis@{setWhatsThis}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAction::set\-Whats\-This (const {\bf QString} \& {\em text})\hspace{0.3cm}{\tt  [virtual, slot]}}\label{classKAction_i3}


Sets the What's this text for the action. 

This text will be displayed when a widget that has been created by plugging this action into a container is clicked on in What's this mode.

The What's this text can include QML markup as well as raw text. 

Definition at line 995 of file kaction.cpp.

Referenced by KAction(), KStd\-Action::show\-Menubar(), and KStd\-Action::show\-Statusbar().\index{KAction@{KAction}!setToolTip@{setToolTip}}
\index{setToolTip@{setToolTip}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAction::set\-Tool\-Tip (const {\bf QString} \&)\hspace{0.3cm}{\tt  [virtual, slot]}}\label{classKAction_i4}


Sets the tooltip text for the action. 

This will be used as a tooltip for a toolbar button, as a statusbar help-text for a menu item, and it also appears in the toolbar editor, to describe the action.

For the tooltip to show up on the statusbar you will need to connect a couple of the actionclass signals to the toolbar. The easiest way of doing this is in your main window class, when you create a statusbar. See the {\bf KAction\-Collection}{\rm (p.\,\pageref{classKActionCollection})} class for more details.

\begin{Desc}
\item[See also:]{\bf KAction\-Collection}{\rm (p.\,\pageref{classKActionCollection})} \end{Desc}


Definition at line 596 of file kaction.cpp.

Referenced by KAction().\index{KAction@{KAction}!setIconSet@{setIconSet}}
\index{setIconSet@{setIconSet}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAction::set\-Icon\-Set (const {\bf QIcon\-Set} \& {\em icon\-Set})\hspace{0.3cm}{\tt  [virtual, slot]}}\label{classKAction_i5}


Sets the {\bf QIcon\-Set} from which the icons used to display this action will be chosen. 



Definition at line 953 of file kaction.cpp.

Referenced by KAction().\index{KAction@{KAction}!setEnabled@{setEnabled}}
\index{setEnabled@{setEnabled}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAction::set\-Enabled (bool {\em enable})\hspace{0.3cm}{\tt  [virtual, slot]}}\label{classKAction_i7}


Enables or disables this action. 

All uses of this action (eg. in menus or toolbars) will be updated to reflect the state of the action. 

Definition at line 816 of file kaction.cpp.

References QValue\-List::const\-Begin(), QValue\-List::const\-End(), QObject::name(), and QWidget::set\-Enabled().

Referenced by KCommand\-History::add\-Command(), KCommand\-History::clear(), KWidget\-Action::KWidget\-Action(), KToggle\-Tool\-Bar\-Action::plug(), KCommand\-History::redo(), KSelect\-Action::set\-Items(), KCommand\-History::undo(), and KCommand\-History::update\-Actions().\index{KAction@{KAction}!setShortcutConfigurable@{setShortcutConfigurable}}
\index{setShortcutConfigurable@{setShortcutConfigurable}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAction::set\-Shortcut\-Configurable (bool)\hspace{0.3cm}{\tt  [virtual, slot]}}\label{classKAction_i8}


Indicate whether the user may configure the action's shortcut. 



Definition at line 858 of file kaction.cpp.\index{KAction@{KAction}!activate@{activate}}
\index{activate@{activate}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAction::activate ()\hspace{0.3cm}{\tt  [virtual, slot]}}\label{classKAction_i9}


Emulate user's interaction programmatically, by activating the action. 

The implementation simply emits {\bf activated()}{\rm (p.\,\pageref{classKAction_l0})}. 

Definition at line 1088 of file kaction.cpp.

References activated().

Referenced by KDCOPAction\-Proxy::process\-Action().\index{KAction@{KAction}!slotPopupActivated@{slotPopupActivated}}
\index{slotPopupActivated@{slotPopupActivated}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAction::slot\-Popup\-Activated ()\hspace{0.3cm}{\tt  [protected, slot]}}\label{classKAction_j3}


\begin{Desc}
\item[Since:]3.4 \end{Desc}




Definition at line 1109 of file kaction.cpp.

References activated(), endl(), kd\-Debug(), kd\-Warning(), KApplication::keyboard\-Mouse\-State(), QObject::sender(), and KPopup\-Menu::state().

Referenced by plug().\index{KAction@{KAction}!slotButtonClicked@{slotButtonClicked}}
\index{slotButtonClicked@{slotButtonClicked}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAction::slot\-Button\-Clicked (int, Qt::Button\-State {\em state})\hspace{0.3cm}{\tt  [protected, slot]}}\label{classKAction_j4}


\begin{Desc}
\item[Since:]3.4 \end{Desc}




Definition at line 1140 of file kaction.cpp.

References activated(), endl(), and kd\-Debug().

Referenced by KTool\-Bar\-Popup\-Action::plug(), and plug().\index{KAction@{KAction}!guiItem@{guiItem}}
\index{guiItem@{guiItem}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf KGui\-Item} \& KAction::gui\-Item () const\hspace{0.3cm}{\tt  [protected]}}\label{classKAction_b18}


Return the underlying {\bf KGui\-Item}{\rm (p.\,\pageref{classKGuiItem})} \begin{Desc}
\item[Since:]3.3. \end{Desc}




Definition at line 1267 of file kaction.cpp.\index{KAction@{KAction}!activated@{activated}}
\index{activated@{activated}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAction::activated ()\hspace{0.3cm}{\tt  [signal]}}\label{classKAction_l0}


Emitted when this action is activated. 



Referenced by activate(), KList\-Action::KList\-Action(), KPaste\-Text\-Action::KPaste\-Text\-Action(), KSelect\-Action::plug(), slot\-Button\-Clicked(), and slot\-Popup\-Activated().\index{KAction@{KAction}!activated@{activated}}
\index{activated@{activated}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAction::activated ({\bf KAction::Activation\-Reason} {\em reason}, Qt::Button\-State {\em state})\hspace{0.3cm}{\tt  [signal]}}\label{classKAction_l1}


This signal allows to know the reason why an action was activated: whether it was due to a toolbar button, popupmenu, keyboard accel, or programmatically. 

In the first two cases, it also allows to know which mouse button was used (Left or Middle), and whether keyboard modifiers were pressed (e.g. CTRL).

Note that this signal is emitted before the normal {\bf activated()}{\rm (p.\,\pageref{classKAction_l0})} signal. Yes, BOTH signals are always emitted, so that connecting to {\bf activated()}{\rm (p.\,\pageref{classKAction_l0})} still works. Applications which care about reason and state can either ignore the {\bf activated()}{\rm (p.\,\pageref{classKAction_l0})} signal for a given action and react to this one instead, or store the reason and state until the {\bf activated()}{\rm (p.\,\pageref{classKAction_l0})} signal is emitted.

\begin{Desc}
\item[Since:]3.4 \end{Desc}
\index{KAction@{KAction}!accel@{accel}}
\index{accel@{accel}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KAction::accel () const}\label{classKAction_a43}


\begin{Desc}
\item[{\bf Deprecated}]. Use {\bf shortcut()}{\rm (p.\,\pageref{classKAction_a29})}. Get the keyboard accelerator associated with this action. \end{Desc}


Definition at line 561 of file kaction.cpp.\index{KAction@{KAction}!setAccel@{setAccel}}
\index{setAccel@{setAccel}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAction::set\-Accel (int {\em key})}\label{classKAction_a45}


\begin{Desc}
\item[{\bf Deprecated}]. Use {\bf set\-Shortcut()}{\rm (p.\,\pageref{classKAction_i1})}. Sets the keyboard accelerator associated with this action. \end{Desc}


Definition at line 497 of file kaction.cpp.

References set\-Shortcut().\index{KAction@{KAction}!setStatusText@{setStatusText}}
\index{setStatusText@{setStatusText}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAction::set\-Status\-Text (const {\bf QString} \& {\em text})\hspace{0.3cm}{\tt  [inline]}}\label{classKAction_a46}


\begin{Desc}
\item[{\bf Deprecated}]. Use set\-Tool\-Tip instead (they do the same thing now). \end{Desc}


Definition at line 647 of file kaction.h.\index{KAction@{KAction}!menuId@{menuId}}
\index{menuId@{menuId}!KAction@{KAction}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KAction::menu\-Id (int {\em i})\hspace{0.3cm}{\tt  [inline]}}\label{classKAction_a47}


\begin{Desc}
\item[{\bf Deprecated}]. for backwards compatibility. Use item\-Id() \end{Desc}


Definition at line 653 of file kaction.h.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kaction.h\item 
kaction.cpp\end{CompactItemize}
