\section{KAccel Class Reference}
\label{classKAccel}\index{KAccel@{KAccel}}
Handle shortcuts. Configurable shortcut support for widgets.  


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

Inheritance diagram for KAccel:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=41pt]{classKAccel__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KAccel:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=41pt]{classKAccel__coll__graph}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf keycode\-Changed} ()
\begin{CompactList}\small\item\em Emitted when one of the key codes has changed. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KAccel} ({\bf QWidget} $\ast$p\-Parent, const  char $\ast$ps\-Name=0)
\begin{CompactList}\small\item\em Creates a new KAccel that watches {\tt p\-Parent}, which is also the QObject's parent. \item\end{CompactList}\item 
{\bf KAccel} ({\bf QWidget} $\ast$watch, {\bf QObject} $\ast$parent, const  char $\ast$ps\-Name=0)
\begin{CompactList}\small\item\em Creates a new KAccel that watches {\tt watch}. \item\end{CompactList}\item 
KAccel\-Actions \& {\bf actions} ()\label{classKAccel_a3}

\item 
const  KAccel\-Actions \& {\bf actions} () const \label{classKAccel_a4}

\item 
bool {\bf is\-Enabled} ()
\begin{CompactList}\small\item\em Checks whether the KAccel is active. \item\end{CompactList}\item 
void {\bf set\-Enabled} (bool b\-Enabled)
\begin{CompactList}\small\item\em Enables or disables the KAccel. \item\end{CompactList}\item 
bool {\bf get\-Auto\-Update} ()
\begin{CompactList}\small\item\em Checks whether auto-update of connections is enabled. \item\end{CompactList}\item 
bool {\bf set\-Auto\-Update} (bool b\-Auto)
\begin{CompactList}\small\item\em Enable auto-update of connections. \item\end{CompactList}\item 
KAccel\-Action $\ast$ {\bf insert} (const  {\bf QString} \&s\-Action, const  {\bf QString} \&s\-Label, const  {\bf QString} \&s\-Whats\-This, const  KShortcut \&cut\-Def, const  {\bf QObject} $\ast$p\-Obj\-Slot, const  char $\ast$ps\-Method\-Slot, bool b\-Configurable=true, bool b\-Enabled=true)
\begin{CompactList}\small\item\em Create an accelerator action. \item\end{CompactList}\item 
KAccel\-Action $\ast$ {\bf insert} (const  {\bf QString} \&s\-Action, const  {\bf QString} \&s\-Label, const  {\bf QString} \&s\-Whats\-This, const  KShortcut \&cut\-Def3, const  KShortcut \&cut\-Def4, const  {\bf QObject} $\ast$p\-Obj\-Slot, const  char $\ast$ps\-Method\-Slot, bool b\-Configurable=true, bool b\-Enabled=true)
\begin{CompactList}\small\item\em Same as first {\bf insert}{\rm (p.\,\pageref{classKAccel_a9})}(), but with separate shortcuts defined for 3- and 4- modifier defaults. \item\end{CompactList}\item 
KAccel\-Action $\ast$ {\bf insert} (const  char $\ast$ps\-Action, const  KShortcut \&cut\-Def, const  {\bf QObject} $\ast$p\-Obj\-Slot, const  char $\ast$ps\-Method\-Slot, bool b\-Configurable=true, bool b\-Enabled=true)
\begin{CompactList}\small\item\em This is an overloaded function provided for convenience. \item\end{CompactList}\item 
KAccel\-Action $\ast$ {\bf insert} ({\bf KStd\-Accel::Std\-Accel} id, const  {\bf QObject} $\ast$p\-Obj\-Slot, const  char $\ast$ps\-Method\-Slot, bool b\-Configurable=true, bool b\-Enabled=true)
\begin{CompactList}\small\item\em Similar to the first {\bf insert}{\rm (p.\,\pageref{classKAccel_a9})}() method, but with the action name, short description, help text, and default shortcuts all set according to one of the standard accelerators. \item\end{CompactList}\item 
KAccel\-Action $\ast$ {\bf insert} (const  {\bf QString} \&s\-Name, const  {\bf QString} \&s\-Label)
\begin{CompactList}\small\item\em Use this to insert a label into the action list. \item\end{CompactList}\item 
bool {\bf remove} (const  {\bf QString} \&s\-Action)
\begin{CompactList}\small\item\em Removes the accelerator action identified by the name. \item\end{CompactList}\item 
bool {\bf update\-Connections} ()
\begin{CompactList}\small\item\em Updates the connections of the accelerations after changing them. \item\end{CompactList}\item 
const  KShortcut \& {\bf shortcut} (const  {\bf QString} \&s\-Action) const 
\begin{CompactList}\small\item\em Return the shortcut associated with the action named by {\tt s\-Action}. \item\end{CompactList}\item 
bool {\bf set\-Shortcut} (const  {\bf QString} \&s\-Action, const  KShortcut \&shortcut)
\begin{CompactList}\small\item\em Set the shortcut to be associated with the action named by {\tt s\-Action}. \item\end{CompactList}\item 
bool {\bf set\-Slot} (const  {\bf QString} \&s\-Action, const  {\bf QObject} $\ast$p\-Obj\-Slot, const  char $\ast$ps\-Method\-Slot)
\begin{CompactList}\small\item\em Set the slot to be called when the shortcut of the action named by {\tt s\-Action} is pressed. \item\end{CompactList}\item 
bool {\bf set\-Enabled} (const  {\bf QString} \&s\-Action, bool b\-Enabled)
\begin{CompactList}\small\item\em Enable or disable the action named by {\tt s\-Action}. \item\end{CompactList}\item 
const  {\bf QString} \& {\bf config\-Group} () const 
\begin{CompactList}\small\item\em Returns the configuration group of the settings. \item\end{CompactList}\item 
void {\bf set\-Config\-Group} (const  {\bf QString} \&name)
\begin{CompactList}\small\item\em Returns the configuration group of the settings. \item\end{CompactList}\item 
bool {\bf read\-Settings} ({\bf KConfig\-Base} $\ast$p\-Config=0)
\begin{CompactList}\small\item\em Read all shortcuts from {\tt p\-Config}, or (if {\tt p\-Config} is zero) from the application's configuration file {\bf KGlobal::config}{\rm (p.\,\pageref{classKGlobal_e2})}(). \item\end{CompactList}\item 
bool {\bf write\-Settings} ({\bf KConfig\-Base} $\ast$p\-Config=0) const 
\begin{CompactList}\small\item\em Write the current shortcuts to {\tt p\-Config}, or (if {\tt p\-Config} is zero) to the application's configuration file. \item\end{CompactList}\item 
void {\bf emit\-Keycode\-Changed} ()
\begin{CompactList}\small\item\em Emits the {\bf keycode\-Changed}{\rm (p.\,\pageref{classKAccel_l0})}() signal. \item\end{CompactList}\item 
bool {\bf insert\-Item} (const  {\bf QString} \&s\-Label, const  {\bf QString} \&s\-Action, const  char $\ast$ps\-Key, int n\-IDMenu=0, {\bf QPopup\-Menu} $\ast$p\-Menu=0, bool b\-Configurable=true)
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.} \item\end{CompactList}\item 
bool {\bf insert\-Item} (const  {\bf QString} \&s\-Label, const  {\bf QString} \&s\-Action, int {\bf key}, int n\-IDMenu=0, {\bf QPopup\-Menu} $\ast$p\-Menu=0, bool b\-Configurable=true)
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.} \item\end{CompactList}\item 
bool {\bf insert\-Std\-Item} ({\bf KStd\-Accel::Std\-Accel} id, const  {\bf QString} \&descr=QString::null)
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.} \item\end{CompactList}\item 
bool {\bf connect\-Item} (const  {\bf QString} \&s\-Action, const  {\bf QObject} $\ast$p\-Obj\-Slot, const  char $\ast$ps\-Method\-Slot, bool b\-Activate=true)
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.} \item\end{CompactList}\item 
bool {\bf connect\-Item} ({\bf KStd\-Accel::Std\-Accel} accel, const  {\bf QObject} $\ast$p\-Obj\-Slot, const  char $\ast$ps\-Method\-Slot)
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.} \item\end{CompactList}\item 
bool {\bf remove\-Item} (const  {\bf QString} \&s\-Action)
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.} \item\end{CompactList}\item 
bool {\bf set\-Item\-Enabled} (const  {\bf QString} \&s\-Action, bool b\-Enable)
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.} \item\end{CompactList}\item 
void {\bf change\-Menu\-Accel} ({\bf QPopup\-Menu} $\ast$menu, int id, const  {\bf QString} \&action)
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.} \item\end{CompactList}\item 
void {\bf change\-Menu\-Accel} ({\bf QPopup\-Menu} $\ast$menu, int id, {\bf KStd\-Accel::Std\-Accel} accel)
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.} \item\end{CompactList}\item 
int {\bf current\-Key} (const  {\bf QString} \&action) const 
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.}. \item\end{CompactList}\item 
{\bf QString} {\bf find\-Key} (int {\bf key}) const 
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
int {\bf string\-To\-Key} (const  {\bf QString} \&)
\begin{CompactList}\small\item\em {\bf This class or method is obsolete, it is provided for compatibility only.} \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKAccel_b0}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf KAccel\-Private}\label{classKAccel_n0}

\end{CompactItemize}


\subsection{Detailed Description}
Handle shortcuts. Configurable shortcut support for widgets. 

Allow a user to configure shortcuts through application configuration files or through the {\bf KKey\-Chooser} GUI.

A KAccel contains a list of accelerator actions.

For example, CTRL+Key\_\-P could be a shortcut for printing a document. The key codes are listed in qnamespace.h. \char`\"{}Print\char`\"{} could be the action name for printing. The action name identifies the shortcut in configuration files and the {\bf KKey\-Chooser} GUI.

A KAccel object handles key events sent to its parent widget and to all children of this parent widget. The most recently created KAccel object has precedence over any KAccel objects created before it. When a shortcut pressed, KAccel calls the slot to which it has been connected. If you want to set global accelerators, independent of the window which has the focus, use {\bf KGlobal\-Accel}{\rm (p.\,\pageref{classKGlobalAccel})}.

Reconfiguration of a given shortcut can be prevented by specifying that an accelerator item is not configurable when it is inserted. A special group of non-configurable key bindings are known as the standard accelerators.

The standard accelerators appear repeatedly in applications for standard document actions such as printing and saving. A convenience method is available to insert and connect these accelerators which are configurable on a desktop-wide basis.

It is possible for a user to choose to have no key associated with an action.

The translated first argument for {\bf insert\-Item}{\rm (p.\,\pageref{classKAccel_a25})}() is used only in the configuration dialog. \small\begin{alltt}
 KAccel* pAccel = new KAccel( this );\end{alltt}\normalsize 


\small\begin{alltt} // Insert an action "Scroll Up" which is associated with the "Up" key:
 pAccel-$>$insert( "Scroll Up", i18n("Scroll up"),
                       i18n("Scroll up the current document by one line."),
                       Qt::Key\_Up, this, SLOT(slotScrollUp()) );
 // Insert an standard acclerator action.
 pAccel-$>$insert( KStdAccel::Print, this, SLOT(slotPrint()) );\end{alltt}\normalsize 


\small\begin{alltt} // Update the shortcuts by read any user-defined settings from the
 //  application's config file.
 pAccel-$>${\bf readSettings()}{\rm (p.\,\pageref{classKAccel_a22})};
 *\end{alltt}\normalsize 


\begin{Desc}
\item[See also:]{\bf KGlobal\-Accel}{\rm (p.\,\pageref{classKGlobalAccel})} 

{\bf KAccel\-Shortcut\-List}{\rm (p.\,\pageref{classKAccelShortcutList})} 

{\bf KKey\-Chooser} 

{\bf KKey\-Dialog} \end{Desc}
\begin{Desc}
\item[Version:]\begin{Desc}
\item[Id]{\bf kaccel.h}{\rm (p.\,\pageref{kaccel_8h})},v 1.90 2002/10/02 22:17:35 tjansen Exp \end{Desc}
\end{Desc}




Definition at line 93 of file kaccel.h.

