\section{KShortcut Class Reference}
\label{classKShortcut}\index{KShortcut@{KShortcut}}
The KShortcut class is used to represent a keyboard shortcut to an action.  


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

Collaboration diagram for KShortcut:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=60pt]{classKShortcut__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum \{ {\bf MAX\_\-SEQUENCES} =  2
 \}
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KShortcut} ()
\item 
{\bf KShortcut} (int key\-Qt)
\item 
{\bf KShortcut} (const {\bf QKey\-Sequence} \&key\-Seq)
\item 
{\bf KShortcut} (const {\bf KKey} \&key)
\item 
{\bf KShortcut} (const {\bf KKey\-Sequence} \&key\-Seq)
\item 
{\bf KShortcut} (const {\bf KShortcut} \&shortcut)
\item 
{\bf KShortcut} (const char $\ast$shortcut)
\item 
{\bf KShortcut} (const {\bf QString} \&shortcut)
\item 
void {\bf clear} ()
\item 
bool {\bf init} (int key\-Qt)
\item 
bool {\bf init} (const {\bf QKey\-Sequence} \&key\-Seq)
\item 
bool {\bf init} (const {\bf KKey} \&key)
\item 
bool {\bf init} (const {\bf KKey\-Sequence} \&key\-Seq)
\item 
bool {\bf init} (const {\bf KShortcut} \&shortcut)
\item 
bool {\bf init} (const {\bf QString} \&shortcut)
\item 
{\bf KShortcut} \& {\bf operator=} (const {\bf KShortcut} \&cut)
\item 
uint {\bf count} () const 
\item 
const {\bf KKey\-Sequence} \& {\bf seq} (uint i) const 
\item 
int {\bf key\-Code\-Qt} () const 
\item 
bool {\bf is\-Null} () const 
\item 
int {\bf compare} (const {\bf KShortcut} \&shortcut) const 
\item 
bool {\bf operator==} (const {\bf KShortcut} \&cut) const 
\item 
bool {\bf operator!=} (const {\bf KShortcut} \&cut) const 
\item 
bool {\bf operator$<$} (const {\bf KShortcut} \&cut) const 
\item 
bool {\bf contains} (const {\bf KKey} \&key) const 
\item 
bool {\bf contains} (const {\bf KKey\-Native} \&key) const 
\item 
bool {\bf contains} (const {\bf KKey\-Sequence} \&key\-Seq) const 
\item 
bool {\bf set\-Seq} (uint i, const {\bf KKey\-Sequence} \&key\-Seq)
\item 
bool {\bf append} (const {\bf KKey\-Sequence} \&key\-Seq)
\item 
void {\bf remove} (const {\bf KKey\-Sequence} \&key\-Seq)
\item 
bool {\bf append} (const {\bf KKey} \&spec)
\item 
bool {\bf append} (const {\bf KShortcut} \&cut)
\item 
{\bf operator QKey\-Sequence} () const 
\item 
{\bf QString} {\bf to\-String} () const 
\item 
{\bf QString} {\bf to\-String\-Internal} (const {\bf KShortcut} $\ast$pcut\-Default=0) const \label{classKShortcut_a35}

\item 
{\bf operator int} () const \label{classKShortcut_a36}

\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static {\bf KShortcut} \& {\bf null} ()
\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
uint {\bf m\_\-n\-Seqs}\label{classKShortcut_p0}

\item 
{\bf KKey\-Sequence} {\bf m\_\-rgseq} [MAX\_\-SEQUENCES]\label{classKShortcut_p1}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf KKey\-Native}\label{classKShortcut_n0}

\end{CompactItemize}


\subsection{Detailed Description}
The KShortcut class is used to represent a keyboard shortcut to an action. 

A shortcut is normally a single key with modifiers, such as Ctrl+V. A KShortcut object may also contain an alternate key which will also activate the action it's associated to, as long as no other actions have defined that key as their primary key. Ex: Ctrl+V;Shift+Insert.

This can be used to add additional accelerators to a {\bf KAction}. For example, the below code binds the escape key to the close action.



