- Extending Qt Creator Manual
- QtCreator
- ActionBuilder
- Extending Qt Creator Manual 21.0.0-beta1

# Core::ActionBuilder Class

class Core::ActionBuilder

The ActionBuilder class is convienience class to set up Core::Commands. More...

Header: | `#include <coreplugin/actionmanager/actionmanager.h>`

- List of all members, including inherited members

## Public Functions

| ActionBuilder(QObject *contextActionParent, const int actionId)
| ~ActionBuilder()
Core::ActionBuilder & | setIconText(const QString &iconText)
Core::ActionBuilder & | setText(const QString &text)

## Detailed Description

An action builder specifies properties of a `Core::Command` and a context action and uses ActionManager::registerAction() in its destructor to actually register the action for a set Core::Context for the Command.

## Member Function Documentation

### ActionBuilder::ActionBuilder(QObject *contextActionParent, const int actionId)

Constructs an action builder for an action with the Id actionId.

The contextActionParent is used to provide a QObject parent for the internally constructed QAction object to control its life time.

This is typically the `this` pointer of the entity using `ActionBuilder`.

### `[noexcept]` ActionBuilder::~ActionBuilder()

Registers the created action with the set properties.

See also ActionManager::registerAction().

### Core::ActionBuilder &ActionBuilder::setIconText(const QString &iconText)

Sets the `iconText` property of the action under construction to iconText.

See also QAction::setIconText().

### Core::ActionBuilder &ActionBuilder::setText(const QString &text)

Sets the `text` property of the action under construction to text.

See also QAction::setText().