\subsection{Constructor \& Destructor Documentation}
\index{KAccel@{KAccel}!KAccel@{KAccel}}
\index{KAccel@{KAccel}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAccel::KAccel ({\bf QWidget} $\ast$ {\em p\-Parent}, const char $\ast$ {\em ps\-Name} = 0)}\label{classKAccel_a0}


Creates a new KAccel that watches {\tt p\-Parent}, which is also the QObject's parent. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em p\-Parent}]the parent and widget to watch for key strokes \item[{\em ps\-Name}]the name of the {\bf QObject}\end{description}
\end{Desc}


Definition at line 336 of file kaccel.cpp.\index{KAccel@{KAccel}!KAccel@{KAccel}}
\index{KAccel@{KAccel}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAccel::KAccel ({\bf QWidget} $\ast$ {\em watch}, {\bf QObject} $\ast$ {\em parent}, const char $\ast$ {\em ps\-Name} = 0)}\label{classKAccel_a1}


Creates a new KAccel that watches {\tt watch}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em watch}]the widget to watch for key strokes \item[{\em parent}]the parent of the {\bf QObject} \item[{\em ps\-Name}]the name of the {\bf QObject}\end{description}
\end{Desc}


Definition at line 343 of file kaccel.cpp.

\subsection{Member Function Documentation}
\index{KAccel@{KAccel}!isEnabled@{isEnabled}}
\index{isEnabled@{isEnabled}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAccel::is\-Enabled ()}\label{classKAccel_a5}


Checks whether the KAccel is active. 

\begin{Desc}
\item[Returns:]true if the {\bf QAccel} enabled\end{Desc}


Definition at line 360 of file kaccel.cpp.\index{KAccel@{KAccel}!setEnabled@{setEnabled}}
\index{setEnabled@{setEnabled}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAccel::set\-Enabled (bool {\em b\-Enabled})}\label{classKAccel_a6}


Enables or disables the KAccel. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em b\-Enabled}]true to enable, false to disable\end{description}
\end{Desc}


Reimplemented from {\bf QAccel}.

Definition at line 361 of file kaccel.cpp.

Referenced by set\-Item\-Enabled().\index{KAccel@{KAccel}!getAutoUpdate@{getAutoUpdate}}
\index{getAutoUpdate@{getAutoUpdate}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAccel::get\-Auto\-Update ()}\label{classKAccel_a7}


Checks whether auto-update of connections is enabled. 

\begin{Desc}
\item[Returns:]true if auto-update is enabled (the default) \end{Desc}
\begin{Desc}
\item[See also:]{\bf set\-Auto\-Update()}{\rm (p.\,\pageref{classKAccel_a8})}\end{Desc}
\index{KAccel@{KAccel}!setAutoUpdate@{setAutoUpdate}}
\index{setAutoUpdate@{setAutoUpdate}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAccel::set\-Auto\-Update (bool {\em b\-Auto})}\label{classKAccel_a8}


Enable auto-update of connections. 

This means that the signals are automatically disconnected when you disable an action, and re-enabled when you enable it. By default auto update is turned on. If you disable auto-update, you need to call {\bf update\-Connections}{\rm (p.\,\pageref{classKAccel_a15})}() after changing actions.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em b\-Auto}]true to enable, false to disable \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the value of the flag before this call\end{Desc}


Definition at line 362 of file kaccel.cpp.\index{KAccel@{KAccel}!insert@{insert}}
\index{insert@{insert}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAccel\-Action $\ast$ KAccel::insert (const {\bf QString} \& {\em s\-Action}, const {\bf QString} \& {\em s\-Label}, const {\bf QString} \& {\em s\-Whats\-This}, const KShortcut \& {\em cut\-Def}, const {\bf QObject} $\ast$ {\em p\-Obj\-Slot}, const char $\ast$ {\em ps\-Method\-Slot}, bool {\em b\-Configurable} = true, bool {\em b\-Enabled} = true)}\label{classKAccel_a9}


Create an accelerator action. 