\footnotesize\begin{verbatim}  KAction *closeAction = KStdAction::close( this, SLOT( close() ), actionCollection() );
  KShortcut closeShortcut = closeAction->shortcut();
  closeShortcut.append( KKey(Key_Escape));
  closeAction->setShortcut(closeShortcut);
\end{verbatim}
\normalsize


Note that a shortcut cannot have more than 2 key combinations associated with it, so the above code would not do anything (and .append would return false) if the close\-Action already had an key and alternate key. 



Definition at line 543 of file kshortcut.h.

\subsection{Member Enumeration Documentation}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}anonymous enum}\label{classKShortcut_w1}


The maximum number of key sequences that can be contained in a KShortcut. 



Definition at line 550 of file kshortcut.h.

\subsection{Constructor \& Destructor Documentation}
\index{KShortcut@{KShortcut}!KShortcut@{KShortcut}}
\index{KShortcut@{KShortcut}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KShortcut::KShortcut ()}\label{classKShortcut_a0}


Creates a new null shortcut. 

\begin{Desc}
\item[See also:]{\bf null()}{\rm (p.\,\pageref{classKShortcut_e0})} 

{\bf is\-Null()}{\rm (p.\,\pageref{classKShortcut_a20})} 

{\bf clear()}{\rm (p.\,\pageref{classKShortcut_a9})}\end{Desc}


Definition at line 414 of file kshortcut.cpp.

References clear().\index{KShortcut@{KShortcut}!KShortcut@{KShortcut}}
\index{KShortcut@{KShortcut}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KShortcut::KShortcut (int {\em key\-Qt})}\label{classKShortcut_a1}


Creates a new shortcut with the given {\bf Qt} key code as the only key sequence. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key\-Qt}]the qt keycode \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]Qt::Key\end{Desc}


Definition at line 415 of file kshortcut.cpp.

References init().\index{KShortcut@{KShortcut}!KShortcut@{KShortcut}}
\index{KShortcut@{KShortcut}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KShortcut::KShortcut (const {\bf QKey\-Sequence} \& {\em key\-Seq})}\label{classKShortcut_a2}


Creates a new shortcut that contains only the given qt key sequence. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key\-Seq}]the qt key sequence to add\end{description}
\end{Desc}


Definition at line 416 of file kshortcut.cpp.

References init().\index{KShortcut@{KShortcut}!KShortcut@{KShortcut}}
\index{KShortcut@{KShortcut}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KShortcut::KShortcut (const {\bf KKey} \& {\em key})}\label{classKShortcut_a3}


Creates a new shortcut that contains only the given key in its only sequence. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key}]the key to add\end{description}
\end{Desc}


Definition at line 417 of file kshortcut.cpp.

References init().\index{KShortcut@{KShortcut}!KShortcut@{KShortcut}}
\index{KShortcut@{KShortcut}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KShortcut::KShortcut (const {\bf KKey\-Sequence} \& {\em key\-Seq})}\label{classKShortcut_a4}


Creates a new shortcut that contains only the given key sequence. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key\-Seq}]the key sequence to add\end{description}
\end{Desc}


Definition at line 418 of file kshortcut.cpp.

References init(), and seq().\index{KShortcut@{KShortcut}!KShortcut@{KShortcut}}
\index{KShortcut@{KShortcut}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KShortcut::KShortcut (const {\bf KShortcut} \& {\em shortcut})}\label{classKShortcut_a5}


Copies the given shortcut. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em shortcut}]the shortcut to add\end{description}
\end{Desc}


Definition at line 419 of file kshortcut.cpp.

References init().\index{KShortcut@{KShortcut}!KShortcut@{KShortcut}}
\index{KShortcut@{KShortcut}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KShortcut::KShortcut (const char $\ast$ {\em shortcut})}\label{classKShortcut_a6}


Creates a new key sequence that contains the given key sequence. 

The description consists of semicolon-separated keys as used in {\bf KKey\-Sequence::KKey\-Sequence(const QString\&)}{\rm (p.\,\pageref{classKKeySequence_a5})}. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em shortcut}]the description of the key \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf KKey\-Sequence::KKey\-Sequence(const QString\&)}{\rm (p.\,\pageref{classKKeySequence_a5})}\end{Desc}


