CustomWizardContext Class | Extending Qt Creator Manual

Extending Qt Creator Manual | CustomWizardContext

Extending Qt Creator Manual 4.7.2

# CustomWizardContext Class

(ProjectExplorer::Internal::CustomWizardContext)

The CustomWizardContext class provides the context for one custom wizard run. More...

Header: | #include <CustomWizardContext>

- List of all members, including inherited members

## Public Types

typedef | FieldReplacementMap
typedef | TemporaryFilePtr
typedef | TemporaryFilePtrList

## Public Functions

void | reset()

## Static Public Members

int | processFile(const ProjectExplorer::Internal::CustomWizardContext::FieldReplacementMap &, int)
bool | replaceFields(const ProjectExplorer::Internal::CustomWizardContext::FieldReplacementMap &fm, int *s)
bool | replaceFields(const ProjectExplorer::Internal::CustomWizardContext::FieldReplacementMap &fm, int *s, ProjectExplorer::Internal::CustomWizardContext::TemporaryFilePtrList *files)

## Detailed Description

The CustomWizardContext class provides the context for one custom wizard run.

Shared between CustomWizard and the CustomWizardPage as it is used for the QLineEdit-type fields' default texts as well. Contains basic replacement fields like `'%CppSourceSuffix%'`, `'%CppHeaderSuffix%'` (settings-dependent). reset() should be called before each wizard run to refresh them. CustomProjectWizard additionally inserts `'%ProjectName%'` from the intro page to have it available for default texts.

See also ProjectExplorer::CustomWizard.

## Member Type Documentation

### typedef CustomWizardContext::FieldReplacementMap

### typedef CustomWizardContext::TemporaryFilePtr

### typedef CustomWizardContext::TemporaryFilePtrList

## Member Function Documentation

### `[static]` int CustomWizardContext::processFile(const ProjectExplorer::Internal::CustomWizardContext::FieldReplacementMap &, int)

### `[static]` bool CustomWizardContext::replaceFields(const ProjectExplorer::Internal::CustomWizardContext::FieldReplacementMap &fm, int *s)

Replaces field values delimited by '%' with special modifiers:

- %Field% -> simple replacement
- %Field:l% -> replace with everything changed to lower case
- %Field:u% -> replace with everything changed to upper case
- %Field:c% -> replace with first character capitalized
- %Field:h% -> replace with something usable as header guard
- %Field:s% -> replace with something usable as structure or class name

The return value indicates whether non-empty replacements were encountered.

### `[static]` bool CustomWizardContext::replaceFields(const ProjectExplorer::Internal::CustomWizardContext::FieldReplacementMap &fm, int *s, ProjectExplorer::Internal::CustomWizardContext::TemporaryFilePtrList *files)

This function is a special replaceFields() overload used for the arguments of a generator script.

Writes the expanded field values out to temporary files specified by files and inserts file names instead of the expanded fields in the string s.

### void CustomWizardContext::reset()