kdeui
KPopupMenu Class Reference
A menu with title items. More...
#include <kpopupmenu.h>
Signals | |
void | aboutToShowContextMenu (KPopupMenu *menu, int menuItem, QPopupMenu *ctxMenu) |
Public Member Functions | |
virtual void | activateItemAt (int index) |
void | changeTitle (int id, const QPixmap &icon, const QString &text) |
void | changeTitle (int id, const QString &text) |
const QPopupMenu * | contextMenu () const |
QPopupMenu * | contextMenu () |
void | hideContextMenu () |
int | insertTitle (const QPixmap &icon, const QString &text, int id=-1, int index=-1) |
int | insertTitle (const QString &text, int id=-1, int index=-1) |
KPopupMenu (const QString &title, QWidget *parent=0, const char *name=0) KDE_DEPRECATED | |
KPopupMenu (QWidget *parent=0, const char *name=0) | |
void | setKeyboardShortcutsEnabled (bool enable) |
void | setKeyboardShortcutsExecute (bool enable) |
void | setTitle (const QString &title) KDE_DEPRECATED |
Qt::ButtonState | state () const |
QString | title (int id=-1) const |
QPixmap | titlePixmap (int id) const |
~KPopupMenu () | |
Static Public Member Functions | |
static KPopupMenu * | contextMenuFocus () |
static int | contextMenuFocusItem () |
Protected Slots | |
void | ctxMenuHideShowingMenu () |
void | ctxMenuHiding () |
void | itemHighlighted (int whichItem) |
void | resetKeyboardVars (bool noMatches=false) |
void | showCtxMenu (QPoint pos) |
QString | underlineText (const QString &text, uint length) |
Protected Member Functions | |
virtual void | closeEvent (QCloseEvent *) |
virtual void | contextMenuEvent (QContextMenuEvent *e) |
virtual bool | focusNextPrevChild (bool next) |
virtual void | hideEvent (QHideEvent *) |
virtual void | keyPressEvent (QKeyEvent *e) |
virtual void | mousePressEvent (QMouseEvent *e) |
virtual void | mouseReleaseEvent (QMouseEvent *e) |
virtual void | virtual_hook (int id, void *data) |
Detailed Description
A menu with title items.KPopupMenu 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 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.
Definition at line 123 of file kpopupmenu.h.
Constructor & Destructor Documentation
KPopupMenu::KPopupMenu | ( | QWidget * | parent = 0 , |
|
const char * | name = 0 | |||
) |
KPopupMenu::~KPopupMenu | ( | ) |
end of RMB menus on menus support
- Deprecated:
- Obsolete method provided for backwards compatibility only. Use the normal constructor and insertTitle instead.
Definition at line 667 of file kpopupmenu.cpp.
Member Function Documentation
void KPopupMenu::aboutToShowContextMenu | ( | KPopupMenu * | menu, | |
int | menuItem, | |||
QPopupMenu * | ctxMenu | |||
) | [signal] |
connect to this signal to be notified when a context menu is about to be shown
- Parameters:
-
menu The menu that the context menu is about to be shown for menuItem The menu item that the context menu is currently on ctxMenu The context menu itself
- Since:
- 3.2
void KPopupMenu::activateItemAt | ( | int | index | ) | [virtual] |
Changes the title and icon of the title item at the specified id.
Definition at line 216 of file kpopupmenu.cpp.
void KPopupMenu::changeTitle | ( | int | id, | |
const QString & | text | |||
) |
Changes the title of the item at the specified id.
If a icon was previously set it is cleared.
Definition at line 199 of file kpopupmenu.cpp.
void KPopupMenu::closeEvent | ( | QCloseEvent * | e | ) | [protected, virtual] |
const QPopupMenu * KPopupMenu::contextMenu | ( | ) | const |
Returns the context menu associated with this menu.
- Since:
- 3.2
Definition at line 522 of file kpopupmenu.cpp.
QPopupMenu * KPopupMenu::contextMenu | ( | ) |
Returns the context menu associated with this menu.
- Since:
- 3.2
Definition at line 511 of file kpopupmenu.cpp.
void KPopupMenu::contextMenuEvent | ( | QContextMenuEvent * | e | ) | [protected, virtual] |
Definition at line 625 of file kpopupmenu.cpp.
KPopupMenu * KPopupMenu::contextMenuFocus | ( | ) | [static] |
Returns the KPopupMenu associated with the current context menu.
- Since:
- 3.2
Definition at line 537 of file kpopupmenu.cpp.
int KPopupMenu::contextMenuFocusItem | ( | ) | [static] |
returns the ID of the menuitem associated with the current context menu
- Since:
- 3.2
Definition at line 532 of file kpopupmenu.cpp.
void KPopupMenu::ctxMenuHideShowingMenu | ( | ) | [protected, slot] |
Definition at line 597 of file kpopupmenu.cpp.
void KPopupMenu::ctxMenuHiding | ( | ) | [protected, slot] |
Definition at line 610 of file kpopupmenu.cpp.
bool KPopupMenu::focusNextPrevChild | ( | bool | next | ) | [protected, virtual] |
Definition at line 443 of file kpopupmenu.cpp.
void KPopupMenu::hideContextMenu | ( | ) |
void KPopupMenu::hideEvent | ( | QHideEvent * | ) | [protected, virtual] |
int KPopupMenu::insertTitle | ( | const QString & | text, | |
int | id = -1 , |
|||
int | index = -1 | |||
) |
void KPopupMenu::itemHighlighted | ( | int | whichItem | ) | [protected, slot] |
Definition at line 542 of file kpopupmenu.cpp.
void KPopupMenu::keyPressEvent | ( | QKeyEvent * | e | ) | [protected, virtual] |
Definition at line 285 of file kpopupmenu.cpp.
void KPopupMenu::mousePressEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
void KPopupMenu::mouseReleaseEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
void KPopupMenu::resetKeyboardVars | ( | bool | noMatches = false |
) | [protected, slot] |
void KPopupMenu::setKeyboardShortcutsEnabled | ( | bool | enable | ) |
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.
- Since:
- 3.1
Definition at line 474 of file kpopupmenu.cpp.
void KPopupMenu::setKeyboardShortcutsExecute | ( | bool | enable | ) |
Enables execution of the menu item once it is uniquely specified.
Defaults to off.
- Since:
- 3.1
Definition at line 479 of file kpopupmenu.cpp.
void KPopupMenu::setTitle | ( | const QString & | title | ) |
- Deprecated:
- Obsolete method provided for backwards compatibility only. Use insertTitle and changeTitle instead.
Definition at line 675 of file kpopupmenu.cpp.
void KPopupMenu::showCtxMenu | ( | QPoint | pos | ) | [protected, slot] |
Definition at line 553 of file kpopupmenu.cpp.
Qt::ButtonState KPopupMenu::state | ( | ) | const |
Return the state of the mouse button and keyboard modifiers when the last menuitem was activated.
- Since:
- 3.4
Definition at line 280 of file kpopupmenu.cpp.
QString KPopupMenu::title | ( | int | id = -1 |
) | const |
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 233 of file kpopupmenu.cpp.
QPixmap KPopupMenu::titlePixmap | ( | int | id | ) | const |
Returns the icon of the title item at the specified id.
Definition at line 249 of file kpopupmenu.cpp.
void KPopupMenu::virtual_hook | ( | int | id, | |
void * | data | |||
) | [protected, virtual] |
The documentation for this class was generated from the following files: