#include <kmenu.h>
A menu with keyboard searching.
KMenu is a class for menus with keyboard accessibility for popups with many options and/or varying options. It acts identically to QMenu, with the addition of setKeyboardShortcutsEnabled() and setKeyboardShortcutsExecute() methods.
The keyboard search algorithm is incremental with additional underlining for user feedback.
- Author
- Daniel M. Duley mosfe.nosp@m.t@kd.nosp@m.e.org
-
Hamish Rodda rodda.nosp@m.@kde.nosp@m..org
Definition at line 42 of file kmenu.h.
KMenu::KMenu |
( |
QWidget * |
parent = 0L | ) |
|
|
explicit |
Constructs a KMenu.
- Parameters
-
title | The text displayed in a parent menu when it is inserted into another menu as a submenu. |
parent | the parent QWidget object |
Definition at line 158 of file kmenu.cpp.
Destructs the object.
Definition at line 165 of file kmenu.cpp.
void KMenu::aboutToShowContextMenu |
( |
KMenu * |
menu, |
|
|
QAction * |
menuAction, |
|
|
QMenu * |
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 |
menuAction | The action that the context menu is currently on |
ctxMenu | The context menu itself |
Inserts a title item with no icon.
Definition at line 170 of file kmenu.cpp.
Inserts a title item with the given icon and title.
Definition at line 175 of file kmenu.cpp.
void KMenu::closeEvent |
( |
QCloseEvent * |
e | ) |
|
|
protectedvirtual |
This is re-implemented for keyboard navigation.
Definition at line 200 of file kmenu.cpp.
QMenu * KMenu::contextMenu |
( |
| ) |
|
Returns the context menu associated with this menu The data property of all actions inserted into the context menu is modified all the time to point to the action and menu it has been shown for.
Definition at line 467 of file kmenu.cpp.
const QMenu * KMenu::contextMenu |
( |
| ) |
const |
Returns the context menu associated with this menu.
Definition at line 478 of file kmenu.cpp.
void KMenu::contextMenuEvent |
( |
QContextMenuEvent * |
e | ) |
|
|
protectedvirtual |
KMenu * KMenu::contextMenuFocus |
( |
| ) |
|
|
static |
Returns the KMenu associated with the current context menu.
Definition at line 546 of file kmenu.cpp.
QAction * KMenu::contextMenuFocusAction |
( |
| ) |
|
|
static |
returns the QAction associated with the current context menu
Definition at line 551 of file kmenu.cpp.
bool KMenu::focusNextPrevChild |
( |
bool |
next | ) |
|
|
protectedvirtual |
void KMenu::hideContextMenu |
( |
| ) |
|
Hides the context menu if shown.
Definition at line 483 of file kmenu.cpp.
void KMenu::hideEvent |
( |
QHideEvent * |
e | ) |
|
|
protectedvirtual |
Qt::KeyboardModifiers KMenu::keyboardModifiers |
( |
| ) |
const |
Return the state of the keyboard modifiers when the last menuitem was activated.
Definition at line 212 of file kmenu.cpp.
void KMenu::keyPressEvent |
( |
QKeyEvent * |
e | ) |
|
|
protectedvirtual |
Qt::MouseButtons KMenu::mouseButtons |
( |
| ) |
const |
Return the state of the mouse buttons when the last menuitem was activated.
Definition at line 207 of file kmenu.cpp.
void KMenu::mousePressEvent |
( |
QMouseEvent * |
e | ) |
|
|
protectedvirtual |
End keyboard navigation.
RMB menus on menus
Definition at line 429 of file kmenu.cpp.
void KMenu::mouseReleaseEvent |
( |
QMouseEvent * |
e | ) |
|
|
protectedvirtual |
void KMenu::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.
-
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. In addition, where text already contains ampersands, the underline produced is likely to confuse the user (as this feature uses underlining of text to indicate the current key selection sequence).
Definition at line 412 of file kmenu.cpp.
void KMenu::setKeyboardShortcutsExecute |
( |
bool |
enable | ) |
|
Enables execution of the menu item once it is uniquely specified.
Defaults to off.
Definition at line 417 of file kmenu.cpp.
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:17 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.