\section{KPopup\-Menu Class Reference}
\label{classKPopupMenu}\index{KPopupMenu@{KPopupMenu}}
A menu with title items.  


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

Inheritance diagram for KPopup\-Menu:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=57pt]{classKPopupMenu__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KPopup\-Menu:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=57pt]{classKPopupMenu__coll__graph}
\end{center}
\end{figure}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf about\-To\-Show\-Context\-Menu} ({\bf KPopup\-Menu} $\ast$menu, int menu\-Item, {\bf QPopup\-Menu} $\ast$ctx\-Menu)
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KPopup\-Menu} ({\bf QWidget} $\ast$parent=0, const char $\ast$name=0)
\item 
{\bf $\sim$KPopup\-Menu} ()
\item 
int {\bf insert\-Title} (const {\bf QString} \&{\bf text}, int id=-1, int index=-1)
\item 
int {\bf insert\-Title} (const {\bf QPixmap} \&icon, const {\bf QString} \&{\bf text}, int id=-1, int index=-1)
\item 
void {\bf change\-Title} (int id, const {\bf QString} \&{\bf text})
\item 
void {\bf change\-Title} (int id, const {\bf QPixmap} \&icon, const {\bf QString} \&{\bf text})
\item 
{\bf QString} {\bf title} (int id=-1) const 
\item 
{\bf QPixmap} {\bf title\-Pixmap} (int id) const 
\item 
void {\bf set\-Keyboard\-Shortcuts\-Enabled} (bool enable)
\item 
void {\bf set\-Keyboard\-Shortcuts\-Execute} (bool enable)
\item 
{\bf KPopup\-Menu} (const {\bf QString} \&title, {\bf QWidget} $\ast$parent=0, const char $\ast$name=0) KDE\_\-DEPRECATED
\item 
void {\bf set\-Title} (const {\bf QString} \&title) KDE\_\-DEPRECATED
\item 
{\bf QPopup\-Menu} $\ast$ {\bf context\-Menu} ()
\item 
const {\bf QPopup\-Menu} $\ast$ {\bf context\-Menu} () const 
\item 
void {\bf hide\-Context\-Menu} ()
\item 
virtual void {\bf activate\-Item\-At} (int index)
\item 
Qt::Button\-State {\bf state} () const 
\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static {\bf KPopup\-Menu} $\ast$ {\bf context\-Menu\-Focus} ()
\item 
static int {\bf context\-Menu\-Focus\-Item} ()
\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
{\bf QString} {\bf underline\-Text} (const {\bf QString} \&{\bf text}, uint length)
\item 
void {\bf reset\-Keyboard\-Vars} (bool no\-Matches=false)
\item 
void {\bf item\-Highlighted} (int which\-Item)\label{classKPopupMenu_j2}

\item 
void {\bf show\-Ctx\-Menu} ({\bf QPoint} pos)\label{classKPopupMenu_j3}

\item 
void {\bf ctx\-Menu\-Hiding} ()\label{classKPopupMenu_j4}

\item 
void {\bf ctx\-Menu\-Hide\-Showing\-Menu} ()\label{classKPopupMenu_j5}

\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
virtual void {\bf close\-Event} ({\bf QClose\-Event} $\ast$)
\item 
virtual void {\bf key\-Press\-Event} ({\bf QKey\-Event} $\ast${\bf e})\label{classKPopupMenu_b1}

\item 
virtual void {\bf mouse\-Release\-Event} ({\bf QMouse\-Event} $\ast${\bf e})
\item 
virtual void {\bf mouse\-Press\-Event} ({\bf QMouse\-Event} $\ast${\bf e})
\item 
virtual bool {\bf focus\-Next\-Prev\-Child} (bool next)\label{classKPopupMenu_b4}

\item 
virtual void {\bf context\-Menu\-Event} ({\bf QContext\-Menu\-Event} $\ast${\bf e})\label{classKPopupMenu_b5}

\item 
virtual void {\bf hide\-Event} ({\bf QHide\-Event} $\ast$)\label{classKPopupMenu_b6}

\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKPopupMenu_b7}

\end{CompactItemize}


\subsection{Detailed Description}
A menu with title items. 

KPopup\-Menu is a class for menus with standard title items and keyboard accessibility for popups with many options and/or varying options. It acts identically to {\bf QPopup\-Menu}, with the addition of {\bf insert\-Title()}{\rm (p.\,\pageref{classKPopupMenu_a2})}, {\bf change\-Title()}{\rm (p.\,\pageref{classKPopupMenu_a4})}, {\bf set\-Keyboard\-Shortcuts\-Enabled()}{\rm (p.\,\pageref{classKPopupMenu_a8})} and {\bf set\-Keyboard\-Shortcuts\-Execute()}{\rm (p.\,\pageref{classKPopupMenu_a9})} methods.