Usage: \small\begin{alltt}
 insert( "Do Something", i18n("Do Something"),
   i18n("This action allows you to do something really great with this program to "
        "the currently open document."),
   ALT+Key\_D, this, SLOT(slotDoSomething()) );
	 *\end{alltt}\normalsize 


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s\-Action}]The internal name of the action. \item[{\em s\-Label}]An i18n'ized short description of the action displayed when using {\bf KKey\-Chooser} to reconfigure the shortcuts. \item[{\em s\-Whats\-This}]An extended description of the action. \item[{\em cut\-Def}]The default shortcut. \item[{\em p\-Obj\-Slot}]Pointer to the slot object. \item[{\em ps\-Method\-Slot}]Pointer to the slot method. \item[{\em b\-Configurable}]Allow the user to change this shortcut if set to 'true'. \item[{\em b\-Enabled}]The action will be activated by the shortcut if set to 'true'.\end{description}
\end{Desc}


Definition at line 364 of file kaccel.cpp.

Referenced by connect\-Item().\index{KAccel@{KAccel}!insert@{insert}}
\index{insert@{insert}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAccel\-Action $\ast$ KAccel::insert (const {\bf QString} \& {\em s\-Action}, const {\bf QString} \& {\em s\-Label}, const {\bf QString} \& {\em s\-Whats\-This}, const KShortcut \& {\em cut\-Def3}, const KShortcut \& {\em cut\-Def4}, const {\bf QObject} $\ast$ {\em p\-Obj\-Slot}, const char $\ast$ {\em ps\-Method\-Slot}, bool {\em b\-Configurable} = true, bool {\em b\-Enabled} = true)}\label{classKAccel_a10}


Same as first {\bf insert}{\rm (p.\,\pageref{classKAccel_a9})}(), but with separate shortcuts defined for 3- and 4- modifier defaults. 



Definition at line 375 of file kaccel.cpp.\index{KAccel@{KAccel}!insert@{insert}}
\index{insert@{insert}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAccel\-Action $\ast$ KAccel::insert (const char $\ast$ {\em ps\-Action}, const KShortcut \& {\em cut\-Def}, const {\bf QObject} $\ast$ {\em p\-Obj\-Slot}, const char $\ast$ {\em ps\-Method\-Slot}, bool {\em b\-Configurable} = true, bool {\em b\-Enabled} = true)}\label{classKAccel_a11}


This is an overloaded function provided for convenience. 

The advantage of this is when you want to use the same text for the name of the action as for the user-visible label.

Usage: \small\begin{alltt}
 insert( I18N\_NOOP("Do Something"), ALT+Key\_D, this, SLOT(slotDoSomething()) );
 \end{alltt}\normalsize 


\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em ps\-Action}]The name AND label of the action. \item[{\em cut\-Def}]The default shortcut for this action.\end{description}
\end{Desc}


Definition at line 386 of file kaccel.cpp.\index{KAccel@{KAccel}!insert@{insert}}
\index{insert@{insert}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAccel\-Action $\ast$ KAccel::insert ({\bf KStd\-Accel::Std\-Accel} {\em id}, const {\bf QObject} $\ast$ {\em p\-Obj\-Slot}, const char $\ast$ {\em ps\-Method\-Slot}, bool {\em b\-Configurable} = true, bool {\em b\-Enabled} = true)}\label{classKAccel_a12}


Similar to the first {\bf insert}{\rm (p.\,\pageref{classKAccel_a9})}() method, but with the action name, short description, help text, and default shortcuts all set according to one of the standard accelerators. 

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


Definition at line 396 of file kaccel.cpp.

References KStd\-Accel::action(), and QString::is\-Empty().\index{KAccel@{KAccel}!insert@{insert}}
\index{insert@{insert}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KAccel\-Action$\ast$ KAccel::insert (const {\bf QString} \& {\em s\-Name}, const {\bf QString} \& {\em s\-Label})}\label{classKAccel_a13}


Use this to insert a label into the action list. 

This will be displayed when the user configures shortcuts. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s\-Name}]the name of the action \item[{\em s\-Label}]the label of the action \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the created KAccel\-Action\end{Desc}
\index{KAccel@{KAccel}!remove@{remove}}
\index{remove@{remove}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAccel::remove (const {\bf QString} \& {\em s\-Action})}\label{classKAccel_a14}


