PathChooser Class | Extending Qt Creator Manual
Description: The PathChooser class is a control that lets the user choose a path. The control consist of a QLineEdit and a "Browse" button, and is optionally able to perform variable substitution.

- Extending Qt Creator Manual
- QtCreator
- PathChooser
- Extending Qt Creator Manual 13.0.1

# PathChooser Class

class Utils::PathChooser

The PathChooser class is a control that lets the user choose a path. The control consist of a QLineEdit and a "Browse" button, and is optionally able to perform variable substitution. More...

Header: | #include <PathChooser>
Inherits: | QWidget

- List of all members, including inherited members

## Public Types

enum | Kind { ExistingDirectory, Directory, File, SaveFile, ExistingCommand, …, Any }

## Public Functions

Utils::FilePath | baseDirectory() const
QStringList | commandVersionArguments() const
Utils::PathChooser::Kind | expectedKind() const
Utils::FilePath | filePath() const
bool | isReadOnly() const
QString | promptDialogFilter() const
QString | promptDialogTitle() const
void | setBaseDirectory(const Utils::FilePath &base)
void | setCommandVersionArguments(const QStringList &arguments)
void | setExpectedKind(Utils::PathChooser::Kind expected)
void | setPromptDialogFilter(const QString &filter)
void | setPromptDialogTitle(const QString &title)
void | setReadOnly(bool b)

## Public Slots

void | setFilePath(const Utils::FilePath &)
void | setPath(const QString &)

## Signals

void | textChanged(const QString &text)

## Detailed Description

This class has some validation logic for embedding into QWizardPage.

## Member Type Documentation

### enum PathChooser::Kind

The Kind enum describes the kind of path a PathChooser considers valid.

Constant | Value | Description
--- | --- | ---
`Utils::PathChooser::ExistingDirectory` | `0` | An existing directory
`Utils::PathChooser::Directory` | `1` | A directory that does not need to exist
`Utils::PathChooser::File` | `2` | An existing file
`Utils::PathChooser::SaveFile` | `3` | A file that does not need to exist
`Utils::PathChooser::ExistingCommand` | `4` | An executable file that must exist at the time of selection
`Utils::PathChooser::Command` | `5` | An executable file that may or may not exist at the time of selection (e.g. result of a build)
`Utils::PathChooser::Any` | `6` | No restriction on the selected path

See also setExpectedKind() and expectedKind().

## Member Function Documentation

### Utils::PathChooser::Kind PathChooser::expectedKind() const

Returns the kind of path the PathChooser considers valid to select.

Note: Getter function for property expectedKind.

See also Utils::PathChooser::Kind and setExpectedKind().

### void PathChooser::setExpectedKind(Utils::PathChooser::Kind expected)

Sets the kind of path the PathChooser will consider valid to select to expected.

Note: Setter function for property expectedKind.

See also Utils::PathChooser::Kind and expectedKind().