The titles support a text string, an icon, plus user defined gradients, colors, and background pixmaps.

The keyboard search algorithm is incremental with additional underlining for user feedback.

\begin{Desc}
\item[Author:]Daniel M. Duley $<${\tt mosfet@kde.org}$>$ 

Hamish Rodda $<${\tt rodda@kde.org}$>$ \end{Desc}




Definition at line 123 of file kpopupmenu.h.

\subsection{Constructor \& Destructor Documentation}
\index{KPopupMenu@{KPopup\-Menu}!KPopupMenu@{KPopupMenu}}
\index{KPopupMenu@{KPopupMenu}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KPopup\-Menu::KPopup\-Menu ({\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})}\label{classKPopupMenu_a0}


Constructs a KPopup\-Menu. 



Definition at line 164 of file kpopupmenu.cpp.

References reset\-Keyboard\-Vars().\index{KPopupMenu@{KPopup\-Menu}!~KPopupMenu@{$\sim$KPopupMenu}}
\index{~KPopupMenu@{$\sim$KPopupMenu}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KPopup\-Menu::$\sim${\bf KPopup\-Menu} ()}\label{classKPopupMenu_a1}


Destructs the object. 



Definition at line 172 of file kpopupmenu.cpp.\index{KPopupMenu@{KPopup\-Menu}!KPopupMenu@{KPopupMenu}}
\index{KPopupMenu@{KPopupMenu}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KPopup\-Menu::KPopup\-Menu (const {\bf QString} \& {\em title}, {\bf QWidget} $\ast$ {\em parent} = {\tt 0}, const char $\ast$ {\em name} = {\tt 0})}\label{classKPopupMenu_a10}


end of RMB menus on menus support 

\begin{Desc}
\item[{\bf Deprecated}]Obsolete method provided for backwards compatibility only. Use the normal constructor and insert\-Title instead. \end{Desc}


Definition at line 670 of file kpopupmenu.cpp.

References insert\-Title(), and title().

\subsection{Member Function Documentation}
\index{KPopupMenu@{KPopup\-Menu}!insertTitle@{insertTitle}}
\index{insertTitle@{insertTitle}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KPopup\-Menu::insert\-Title (const {\bf QString} \& {\em text}, int {\em id} = {\tt -1}, int {\em index} = {\tt -1})}\label{classKPopupMenu_a2}


Inserts a title item with no icon. 



Definition at line 183 of file kpopupmenu.cpp.

References QPopup\-Menu::insert\-Item(), QPopup\-Menu::set\-Item\-Enabled(), and KPopup\-Title::set\-Title().

Referenced by KDate\-Table::contents\-Mouse\-Press\-Event(), KPixmap\-Region\-Selector\-Widget::create\-Popup\-Menu(), KPopup\-Menu(), and KSystem\-Tray::KSystem\-Tray().\index{KPopupMenu@{KPopup\-Menu}!insertTitle@{insertTitle}}
\index{insertTitle@{insertTitle}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KPopup\-Menu::insert\-Title (const {\bf QPixmap} \& {\em icon}, const {\bf QString} \& {\em text}, int {\em id} = {\tt -1}, int {\em index} = {\tt -1})}\label{classKPopupMenu_a3}


Inserts a title item with the given icon and title. 



Definition at line 192 of file kpopupmenu.cpp.

References QPopup\-Menu::insert\-Item(), QPopup\-Menu::set\-Item\-Enabled(), and KPopup\-Title::set\-Title().\index{KPopupMenu@{KPopup\-Menu}!changeTitle@{changeTitle}}
\index{changeTitle@{changeTitle}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPopup\-Menu::change\-Title (int {\em id}, const {\bf QString} \& {\em text})}\label{classKPopupMenu_a4}


Changes the title of the item at the specified id. 

If a icon was previously set it is cleared. 

Definition at line 202 of file kpopupmenu.cpp.

References endl(), kd\-Warning(), and KPopup\-Title::set\-Title().\index{KPopupMenu@{KPopup\-Menu}!changeTitle@{changeTitle}}
\index{changeTitle@{changeTitle}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPopup\-Menu::change\-Title (int {\em id}, const {\bf QPixmap} \& {\em icon}, const {\bf QString} \& {\em text})}\label{classKPopupMenu_a5}


Changes the title and icon of the title item at the specified id. 



Definition at line 219 of file kpopupmenu.cpp.

