Extending Qt Creator Manual | ParameterAction

Extending Qt Creator Manual 4.6.1

# ParameterAction Class

(Utils::ParameterAction)

The ParameterAction class is intended for actions that act on a 'current', string-type parameter (typically a file name), for example 'Save file %1'. More...

Header: | #include <ParameterAction>

- List of all members, including inherited members

## Public Types

enum | EnablingMode { AlwaysEnabled, EnabledWithParameter }

## Properties

- emptyText : QString
- enablingMode : EnablingMode
- parameterText : QString

## Public Functions

| ParameterAction(const QString &emptyText, const QString &parameterText, EnablingMode em = AlwaysEnabled, QObject *parent = 0)
QString | emptyText() const
EnablingMode | enablingMode() const
QString | parameterText() const
void | setEmptyText(const QString &)
void | setEnablingMode(EnablingMode m)
void | setParameterText(const QString &)

## Public Slots

void | setParameter(const QString &)

## Detailed Description

The ParameterAction class is intended for actions that act on a 'current', string-type parameter (typically a file name), for example 'Save file %1'.

The action has 2 states:

- <no current parameter> displaying "Do XX" (empty text)
- <parameter present> displaying "Do XX with %1".

Provides a slot to set the parameter, changing display and enabled state accordingly. The text passed in should already be translated; parameterText should contain a %1 where the parameter is to be inserted.

## Member Type Documentation

### enum ParameterAction::EnablingMode

## Property Documentation

### emptyText : QString

Access functions:

QString | emptyText() const
void | setEmptyText(const QString &)

### enablingMode : EnablingMode

Access functions:

EnablingMode | enablingMode() const
void | setEnablingMode(EnablingMode m)

### parameterText : QString

Access functions:

QString | parameterText() const
void | setParameterText(const QString &)

## Member Function Documentation

### ParameterAction::ParameterAction(const QString &emptyText, const QString &parameterText, EnablingMode em = AlwaysEnabled, QObject *parent = 0)

Default constructs an instance of ParameterAction.

### `[slot]` void ParameterAction::setParameter(const QString &)