Definition at line 420 of file kshortcut.cpp.

References init().\index{KShortcut@{KShortcut}!KShortcut@{KShortcut}}
\index{KShortcut@{KShortcut}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KShortcut::KShortcut (const {\bf QString} \& {\em shortcut})}\label{classKShortcut_a7}


Creates a new key sequence that contains the given key sequence. 

The description consists of semicolon-separated keys as used in {\bf KKey\-Sequence::KKey\-Sequence(const QString\&)}{\rm (p.\,\pageref{classKKeySequence_a5})}. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em shortcut}]the description of the key \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf KKey\-Sequence::KKey\-Sequence(const QString\&)}{\rm (p.\,\pageref{classKKeySequence_a5})}\end{Desc}


Definition at line 421 of file kshortcut.cpp.

References init().

\subsection{Member Function Documentation}
\index{KShortcut@{KShortcut}!clear@{clear}}
\index{clear@{clear}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KShortcut::clear ()}\label{classKShortcut_a9}


Clears the shortcut. 

The shortcut is null after calling this function. \begin{Desc}
\item[See also:]{\bf is\-Null()}{\rm (p.\,\pageref{classKShortcut_a20})}\end{Desc}


Definition at line 427 of file kshortcut.cpp.

Referenced by init(), KShortcut(), and null().\index{KShortcut@{KShortcut}!init@{init}}
\index{init@{init}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShortcut::init (int {\em key\-Qt})}\label{classKShortcut_a10}


Initializes the shortcut with the given {\bf Qt} key code as the only key sequence. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key\-Qt}]the qt keycode \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]Qt::Key\end{Desc}


Definition at line 432 of file kshortcut.cpp.

References clear(), and KKey\-Sequence::init().

Referenced by KShortcut().\index{KShortcut@{KShortcut}!init@{init}}
\index{init@{init}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShortcut::init (const {\bf QKey\-Sequence} \& {\em key\-Seq})}\label{classKShortcut_a11}


Initializes the shortcut with the given qt key sequence. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key\-Seq}]the qt key sequence to add\end{description}
\end{Desc}


Definition at line 442 of file kshortcut.cpp.

References KKey\-Sequence::init().\index{KShortcut@{KShortcut}!init@{init}}
\index{init@{init}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShortcut::init (const {\bf KKey} \& {\em key})}\label{classKShortcut_a12}


Initializes the shortcut with the given key as its only sequence. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key}]the key to add\end{description}
\end{Desc}


Definition at line 449 of file kshortcut.cpp.

References KKey\-Sequence::init().\index{KShortcut@{KShortcut}!init@{init}}
\index{init@{init}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShortcut::init (const {\bf KKey\-Sequence} \& {\em key\-Seq})}\label{classKShortcut_a13}


Initializes the shortcut with the given qt key sequence. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key\-Seq}]the qt key sequence to add\end{description}
\end{Desc}


Definition at line 456 of file kshortcut.cpp.

References seq().\index{KShortcut@{KShortcut}!init@{init}}
\index{init@{init}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShortcut::init (const {\bf KShortcut} \& {\em shortcut})}\label{classKShortcut_a14}


Copies the given shortcut. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em shortcut}]the shortcut to add\end{description}
\end{Desc}


Definition at line 463 of file kshortcut.cpp.\index{KShortcut@{KShortcut}!init@{init}}
\index{init@{init}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShortcut::init (const {\bf QString} \& {\em shortcut})}\label{classKShortcut_a15}


Initializes the key sequence with the given key sequence. 

The description consists of semicolon-separated keys as used in {\bf KKey\-Sequence::KKey\-Sequence(const QString\&)}{\rm (p.\,\pageref{classKKeySequence_a5})}. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em shortcut}]the description of the key \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf KKey\-Sequence::KKey\-Sequence(const QString\&)}{\rm (p.\,\pageref{classKKeySequence_a5})}\end{Desc}


Definition at line 471 of file kshortcut.cpp.

