KDEUI
#include <kmenu.h>

Signals | |
void | aboutToShowContextMenu (KMenu *menu, QAction *menuAction, QMenu *ctxMenu) |
Public Member Functions | |
KMenu (const QString &title, QWidget *parent=0L) | |
KMenu (QWidget *parent=0L) | |
~KMenu () | |
QAction * | addTitle (const QIcon &icon, const QString &text, QAction *before=0L) |
QAction * | addTitle (const QString &text, QAction *before=0L) |
QMenu * | contextMenu () |
const QMenu * | contextMenu () const |
void | hideContextMenu () |
Qt::KeyboardModifiers | keyboardModifiers () const |
Qt::MouseButtons | mouseButtons () const |
void | setKeyboardShortcutsEnabled (bool enable) |
void | setKeyboardShortcutsExecute (bool enable) |
Static Public Member Functions | |
static KMenu * | contextMenuFocus () |
static QAction * | contextMenuFocusAction () |
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) |
Detailed Description
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.
Constructor & Destructor Documentation
◆ KMenu() [1/2]
|
explicit |
◆ KMenu() [2/2]
|
explicit |
◆ ~KMenu()
Member Function Documentation
◆ aboutToShowContextMenu
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
◆ addTitle() [1/2]
◆ addTitle() [2/2]
◆ closeEvent()
|
protectedvirtual |
◆ contextMenu() [1/2]
QMenu * KMenu::contextMenu | ( | ) |
◆ contextMenu() [2/2]
const QMenu * KMenu::contextMenu | ( | ) | const |
◆ contextMenuEvent()
|
protectedvirtual |
◆ contextMenuFocus()
|
static |
◆ contextMenuFocusAction()
|
static |
◆ focusNextPrevChild()
|
protectedvirtual |
◆ hideContextMenu()
void KMenu::hideContextMenu | ( | ) |
◆ hideEvent()
◆ keyboardModifiers()
Qt::KeyboardModifiers KMenu::keyboardModifiers | ( | ) | const |
◆ keyPressEvent()
|
protectedvirtual |
◆ mouseButtons()
Qt::MouseButtons KMenu::mouseButtons | ( | ) | const |
◆ mousePressEvent()
|
protectedvirtual |
◆ mouseReleaseEvent()
|
protectedvirtual |
◆ setKeyboardShortcutsEnabled()
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).
◆ setKeyboardShortcutsExecute()
void KMenu::setKeyboardShortcutsExecute | ( | bool | enable | ) |
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.