- Extending Qt Creator Manual
- QtCreator
- FilePathAspect
- Extending Qt Creator Manual 13.0.0

# FilePathAspect Class

class Utils::FilePathAspect

A file path aspect is shallow wrapper around a Utils::StringAspect that represents a file in the file system. More...

Header: | #include <FilePathAspect>
Inherits: | Utils::TypedAspect

- List of all members, including inherited members

## Public Functions

void | makeCheckable(Utils::CheckBoxPlacement checkBoxPlacement, const QString &checkerLabel, const Utils::Key &checkerKey)
void | setExpectedKind(const PathChooser::Kind expectedKind)
void | setValue(const Utils::FilePath &filePath, Utils::BaseAspect::Announcement howToAnnounce = DoEmit)
Utils::FilePath | operator()() const

## Reimplemented Public Functions

virtual void | fromMap(const Utils::Store &map) override
virtual void | toMap(Utils::Store &map) const override

## Detailed Description

It is displayed by default using Utils::PathChooser.

The visual representation often contains a label in front of the display of the actual value.

See also Utils::StringAspect.

## Member Function Documentation

### `[override virtual]` void FilePathAspect::fromMap(const Utils::Store &map)

Reimplements: BaseAspect::fromMap(const Utils::Store &map).

### void FilePathAspect::makeCheckable(Utils::CheckBoxPlacement checkBoxPlacement, const QString &checkerLabel, const Utils::Key &checkerKey)

Adds a check box with a checkerLabel according to checkBoxPlacement to the line edit.

The state of the check box is made persistent when using a non-emtpy checkerKey.

### void FilePathAspect::setExpectedKind(const PathChooser::Kind expectedKind)

Sets expectedKind as expected kind for path chooser displays.

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

### void FilePathAspect::setValue(const Utils::FilePath &filePath, Utils::BaseAspect::Announcement howToAnnounce = DoEmit)

Sets the value of this file path aspect to value.

Note: This does not use any check that the value is actually a file path.

### `[override virtual]` void FilePathAspect::toMap(Utils::Store &map) const

Reimplements: BaseAspect::toMap(Utils::Store &map) const.

### Utils::FilePath FilePathAspect::operator()() const

Returns the value of this aspect as `Utils::FilePath`.

Note: This simply uses `FilePath::fromUserInput()` for the conversion. It does not use any check that the value is actually a valid file path.