References clear(), KKey\-Server::Variations::count(), endl(), KKey\-Server::Variations::init(), KKey\-Sequence::init(), QString::length(), KKey\-Server::Variations::m\_\-rgkey, QString::mid(), QString::number(), QString\-List::split(), and QString::starts\-With().\index{KShortcut@{KShortcut}!operator=@{operator=}}
\index{operator=@{operator=}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KShortcut}\& KShortcut::operator= (const {\bf KShortcut} \& {\em cut})\hspace{0.3cm}{\tt  [inline]}}\label{classKShortcut_a16}


Copies the given shortcut over this shortcut. 



Definition at line 665 of file kshortcut.h.\index{KShortcut@{KShortcut}!count@{count}}
\index{count@{count}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}uint KShortcut::count () const}\label{classKShortcut_a17}


Returns the number of sequences that are in this shortcut. 

\begin{Desc}
\item[Returns:]the number of sequences MAX\_\-SEQUENCES\end{Desc}


Definition at line 509 of file kshortcut.cpp.

Referenced by contains(), operator QKey\-Sequence(), and to\-String().\index{KShortcut@{KShortcut}!seq@{seq}}
\index{seq@{seq}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf KKey\-Sequence} \& KShortcut::seq (uint {\em i}) const}\label{classKShortcut_a18}


Returns the {\tt i'th} key sequence of this shortcut. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em i}]the number of the key sequence to retrieve \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the {\tt i'th} sequence or {\bf KKey\-Sequence::null()}{\rm (p.\,\pageref{classKKeySequence_e0})} if there are less than {\tt i} key sequences MAX\_\-SEQUENCES\end{Desc}


Definition at line 514 of file kshortcut.cpp.

References KKey\-Sequence::null().

Referenced by append(), contains(), init(), KShortcut(), remove(), and set\-Seq().\index{KShortcut@{KShortcut}!keyCodeQt@{keyCodeQt}}
\index{keyCodeQt@{keyCodeQt}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KShortcut::key\-Code\-Qt () const}\label{classKShortcut_a19}


Returns the key code of the first key sequence, or null if there is no first key sequence. 

\begin{Desc}
\item[Returns:]the key code of the first sequence's first key \end{Desc}
\begin{Desc}
\item[See also:]Qt::Key 

{\bf KKey\-Sequence::key\-Code\-Qt()}{\rm (p.\,\pageref{classKKeySequence_a25})}\end{Desc}


Definition at line 519 of file kshortcut.cpp.

References KKey\-Sequence::key\-Code\-Qt().

Referenced by KStd\-Accel::default\-Key(), and KStd\-Accel::key().\index{KShortcut@{KShortcut}!isNull@{isNull}}
\index{isNull@{isNull}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShortcut::is\-Null () const}\label{classKShortcut_a20}


Returns true if the shortcut is null (after {\bf clear()}{\rm (p.\,\pageref{classKShortcut_a9})} or empty constructor). 

\begin{Desc}
\item[Returns:]true if the shortcut is null \end{Desc}
\begin{Desc}
\item[See also:]{\bf clear()}{\rm (p.\,\pageref{classKShortcut_a9})} 

{\bf null()}{\rm (p.\,\pageref{classKShortcut_e0})}\end{Desc}


Definition at line 526 of file kshortcut.cpp.

Referenced by KCompletion::make\-Completion(), and null().\index{KShortcut@{KShortcut}!compare@{compare}}
\index{compare@{compare}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KShortcut::compare (const {\bf KShortcut} \& {\em shortcut}) const}\label{classKShortcut_a21}


Compares this object with the given shortcut. 

Returns a negative number if the given shortcut is larger, 0 if they are equal and a positive number this shortcut is larger. Shortcuts are compared by comparing the individual key sequences, starting from the beginning until an unequal key sequences has been found. If a shortcut contains more key sequences, it is considered larger. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em shortcut}]the shortcut to compare to \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]a negative number if the given KShortcut is larger, 0 if they are equal and a positive number this KShortcut is larger \end{Desc}
\begin{Desc}
\item[See also:]{\bf KKey::compare()}{\rm (p.\,\pageref{classKKey_a19})} 

KKey\-Shortcut::compare()\end{Desc}


Definition at line 531 of file kshortcut.cpp.

