KPopupMenu Class Reference
KPopupMenu is a class for menus with standard title items and keyboard accessibility for popups with many options and/or varying options.A menu with title items. More...
#include <kpopupmenu.h>
Inheritance diagram for KPopupMenu:

Signals | |
void | aboutToShowContextMenu (KPopupMenu *menu, int menuItem, QPopupMenu *ctxMenu) |
Public Member Functions | |
KPopupMenu (QWidget *parent=0, const char *name=0) | |
~KPopupMenu () | |
int | insertTitle (const QString &text, int id=-1, int index=-1) |
int | insertTitle (const QPixmap &icon, const QString &text, int id=-1, int index=-1) |
void | changeTitle (int id, const QString &text) |
void | changeTitle (int id, const QPixmap &icon, const QString &text) |
QString | title (int id=-1) const |
QPixmap | titlePixmap (int id) const |
void | setKeyboardShortcutsEnabled (bool enable) |
void | setKeyboardShortcutsExecute (bool enable) |
KPopupMenu (const QString &title, QWidget *parent=0, const char *name=0) KDE_DEPRECATED | |
void | setTitle (const QString &title) KDE_DEPRECATED |
QPopupMenu * | contextMenu () |
const QPopupMenu * | contextMenu () const |
void | hideContextMenu () |
Static Public Member Functions | |
static KPopupMenu * | contextMenuFocus () |
static int | contextMenuFocusItem () |
Protected Slots | |
QString | underlineText (const QString &text, uint length) |
void | resetKeyboardVars (bool noMatches=false) |
void | itemHighlighted (int whichItem) |
void | showCtxMenu (QPoint pos) |
void | ctxMenuHiding () |
void | ctxMenuHideShowingMenu () |
Protected Member Functions | |
virtual void | closeEvent (QCloseEvent *) |
virtual void | keyPressEvent (QKeyEvent *e) |
virtual void | mousePressEvent (QMouseEvent *e) |
virtual bool | focusNextPrevChild (bool next) |
virtual void | contextMenuEvent (QContextMenuEvent *e) |
virtual void | hideEvent (QHideEvent *) |
virtual void | virtual_hook (int id, void *data) |
Detailed Description
KPopupMenu is a class for menus with standard title items and keyboard accessibility for popups with many options and/or varying options.A menu with title items.It acts identically to QPopupMenu, with the addition of insertTitle(), changeTitle(), setKeyboardShortcutsEnabled() and setKeyboardShortcutsExecute() 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.
- Author:
- Daniel M. Duley <mosfet@kde.org>
Hamish Rodda <rodda@kde.org>
Definition at line 122 of file kpopupmenu.h.
Constructor & Destructor Documentation
|
Constructs a KPopupMenu.
Definition at line 162 of file kpopupmenu.cpp. References resetKeyboardVars(). |
|
Destructs the object.
Definition at line 170 of file kpopupmenu.cpp. |
|
end of RMB menus on menus support
Definition at line 645 of file kpopupmenu.cpp. References insertTitle(). |
Member Function Documentation
|
Inserts a title item with no icon.
Definition at line 181 of file kpopupmenu.cpp. References KPopupTitle::setTitle(). Referenced by KDateTable::contentsMousePressEvent(), KPopupMenu(), and KSystemTray::KSystemTray(). |
|
Inserts a title item with the given icon and title.
Definition at line 190 of file kpopupmenu.cpp. References KPopupTitle::setTitle(). |
|
Changes the title of the item at the specified id. If a icon was previously set it is cleared. Definition at line 200 of file kpopupmenu.cpp. References endl(), and kdWarning(). |
|
Changes the title and icon of the title item at the specified id.
Definition at line 217 of file kpopupmenu.cpp. References endl(), and kdWarning(). |
|
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 234 of file kpopupmenu.cpp. |
|
Returns the icon of the title item at the specified id.
Definition at line 250 of file kpopupmenu.cpp. |
|
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 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.
Definition at line 461 of file kpopupmenu.cpp. Referenced by KPanelMenu::init(). |
|
Enables execution of the menu item once it is uniquely specified. Defaults to off.
Definition at line 466 of file kpopupmenu.cpp. |
|
Definition at line 653 of file kpopupmenu.cpp. References KPopupTitle::setTitle(). |
|
Returns the context menu associated with this menu.
Definition at line 489 of file kpopupmenu.cpp. |
|
Returns the context menu associated with this menu.
Definition at line 500 of file kpopupmenu.cpp. |
|
Hides the context menu if shown.
Definition at line 505 of file kpopupmenu.cpp. |
|
Returns the KPopupMenu associated with the current context menu.
Definition at line 515 of file kpopupmenu.cpp. |
|
returns the ID of the menuitem associated with the current context menu
Definition at line 510 of file kpopupmenu.cpp. |
|
connect to this signal to be notified when a context menu is about to be shown
|
|
This is re-implemented for keyboard navigation.
Definition at line 268 of file kpopupmenu.cpp. References resetKeyboardVars(). |
|
RMB menus on menus.
Definition at line 478 of file kpopupmenu.cpp. |
|
Definition at line 436 of file kpopupmenu.cpp. |
|
Definition at line 446 of file kpopupmenu.cpp. Referenced by closeEvent(), and KPopupMenu(). |
The documentation for this class was generated from the following files: