KDEUI
#include <kactionmenu.h>

Public Member Functions | |
KActionMenu (const KIcon &icon, const QString &text, QObject *parent) | |
KActionMenu (const QString &text, QObject *parent) | |
KActionMenu (QObject *parent) | |
virtual | ~KActionMenu () |
void | addAction (QAction *action) |
QAction * | addSeparator () |
virtual QWidget * | createWidget (QWidget *parent) |
bool | delayed () const |
void | insertAction (QAction *before, QAction *action) |
QAction * | insertSeparator (QAction *before) |
KMenu * | menu () |
KMenu * | popupMenu () |
void | remove (KAction *) |
void | removeAction (QAction *action) |
void | setDelayed (bool delayed) |
void | setMenu (KMenu *menu) |
void | setStickyMenu (bool sticky) |
bool | stickyMenu () const |
![]() | |
KAction (const KIcon &icon, const QString &text, QObject *parent) | |
KAction (const QString &text, QObject *parent) | |
KAction (QObject *parent) | |
virtual | ~KAction () |
KAuth::Action * | authAction () const |
bool | event (QEvent *) |
void | forgetGlobalShortcut () |
const KShortcut & | globalShortcut (ShortcutTypes type=ActiveShortcut) const |
bool | globalShortcutAllowed () const |
bool | isGlobalShortcutEnabled () const |
bool | isShortcutConfigurable () const |
KRockerGesture | rockerGesture (ShortcutTypes type=ActiveShortcut) const |
void | setAuthAction (const QString &actionName) |
void | setAuthAction (KAuth::Action *action) |
void | setGlobalShortcut (const KShortcut &shortcut, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut), GlobalShortcutLoading loading=Autoloading) |
void | setGlobalShortcutAllowed (bool allowed, GlobalShortcutLoading loading=Autoloading) |
void | setHelpText (const QString &text) |
void | setRockerGesture (const KRockerGesture &gest, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut)) |
void | setShapeGesture (const KShapeGesture &gest, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut)) |
void | setShortcut (const KShortcut &shortcut, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut)) |
void | setShortcut (const QKeySequence &shortcut, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut)) |
void | setShortcutConfigurable (bool configurable) |
void | setShortcuts (const QList< QKeySequence > &shortcuts, ShortcutTypes type=ShortcutTypes(ActiveShortcut|DefaultShortcut)) |
KShapeGesture | shapeGesture (ShortcutTypes type=ActiveShortcut) const |
KShortcut | shortcut (ShortcutTypes types=ActiveShortcut) const |
Properties | |
bool | delayed |
bool | stickyMenu |
![]() | |
KShortcut | globalShortcut |
bool | globalShortcutAllowed |
bool | globalShortcutEnabled |
KShortcut | shortcut |
bool | shortcutConfigurable |
Additional Inherited Members | |
![]() | |
enum | GlobalShortcutLoading { Autoloading = 0x0 , NoAutoloading = 0x4 } |
enum | ShortcutType { ActiveShortcut = 0x1 , DefaultShortcut = 0x2 } |
![]() | |
void | authorized (KAuth::Action *action) |
void | globalShortcutChanged (const QKeySequence &) |
void | triggered (Qt::MouseButtons buttons, Qt::KeyboardModifiers modifiers) |
Detailed Description
A KActionMenu is an action that has several properties specific to holding a sub-menu of other actions.
Any QAction can be used to create a submenu.
Plugged in a popupmenu, it will create a submenu. Plugged in a toolbar, it will create a button with a popup menu.
This is the action used by the XMLGUI since it holds other actions. If you want a submenu for selecting one tool among many (without icons), see KSelectAction. See also setDelayed about the main action.
Definition at line 47 of file kactionmenu.h.
Constructor & Destructor Documentation
◆ KActionMenu() [1/3]
|
explicit |
Definition at line 52 of file kactionmenu.cpp.
◆ KActionMenu() [2/3]
KActionMenu::KActionMenu | ( | const QString & | text, |
QObject * | parent | ||
) |
Definition at line 59 of file kactionmenu.cpp.
◆ KActionMenu() [3/3]
Definition at line 67 of file kactionmenu.cpp.
◆ ~KActionMenu()
|
virtual |
Definition at line 74 of file kactionmenu.cpp.
Member Function Documentation
◆ addAction()
void KActionMenu::addAction | ( | QAction * | action | ) |
Definition at line 115 of file kactionmenu.cpp.
◆ addSeparator()
QAction * KActionMenu::addSeparator | ( | ) |
Definition at line 120 of file kactionmenu.cpp.
◆ createWidget()
Definition at line 80 of file kactionmenu.cpp.
◆ delayed()
bool KActionMenu::delayed | ( | ) | const |
Returns true if this action creates a delayed popup menu when plugged in a KToolBar.
Definition at line 146 of file kactionmenu.cpp.
◆ insertAction()
Definition at line 136 of file kactionmenu.cpp.
◆ insertSeparator()
Definition at line 128 of file kactionmenu.cpp.
◆ menu()
KMenu * KActionMenu::menu | ( | ) |
Returns this action's menu as a KMenu, if it is one.
If none exists, one will be created.
Definition at line 162 of file kactionmenu.cpp.
◆ popupMenu()
|
inline |
Returns this action's menu as a KMenu, if it is one.
If none exists, one will be created.
- Deprecated:
- use menu() instead.
Definition at line 78 of file kactionmenu.h.
◆ remove()
void KActionMenu::remove | ( | KAction * | cmd | ) |
Definition at line 108 of file kactionmenu.cpp.
◆ removeAction()
void KActionMenu::removeAction | ( | QAction * | action | ) |
Definition at line 141 of file kactionmenu.cpp.
◆ setDelayed()
void KActionMenu::setDelayed | ( | bool | delayed | ) |
If set to true, this action will create a delayed popup menu when plugged in a KToolBar.
Otherwise it creates a normal popup. Default: delayed
Remember that if the "main" action (the toolbar button itself) cannot be clicked, then you should call setDelayed(false).
In the other case, if the main action can be clicked, it can only happen in a toolbar: in a menu, the parent of a submenu can't be activated. To get a "normal" menu item when plugged a menu (and no submenu) use KToolBarPopupAction.
Definition at line 150 of file kactionmenu.cpp.
◆ setMenu()
void KActionMenu::setMenu | ( | KMenu * | menu | ) |
Definition at line 170 of file kactionmenu.cpp.
◆ setStickyMenu()
void KActionMenu::setStickyMenu | ( | bool | sticky | ) |
If set to true, this action will create a sticky popup menu when plugged in a KToolBar.
"Sticky", means it's visible until a selection is made or the mouse is clicked elsewhere. This feature allows you to make a selection without having to press and hold down the mouse while making a selection. Default: sticky.
Definition at line 158 of file kactionmenu.cpp.
◆ stickyMenu()
bool KActionMenu::stickyMenu | ( | ) | const |
Returns true if this action creates a sticky popup menu.
- See also
- setStickyMenu().
Definition at line 154 of file kactionmenu.cpp.
Property Documentation
◆ delayed
|
readwrite |
Definition at line 1 of file kactionmenu.h.
◆ stickyMenu
|
readwrite |
Definition at line 1 of file kactionmenu.h.
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.