References KKey\-Sequence::compare().\index{KShortcut@{KShortcut}!operator==@{operator==}}
\index{operator==@{operator==}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShortcut::operator== (const {\bf KShortcut} \& {\em cut}) const\hspace{0.3cm}{\tt  [inline]}}\label{classKShortcut_a22}


Compares the sequences of both shortcuts. 

\begin{Desc}
\item[See also:]{\bf compare()}{\rm (p.\,\pageref{classKShortcut_a21})}\end{Desc}


Definition at line 722 of file kshortcut.h.\index{KShortcut@{KShortcut}!operator"!=@{operator"!=}}
\index{operator"!=@{operator"!=}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShortcut::operator!= (const {\bf KShortcut} \& {\em cut}) const\hspace{0.3cm}{\tt  [inline]}}\label{classKShortcut_a23}


Compares the sequences of both shortcuts. 

\begin{Desc}
\item[See also:]{\bf compare()}{\rm (p.\,\pageref{classKShortcut_a21})}\end{Desc}


Definition at line 729 of file kshortcut.h.\index{KShortcut@{KShortcut}!operator<@{operator$<$}}
\index{operator<@{operator$<$}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShortcut::operator$<$ (const {\bf KShortcut} \& {\em cut}) const\hspace{0.3cm}{\tt  [inline]}}\label{classKShortcut_a24}


Compares the sequences of both shortcuts. 

\begin{Desc}
\item[See also:]{\bf compare()}{\rm (p.\,\pageref{classKShortcut_a21})}\end{Desc}


Definition at line 736 of file kshortcut.h.\index{KShortcut@{KShortcut}!contains@{contains}}
\index{contains@{contains}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShortcut::contains (const {\bf KKey} \& {\em key}) const}\label{classKShortcut_a25}


Checks whether this shortcut contains a sequence that starts with the given key. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key}]the key to check \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if a key sequence starts with the key\end{Desc}


Definition at line 541 of file kshortcut.cpp.

Referenced by append(), and KShortcut\-List::index().\index{KShortcut@{KShortcut}!contains@{contains}}
\index{contains@{contains}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShortcut::contains (const {\bf KKey\-Native} \& {\em key}) const}\label{classKShortcut_a26}


Checks whether this shortcut contains a sequence that starts with the given key. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key}]the key to check \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if a key sequence starts with the key\end{Desc}


Definition at line 546 of file kshortcut.cpp.

References KKey\-Sequence::count(), count(), KKey\-Sequence::is\-Null(), KKey\-Sequence::key(), and KKey::simplify().\index{KShortcut@{KShortcut}!contains@{contains}}
\index{contains@{contains}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShortcut::contains (const {\bf KKey\-Sequence} \& {\em key\-Seq}) const}\label{classKShortcut_a27}


Checks whether this shortcut contains the given sequence. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key\-Seq}]the key sequence to check \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if the shortcut has the given key sequence\end{Desc}


Definition at line 560 of file kshortcut.cpp.

References count(), KKey\-Sequence::is\-Null(), and seq().\index{KShortcut@{KShortcut}!setSeq@{setSeq}}
\index{setSeq@{setSeq}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShortcut::set\-Seq (uint {\em i}, const {\bf KKey\-Sequence} \& {\em key\-Seq})}\label{classKShortcut_a28}


Sets the {\tt i} 'th key sequence of the shortcut. 

You can not introduce gaps in the list of sequences, so you must use an {\tt i} $<$= {\bf count()}{\rm (p.\,\pageref{classKShortcut_a17})}. Also note that the maximum number of key sequences is MAX\_\-SEQUENCES. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em i}]the position of the new key sequence(0 $<$= i $<$= {\bf count()}{\rm (p.\,\pageref{classKShortcut_a17})}, 0 $<$= i $<$ MAX\_\-SEQUENCES) \item[{\em key\-Seq}]the key sequence to set \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}


Definition at line 569 of file kshortcut.cpp.

References seq().\index{KShortcut@{KShortcut}!append@{append}}
\index{append@{append}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShortcut::append (const {\bf KKey\-Sequence} \& {\em key\-Seq})}\label{classKShortcut_a29}


Appends the given key sequence. 