References endl(), and kd\-Warning().\index{KPopupMenu@{KPopup\-Menu}!title@{title}}
\index{title@{title}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KPopup\-Menu::title (int {\em id} = {\tt -1}) const}\label{classKPopupMenu_a6}


Returns the title of the title item at the specified id. 

The default id of -1 is for backwards compatibility only, you should always specify the id. 

Definition at line 236 of file kpopupmenu.cpp.

Referenced by KPopup\-Menu(), and set\-Title().\index{KPopupMenu@{KPopup\-Menu}!titlePixmap@{titlePixmap}}
\index{titlePixmap@{titlePixmap}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QPixmap} KPopup\-Menu::title\-Pixmap (int {\em id}) const}\label{classKPopupMenu_a7}


Returns the icon of the title item at the specified id. 



Definition at line 252 of file kpopupmenu.cpp.\index{KPopupMenu@{KPopup\-Menu}!setKeyboardShortcutsEnabled@{setKeyboardShortcutsEnabled}}
\index{setKeyboardShortcutsEnabled@{setKeyboardShortcutsEnabled}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPopup\-Menu::set\-Keyboard\-Shortcuts\-Enabled (bool {\em enable})}\label{classKPopupMenu_a8}


Enables keyboard navigation by searching for the entered key sequence. 

Also underlines the currently selected item, providing feedback on the search.

Defaults to off.

WARNING: calls to {\bf text()} of currently keyboard-selected items will contain additional ampersand characters.

WARNING: though pre-existing keyboard shortcuts will not interfere with the operation of this feature, they may be confusing to the user as the existing shortcuts will not work. \begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 477 of file kpopupmenu.cpp.

Referenced by KPanel\-Menu::init().\index{KPopupMenu@{KPopup\-Menu}!setKeyboardShortcutsExecute@{setKeyboardShortcutsExecute}}
\index{setKeyboardShortcutsExecute@{setKeyboardShortcutsExecute}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPopup\-Menu::set\-Keyboard\-Shortcuts\-Execute (bool {\em enable})}\label{classKPopupMenu_a9}


Enables execution of the menu item once it is uniquely specified. 

Defaults to off. \begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 482 of file kpopupmenu.cpp.\index{KPopupMenu@{KPopup\-Menu}!setTitle@{setTitle}}
\index{setTitle@{setTitle}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPopup\-Menu::set\-Title (const {\bf QString} \& {\em title})}\label{classKPopupMenu_a11}


\begin{Desc}
\item[{\bf Deprecated}]Obsolete method provided for backwards compatibility only. Use insert\-Title and change\-Title instead. \end{Desc}


Definition at line 678 of file kpopupmenu.cpp.

References QPopup\-Menu::insert\-Item(), KPopup\-Title::set\-Title(), and title().\index{KPopupMenu@{KPopup\-Menu}!contextMenu@{contextMenu}}
\index{contextMenu@{contextMenu}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QPopup\-Menu} $\ast$ KPopup\-Menu::context\-Menu ()}\label{classKPopupMenu_a12}


Returns the context menu associated with this menu \begin{Desc}
\item[Since:]3.2. \end{Desc}




Definition at line 514 of file kpopupmenu.cpp.

References QPopup\-Menu::about\-To\-Hide(), and QPopup\-Menu::QPopup\-Menu().\index{KPopupMenu@{KPopup\-Menu}!contextMenu@{contextMenu}}
\index{contextMenu@{contextMenu}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf QPopup\-Menu} $\ast$ KPopup\-Menu::context\-Menu () const}\label{classKPopupMenu_a13}


Returns the context menu associated with this menu \begin{Desc}
\item[Since:]3.2. \end{Desc}




Definition at line 525 of file kpopupmenu.cpp.\index{KPopupMenu@{KPopup\-Menu}!hideContextMenu@{hideContextMenu}}
\index{hideContextMenu@{hideContextMenu}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPopup\-Menu::hide\-Context\-Menu ()}\label{classKPopupMenu_a14}


Hides the context menu if shown \begin{Desc}
\item[Since:]3.2. \end{Desc}




Definition at line 530 of file kpopupmenu.cpp.\index{KPopupMenu@{KPopup\-Menu}!contextMenuFocus@{contextMenuFocus}}
\index{contextMenuFocus@{contextMenuFocus}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KPopup\-Menu} $\ast$ KPopup\-Menu::context\-Menu\-Focus ()\hspace{0.3cm}{\tt  [static]}}\label{classKPopupMenu_e0}


Returns the KPopup\-Menu associated with the current context menu \begin{Desc}
\item[Since:]3.2. \end{Desc}




