KActionMenu
#include <KActionMenu>

Properties | |
bool | delayed |
QToolButton::ToolButtonPopupMode | popupMode |
bool | stickyMenu |
![]() | |
autoRepeat | |
checkable | |
checked | |
enabled | |
font | |
icon | |
iconText | |
iconVisibleInMenu | |
menuRole | |
priority | |
shortcut | |
shortcutContext | |
shortcutVisibleInContextMenu | |
statusTip | |
text | |
toolTip | |
visible | |
whatsThis | |
![]() | |
objectName | |
Public Member Functions | |
KActionMenu (const QIcon &icon, const QString &text, QObject *parent) | |
KActionMenu (const QString &text, QObject *parent) | |
KActionMenu (QObject *parent) | |
void | addAction (QAction *action) |
QAction * | addSeparator () |
QWidget * | createWidget (QWidget *parent) override |
bool | delayed () const |
void | insertAction (QAction *before, QAction *action) |
QAction * | insertSeparator (QAction *before) |
QMenu * | popupMenu () |
QToolButton::ToolButtonPopupMode | popupMode () const |
void | remove (QAction *) |
void | removeAction (QAction *action) |
void | setDelayed (bool delayed) |
void | setPopupMode (QToolButton::ToolButtonPopupMode popupMode) |
void | setStickyMenu (bool sticky) |
bool | stickyMenu () const |
![]() | |
QWidgetAction (QObject *parent) | |
QWidget * | defaultWidget () const const |
void | releaseWidget (QWidget *widget) |
QWidget * | requestWidget (QWidget *parent) |
void | setDefaultWidget (QWidget *widget) |
![]() | |
QAction (const QIcon &icon, const QString &text, QObject *parent) | |
QAction (const QString &text, QObject *parent) | |
QAction (QObject *parent) | |
QActionGroup * | actionGroup () const const |
void | activate (QAction::ActionEvent event) |
QList< QGraphicsWidget * > | associatedGraphicsWidgets () const const |
QList< QWidget * > | associatedWidgets () const const |
bool | autoRepeat () const const |
void | changed () |
QVariant | data () const const |
QFont | font () const const |
void | hover () |
void | hovered () |
QIcon | icon () const const |
QString | iconText () const const |
bool | isCheckable () const const |
bool | isChecked () const const |
bool | isEnabled () const const |
bool | isIconVisibleInMenu () const const |
bool | isSeparator () const const |
bool | isShortcutVisibleInContextMenu () const const |
bool | isVisible () const const |
QMenu * | menu () const const |
QAction::MenuRole | menuRole () const const |
QWidget * | parentWidget () const const |
QAction::Priority | priority () const const |
void | setActionGroup (QActionGroup *group) |
void | setAutoRepeat (bool) |
void | setCheckable (bool) |
void | setChecked (bool) |
void | setData (const QVariant &userData) |
void | setDisabled (bool b) |
void | setEnabled (bool) |
void | setFont (const QFont &font) |
void | setIcon (const QIcon &icon) |
void | setIconText (const QString &text) |
void | setIconVisibleInMenu (bool visible) |
void | setMenu (QMenu *menu) |
void | setMenuRole (QAction::MenuRole menuRole) |
void | setPriority (QAction::Priority priority) |
void | setSeparator (bool b) |
void | setShortcut (const QKeySequence &shortcut) |
void | setShortcutContext (Qt::ShortcutContext context) |
void | setShortcuts (const QList< QKeySequence > &shortcuts) |
void | setShortcuts (QKeySequence::StandardKey key) |
void | setShortcutVisibleInContextMenu (bool show) |
void | setStatusTip (const QString &statusTip) |
void | setText (const QString &text) |
void | setToolTip (const QString &tip) |
void | setVisible (bool) |
void | setWhatsThis (const QString &what) |
QKeySequence | shortcut () const const |
Qt::ShortcutContext | shortcutContext () const const |
QList< QKeySequence > | shortcuts () const const |
bool | showStatusText (QWidget *widget) |
QString | statusTip () const const |
QString | text () const const |
void | toggle () |
void | toggled (bool checked) |
QString | toolTip () const const |
void | trigger () |
void | triggered (bool checked) |
QString | whatsThis () const const |
![]() | |
QObject (QObject *parent) | |
bool | blockSignals (bool block) |
const QObjectList & | children () const const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectInfo () |
void | dumpObjectInfo () const const |
void | dumpObjectTree () |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () const const |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegExp ®Exp, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_DISABLE_COPY (Class) | |
Q_DISABLE_COPY_MOVE (Class) | |
Q_DISABLE_MOVE (Class) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_OBJECT Q_OBJECT | |
Q_PROPERTY (...) | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
Q_SIGNAL Q_SIGNAL | |
Q_SIGNALS Q_SIGNALS | |
Q_SLOT Q_SLOT | |
Q_SLOTS Q_SLOTS | |
T | qFindChild (const QObject *obj, const QString &name) |
QList< T > | qFindChildren (const QObject *obj, const QRegExp ®Exp) |
QList< T > | qFindChildren (const QObject *obj, const QString &name) |
T | qobject_cast (const QObject *object) |
T | qobject_cast (QObject *object) |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds time, Qt::TimerType timerType) |
QThread * | thread () const const |
Additional Inherited Members | |
![]() | |
enum | ActionEvent |
enum | MenuRole |
enum | Priority |
![]() | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
![]() | |
AboutQtRole | |
AboutRole | |
ApplicationSpecificRole | |
HighPriority | |
Hover | |
LowPriority | |
NormalPriority | |
NoRole | |
PreferencesRole | |
QuitRole | |
TextHeuristicRole | |
Trigger | |
![]() | |
typedef | QObjectList |
![]() | |
QList< QWidget * > | createdWidgets () const const |
virtual void | deleteWidget (QWidget *widget) |
virtual bool | event (QEvent *event) override |
virtual bool | eventFilter (QObject *obj, QEvent *event) override |
![]() | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Detailed Description
A KActionMenu is an action that provides a sub-menu of other actions.
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.
Definition at line 38 of file kactionmenu.h.
Member Function Documentation
◆ addAction()
void KActionMenu::addAction | ( | QAction * | action | ) |
Adds action
to this KActionMenu.
The KActionMenu does not take ownership of action
.
Definition at line 98 of file kactionmenu.cpp.
◆ delayed()
bool KActionMenu::delayed | ( | ) | const |
Returns true if this action creates a delayed popup menu when plugged in a KToolBar.
- Deprecated:
- Since 5.77, use popupMode() instead.
◆ popupMenu()
|
inline |
Returns this action's menu as a KMenu, if it is one.
If none exists, one will be created.
- Deprecated:
- Since 5.0, use menu() instead.
Definition at line 78 of file kactionmenu.h.
◆ popupMode()
QToolButton::ToolButtonPopupMode KActionMenu::popupMode | ( | ) | const |
◆ remove()
void KActionMenu::remove | ( | QAction * | cmd | ) |
- Deprecated:
- Since 5.0.
Definition at line 90 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: true
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.
- Deprecated:
- Since 5.77, use setPopupMode() instead.
Definition at line 137 of file kactionmenu.cpp.
◆ setPopupMode()
void KActionMenu::setPopupMode | ( | QToolButton::ToolButtonPopupMode | popupMode | ) |
Determines the popup mode when plugged in a KToolBar.
Options are:
- QToolButton::InstantPopup Clicking anywhere on the toolbar button opens the popup menu.
- QToolButton::DelayedPopup (Default) Clicking anywhere on the toolbar button triggers the default action. Clicking and holding the toolbar button opens the popup menu instead.
- QToolButton::MenuButtonPopup The toolbar button is split in a main button (triggers default action) and an arrow button (opens the popup menu).
- See also
- QToolButton
- Since
- 5.77
Definition at line 184 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.
- Deprecated:
- Since 5.77, use setPopupMode() instead.
Definition at line 165 of file kactionmenu.cpp.
◆ stickyMenu()
bool KActionMenu::stickyMenu | ( | ) | const |
Returns true if this action creates a sticky popup menu.
- See also
- setStickyMenu().
- Deprecated:
- Since 5.77, use popupMode() instead.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Oct 1 2023 04:00:54 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.