This sets it as either the keysequence or the alternate keysequence. If the shortcut already has MAX\_\-SEQUENCES sequences then this call does nothing, and returns false.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key\-Seq}]the key sequence to add \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise \end{Desc}
\begin{Desc}
\item[See also:]{\bf set\-Seq()}{\rm (p.\,\pageref{classKShortcut_a28})}\end{Desc}


Definition at line 596 of file kshortcut.cpp.

References KKey\-Sequence::is\-Null(), and seq().\index{KShortcut@{KShortcut}!remove@{remove}}
\index{remove@{remove}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KShortcut::remove (const {\bf KKey\-Sequence} \& {\em key\-Seq})}\label{classKShortcut_a30}


Removes the given key sequence from this shortcut. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key\-Seq}]the key sequence to remove \end{description}
\end{Desc}
\begin{Desc}
\item[Since:]3.3\end{Desc}


Definition at line 581 of file kshortcut.cpp.

References KKey\-Sequence::is\-Null(), and seq().\index{KShortcut@{KShortcut}!append@{append}}
\index{append@{append}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShortcut::append (const {\bf KKey} \& {\em spec})}\label{classKShortcut_a31}


Appends the given key. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em spec}]the key to add \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise \end{Desc}
\begin{Desc}
\item[See also:]{\bf set\-Seq()}{\rm (p.\,\pageref{classKShortcut_a28})} 

MAX\_\-SEQUENCES \end{Desc}
\begin{Desc}
\item[Since:]3.2\end{Desc}


Definition at line 608 of file kshortcut.cpp.

References KKey\-Sequence::init().\index{KShortcut@{KShortcut}!append@{append}}
\index{append@{append}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KShortcut::append (const {\bf KShortcut} \& {\em cut})}\label{classKShortcut_a32}


Appends the sequences from the given shortcut. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em cut}]the shortcut to append \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise \end{Desc}
\begin{Desc}
\item[See also:]MAX\_\-SEQUENCES \end{Desc}
\begin{Desc}
\item[Since:]3.2\end{Desc}


Definition at line 618 of file kshortcut.cpp.

References contains(), and seq().\index{KShortcut@{KShortcut}!operator QKeySequence@{operator QKeySequence}}
\index{operator QKeySequence@{operator QKeySequence}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KShortcut::operator {\bf QKey\-Sequence} () const}\label{classKShortcut_a33}


Converts this shortcut to a key sequence. 

The first key sequence will be taken.

Definition at line 636 of file kshortcut.cpp.

References count(), and KKey\-Sequence::qt().\index{KShortcut@{KShortcut}!toString@{toString}}
\index{toString@{toString}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KShortcut::to\-String () const}\label{classKShortcut_a34}


Returns a description of the shortcut as semicolon-separated ket sequences, as returned by {\bf KKey\-Sequence::to\-String()}{\rm (p.\,\pageref{classKKeySequence_a26})}. 

\begin{Desc}
\item[Returns:]the string represenation of this shortcut \end{Desc}
\begin{Desc}
\item[See also:]{\bf KKey::to\-String()}{\rm (p.\,\pageref{classKKey_a24})} 

{\bf KKey\-Sequence::to\-String()}{\rm (p.\,\pageref{classKKeySequence_a26})}\end{Desc}


Definition at line 644 of file kshortcut.cpp.

References count(), and KKey\-Sequence::to\-String().\index{KShortcut@{KShortcut}!null@{null}}
\index{null@{null}!KShortcut@{KShortcut}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KShortcut} \& KShortcut::null ()\hspace{0.3cm}{\tt  [static]}}\label{classKShortcut_e0}


Returns a null shortcut. 

\begin{Desc}
\item[Returns:]the null shortcut \end{Desc}
\begin{Desc}
\item[See also:]{\bf is\-Null()}{\rm (p.\,\pageref{classKShortcut_a20})} 

{\bf clear()}{\rm (p.\,\pageref{classKShortcut_a9})}\end{Desc}


Definition at line 676 of file kshortcut.cpp.

References clear(), and is\-Null().

Referenced by KStd\-Accel::shortcut(), KGlobal\-Accel::shortcut(), and KAccel::shortcut().

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