Definition at line 540 of file kpopupmenu.cpp.\index{KPopupMenu@{KPopup\-Menu}!contextMenuFocusItem@{contextMenuFocusItem}}
\index{contextMenuFocusItem@{contextMenuFocusItem}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KPopup\-Menu::context\-Menu\-Focus\-Item ()\hspace{0.3cm}{\tt  [static]}}\label{classKPopupMenu_e1}


returns the ID of the menuitem associated with the current context menu \begin{Desc}
\item[Since:]3.2 \end{Desc}




Definition at line 535 of file kpopupmenu.cpp.\index{KPopupMenu@{KPopup\-Menu}!activateItemAt@{activateItemAt}}
\index{activateItemAt@{activateItemAt}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPopup\-Menu::activate\-Item\-At (int {\em index})\hspace{0.3cm}{\tt  [virtual]}}\label{classKPopupMenu_a15}


Reimplemented for internal purposes \begin{Desc}
\item[Since:]3.4. \end{Desc}




Definition at line 277 of file kpopupmenu.cpp.\index{KPopupMenu@{KPopup\-Menu}!state@{state}}
\index{state@{state}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}Qt::Button\-State KPopup\-Menu::state () const}\label{classKPopupMenu_a16}


Return the state of the mouse button and keyboard modifiers when the last menuitem was activated. 

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


Definition at line 283 of file kpopupmenu.cpp.

Referenced by KAction::slot\-Popup\-Activated().\index{KPopupMenu@{KPopup\-Menu}!aboutToShowContextMenu@{aboutToShowContextMenu}}
\index{aboutToShowContextMenu@{aboutToShowContextMenu}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPopup\-Menu::about\-To\-Show\-Context\-Menu ({\bf KPopup\-Menu} $\ast$ {\em menu}, int {\em menu\-Item}, {\bf QPopup\-Menu} $\ast$ {\em ctx\-Menu})\hspace{0.3cm}{\tt  [signal]}}\label{classKPopupMenu_l0}


connect to this signal to be notified when a context menu is about to be shown 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em menu}]The menu that the context menu is about to be shown for \item[{\em menu\-Item}]The menu item that the context menu is currently on \item[{\em ctx\-Menu}]The context menu itself \end{description}
\end{Desc}
\begin{Desc}
\item[Since:]3.2 \end{Desc}
\index{KPopupMenu@{KPopup\-Menu}!closeEvent@{closeEvent}}
\index{closeEvent@{closeEvent}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPopup\-Menu::close\-Event ({\bf QClose\-Event} $\ast$ {\em e})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKPopupMenu_b0}


This is re-implemented for keyboard navigation. 



Definition at line 270 of file kpopupmenu.cpp.

References reset\-Keyboard\-Vars().\index{KPopupMenu@{KPopup\-Menu}!mouseReleaseEvent@{mouseReleaseEvent}}
\index{mouseReleaseEvent@{mouseReleaseEvent}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPopup\-Menu::mouse\-Release\-Event ({\bf QMouse\-Event} $\ast$ {\em e})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKPopupMenu_b2}


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




Definition at line 505 of file kpopupmenu.cpp.\index{KPopupMenu@{KPopup\-Menu}!mousePressEvent@{mousePressEvent}}
\index{mousePressEvent@{mousePressEvent}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPopup\-Menu::mouse\-Press\-Event ({\bf QMouse\-Event} $\ast$ {\em e})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKPopupMenu_b3}


RMB menus on menus. 



Definition at line 494 of file kpopupmenu.cpp.\index{KPopupMenu@{KPopup\-Menu}!underlineText@{underlineText}}
\index{underlineText@{underlineText}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KPopup\-Menu::underline\-Text (const {\bf QString} \& {\em text}, uint {\em length})\hspace{0.3cm}{\tt  [protected, slot]}}\label{classKPopupMenu_j0}


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




Definition at line 452 of file kpopupmenu.cpp.

References QString::insert().\index{KPopupMenu@{KPopup\-Menu}!resetKeyboardVars@{resetKeyboardVars}}
\index{resetKeyboardVars@{resetKeyboardVars}!KPopupMenu@{KPopup\-Menu}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KPopup\-Menu::reset\-Keyboard\-Vars (bool {\em no\-Matches} = {\tt false})\hspace{0.3cm}{\tt  [protected, slot]}}\label{classKPopupMenu_j1}


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




Definition at line 462 of file kpopupmenu.cpp.

References QPopup\-Menu::change\-Item(), and QPopup\-Menu::id\-At().

Referenced by close\-Event(), and KPopup\-Menu().

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