Removes the accelerator action identified by the name. 

Remember to also call {\bf update\-Connections()}{\rm (p.\,\pageref{classKAccel_a15})}. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s\-Action}]the name of the action to remove \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise \end{Desc}


Definition at line 414 of file kaccel.cpp.\index{KAccel@{KAccel}!updateConnections@{updateConnections}}
\index{updateConnections@{updateConnections}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAccel::update\-Connections ()}\label{classKAccel_a15}


Updates the connections of the accelerations after changing them. 

This is only neccessary if you have disabled auto updates which are on by default. \begin{Desc}
\item[Returns:]true if successful, false otherwise \end{Desc}
\begin{Desc}
\item[See also:]{\bf set\-Auto\-Update()}{\rm (p.\,\pageref{classKAccel_a8})} 

{\bf get\-Auto\-Update()}{\rm (p.\,\pageref{classKAccel_a7})}\end{Desc}


Definition at line 416 of file kaccel.cpp.\index{KAccel@{KAccel}!shortcut@{shortcut}}
\index{shortcut@{shortcut}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const  KShortcut \& KAccel::shortcut (const {\bf QString} \& {\em s\-Action}) const}\label{classKAccel_a16}


Return the shortcut associated with the action named by {\tt s\-Action}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s\-Action}]the name of the action \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the action's shortcut, or a null shortcut if not found\end{Desc}


Definition at line 419 of file kaccel.cpp.\index{KAccel@{KAccel}!setShortcut@{setShortcut}}
\index{setShortcut@{setShortcut}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAccel::set\-Shortcut (const {\bf QString} \& {\em s\-Action}, const KShortcut \& {\em shortcut})}\label{classKAccel_a17}


Set the shortcut to be associated with the action named by {\tt s\-Action}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s\-Action}]the name of the action \item[{\em shortcut}]the shortcut to set \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}


Definition at line 431 of file kaccel.cpp.

References KStd\-Action::cut().\index{KAccel@{KAccel}!setSlot@{setSlot}}
\index{setSlot@{setSlot}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAccel::set\-Slot (const {\bf QString} \& {\em s\-Action}, const {\bf QObject} $\ast$ {\em p\-Obj\-Slot}, const char $\ast$ {\em ps\-Method\-Slot})}\label{classKAccel_a18}


Set the slot to be called when the shortcut of the action named by {\tt s\-Action} is pressed. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s\-Action}]the name of the action \item[{\em p\-Obj\-Slot}]the owner of the slot \item[{\em ps\-Method\-Slot}]the name of the slot \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}


Definition at line 425 of file kaccel.cpp.

Referenced by connect\-Item().\index{KAccel@{KAccel}!setEnabled@{setEnabled}}
\index{setEnabled@{setEnabled}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAccel::set\-Enabled (const {\bf QString} \& {\em s\-Action}, bool {\em b\-Enabled})}\label{classKAccel_a19}


Enable or disable the action named by {\tt s\-Action}. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em s\-Action}]the action to en-/disable \item[{\em b\-Enabled}]true to enable, false to disable \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}


Definition at line 428 of file kaccel.cpp.\index{KAccel@{KAccel}!configGroup@{configGroup}}
\index{configGroup@{configGroup}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const  {\bf QString} \& KAccel::config\-Group () const}\label{classKAccel_a20}


Returns the configuration group of the settings. 

\begin{Desc}
\item[Returns:]the configuration group \end{Desc}
\begin{Desc}
\item[See also:]{\bf KConfig}{\rm (p.\,\pageref{classKConfig})}\end{Desc}


Definition at line 443 of file kaccel.cpp.\index{KAccel@{KAccel}!setConfigGroup@{setConfigGroup}}
\index{setConfigGroup@{setConfigGroup}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAccel::set\-Config\-Group (const {\bf QString} \& {\em name})}\label{classKAccel_a21}


Returns the configuration group of the settings. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em name}]the new configuration group \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf KConfig}{\rm (p.\,\pageref{classKConfig})}\end{Desc}


