Pages
API Documentation
On this page

KActionMenu Class

A KActionMenu is an action that provides a sub-menu of other actions. More...

  • Header: #include <KActionMenu>
  • CMake: find_package(KF6 REQUIRED COMPONENTS WidgetsAddons)
    target_link_libraries(mytarget PRIVATE KF6::WidgetsAddons)
  • Inherits: QWidgetAction

List of all members, including inherited members

Properties

Public Functions

Detailed Description

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.

Property Documentation

popupMode : QToolButton::ToolButtonPopupMode

Access functions:

  • QToolButton::ToolButtonPopupMode popupMode() const
  • void setPopupMode(QToolButton::ToolButtonPopupMode popupMode)

Member Function Documentation

[explicit] KActionMenu::KActionMenu(QObject *parent)

KActionMenu::KActionMenu(const QString &text, QObject *parent)

KActionMenu::KActionMenu(const QIcon &icon, const QString &text, QObject *parent)

void KActionMenu::addAction(QAction *action)

Adds action to this KActionMenu. The KActionMenu does not take ownership of action.

QAction *KActionMenu::addSeparator()

void KActionMenu::insertAction(QAction *before, QAction *action)

QAction *KActionMenu::insertSeparator(QAction *before)

QToolButton::ToolButtonPopupMode KActionMenu::popupMode() const

The currently used popup mode when plugged in a KToolBar.

Note: Getter function for property popupMode.

See also setPopupMode()

void KActionMenu::removeAction(QAction *action)

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).

Note: Setter function for property popupMode.

See also popupMode(), QToolButton

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.