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

Public Functions

Utils::FilePath effectiveBinary() const
void makeCheckable(Utils::CheckBoxPlacement checkBoxPlacement, const QString &checkerLabel, const Utils::Key &checkerKey)
void setExpectedKind(const Utils::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

Utils::FilePath FilePathAspect::effectiveBinary() const

Returns the full path of the set command. Only makes a difference if expected kind is Command or ExistingCommand and the current file path is an executable provided without its path. Performs a lookup in PATH if necessary.

[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 Utils::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 filePath.

If howToAnnounce is set to DoEmit, emits the valueChanged signal.

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.