Definition at line 446 of file kaccel.cpp.\index{KAccel@{KAccel}!readSettings@{readSettings}}
\index{readSettings@{readSettings}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAccel::read\-Settings ({\bf KConfig\-Base} $\ast$ {\em p\-Config} = 0)}\label{classKAccel_a22}


Read all shortcuts from {\tt p\-Config}, or (if {\tt p\-Config} is zero) from the application's configuration file {\bf KGlobal::config}{\rm (p.\,\pageref{classKGlobal_e2})}(). 

The group in which the configuration is stored can be set with {\bf set\-Config\-Group}{\rm (p.\,\pageref{classKAccel_a21})}(). \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em p\-Config}]the configuration file, or 0 for the application configuration file \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}


Definition at line 449 of file kaccel.cpp.\index{KAccel@{KAccel}!writeSettings@{writeSettings}}
\index{writeSettings@{writeSettings}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAccel::write\-Settings ({\bf KConfig\-Base} $\ast$ {\em p\-Config} = 0) const}\label{classKAccel_a23}


Write the current shortcuts to {\tt p\-Config}, or (if {\tt p\-Config} is zero) to the application's configuration file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em p\-Config}]the configuration file, or 0 for the application configuration file \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}


Definition at line 455 of file kaccel.cpp.\index{KAccel@{KAccel}!emitKeycodeChanged@{emitKeycodeChanged}}
\index{emitKeycodeChanged@{emitKeycodeChanged}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAccel::emit\-Keycode\-Changed ()}\label{classKAccel_a24}


Emits the {\bf keycode\-Changed}{\rm (p.\,\pageref{classKAccel_l0})}() signal. 



Definition at line 458 of file kaccel.cpp.

References keycode\-Changed().\index{KAccel@{KAccel}!keycodeChanged@{keycodeChanged}}
\index{keycodeChanged@{keycodeChanged}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAccel::keycode\-Changed ()\hspace{0.3cm}{\tt  [signal]}}\label{classKAccel_l0}


Emitted when one of the key codes has changed. 



Referenced by emit\-Keycode\-Changed().\index{KAccel@{KAccel}!insertItem@{insertItem}}
\index{insertItem@{insertItem}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAccel::insert\-Item (const {\bf QString} \& {\em s\-Label}, const {\bf QString} \& {\em s\-Action}, const char $\ast$ {\em ps\-Key}, int {\em n\-IDMenu} = 0, {\bf QPopup\-Menu} $\ast$ {\em p\-Menu} = 0, bool {\em b\-Configurable} = true)}\label{classKAccel_a25}


{\bf This class or method is obsolete, it is provided for compatibility only.} 



Definition at line 469 of file kaccel.cpp.

References KStd\-Action::cut().\index{KAccel@{KAccel}!insertItem@{insertItem}}
\index{insertItem@{insertItem}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAccel::insert\-Item (const {\bf QString} \& {\em s\-Label}, const {\bf QString} \& {\em s\-Action}, int {\em key}, int {\em n\-IDMenu} = 0, {\bf QPopup\-Menu} $\ast$ {\em p\-Menu} = 0, bool {\em b\-Configurable} = true)}\label{classKAccel_a26}


{\bf This class or method is obsolete, it is provided for compatibility only.} 



Definition at line 481 of file kaccel.cpp.

References KStd\-Action::cut(), and KStd\-Accel::key().\index{KAccel@{KAccel}!insertStdItem@{insertStdItem}}
\index{insertStdItem@{insertStdItem}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAccel::insert\-Std\-Item ({\bf KStd\-Accel::Std\-Accel} {\em id}, const {\bf QString} \& {\em descr} = QString::null)}\label{classKAccel_a27}


{\bf This class or method is obsolete, it is provided for compatibility only.} 



Definition at line 495 of file kaccel.cpp.\index{KAccel@{KAccel}!connectItem@{connectItem}}
\index{connectItem@{connectItem}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAccel::connect\-Item (const {\bf QString} \& {\em s\-Action}, const {\bf QObject} $\ast$ {\em p\-Obj\-Slot}, const char $\ast$ {\em ps\-Method\-Slot}, bool {\em b\-Activate} = true)}\label{classKAccel_a28}


{\bf This class or method is obsolete, it is provided for compatibility only.} 



Definition at line 506 of file kaccel.cpp.

References set\-Slot().\index{KAccel@{KAccel}!connectItem@{connectItem}}
\index{connectItem@{connectItem}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAccel::connect\-Item ({\bf KStd\-Accel::Std\-Accel} {\em accel}, const {\bf QObject} $\ast$ {\em p\-Obj\-Slot}, const char $\ast$ {\em ps\-Method\-Slot})\hspace{0.3cm}{\tt  [inline]}}\label{classKAccel_a29}


{\bf This class or method is obsolete, it is provided for compatibility only.} 



Definition at line 351 of file kaccel.h.

References insert().\index{KAccel@{KAccel}!removeItem@{removeItem}}
\index{removeItem@{removeItem}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAccel::remove\-Item (const {\bf QString} \& {\em s\-Action})}\label{classKAccel_a30}


{\bf This class or method is obsolete, it is provided for compatibility only.} 



Definition at line 517 of file kaccel.cpp.\index{KAccel@{KAccel}!setItemEnabled@{setItemEnabled}}
\index{setItemEnabled@{setItemEnabled}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KAccel::set\-Item\-Enabled (const {\bf QString} \& {\em s\-Action}, bool {\em b\-Enable})}\label{classKAccel_a31}


{\bf This class or method is obsolete, it is provided for compatibility only.} 



Definition at line 520 of file kaccel.cpp.

References set\-Enabled().\index{KAccel@{KAccel}!changeMenuAccel@{changeMenuAccel}}
\index{changeMenuAccel@{changeMenuAccel}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAccel::change\-Menu\-Accel ({\bf QPopup\-Menu} $\ast$ {\em menu}, int {\em id}, const {\bf QString} \& {\em action})}\label{classKAccel_a32}


{\bf This class or method is obsolete, it is provided for compatibility only.} 



Definition at line 523 of file kaccel.cpp.

References KStd\-Action::action(), QPopup\-Menu::change\-Item(), QString::find(), QString::is\-Empty(), QPixmap::is\-Null(), QString::length(), QPopup\-Menu::pixmap(), QString::replace(), and QPopup\-Menu::text().

Referenced by change\-Menu\-Accel().\index{KAccel@{KAccel}!changeMenuAccel@{changeMenuAccel}}
\index{changeMenuAccel@{changeMenuAccel}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KAccel::change\-Menu\-Accel ({\bf QPopup\-Menu} $\ast$ {\em menu}, int {\em id}, {\bf KStd\-Accel::Std\-Accel} {\em accel})}\label{classKAccel_a33}


{\bf This class or method is obsolete, it is provided for compatibility only.} 



Definition at line 550 of file kaccel.cpp.

References change\-Menu\-Accel().\index{KAccel@{KAccel}!stringToKey@{stringToKey}}
\index{stringToKey@{stringToKey}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KAccel::string\-To\-Key (const {\bf QString} \&)\hspace{0.3cm}{\tt  [static]}}\label{classKAccel_e0}


{\bf This class or method is obsolete, it is provided for compatibility only.} 



Definition at line 555 of file kaccel.cpp.\index{KAccel@{KAccel}!currentKey@{currentKey}}
\index{currentKey@{currentKey}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KAccel::current\-Key (const {\bf QString} \& {\em action}) const}\label{classKAccel_a34}


{\bf This class or method is obsolete, it is provided for compatibility only.}. 

Use {\bf shortcut()}{\rm (p.\,\pageref{classKAccel_a16})}. Retrieve the key code of the accelerator item with the action name {\tt action}, or zero if either the action name cannot be found or the current key is set to no key.

Definition at line 560 of file kaccel.cpp.\index{KAccel@{KAccel}!findKey@{findKey}}
\index{findKey@{findKey}!KAccel@{KAccel}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KAccel::find\-Key (int {\em key}) const}\label{classKAccel_a35}


{\bf This class or method is obsolete, it is provided for compatibility only.}. 

Use actions().action\-Ptr(). Return the name of the accelerator item with the keycode {\tt key}, or QString::null if the item cannot be found.

Definition at line 568 of file kaccel.cpp.

References KStd\-Accel::key().

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