FilePathAspect 类

class Utils::FilePathAspect

FilePathAspect 是对 Utils::StringAspect 的包装,用于表示文件系统中的文件。了解更多...

头文件 #include <FilePathAspect>
继承 Utils::TypedAspect

公共函数

Utils::FilePatheffectiveBinary() const
voidmakeCheckable(Utils::CheckBoxPlacement checkBoxPlacement, const QString &checkerLabel, const Utils::Key &checkerKey)
voidsetExpectedKind(const Utils::PathChooser::Kind expectedKind)
voidsetValue(const Utils::FilePath &filePath, Utils::BaseAspect::Announcement howToAnnounce = DoEmit)
Utils::FilePathoperator()() const

重实现的公共函数

virtual voidfromMap(const Utils::Store &map) override
virtual voidtoMap(Utils::Store &map) const override

详细描述

它默认使用 Utils::PathChooser 显示。

视觉表示通常包含一个标签,显示实际值之前。

另请参阅Utils::StringAspect.

成员函数文档

Utils::FilePath FilePathAspect::effectiveBinary() const

返回设置命令的完整路径。只有当预期类型是 CommandExistingCommand,并且当前文件路径是未提供路径的执行文件时才有意义。如果需要,则执行 PATH 中的查找。

[覆盖虚拟] void FilePathAspect::fromMap(const Utils::Store &map)

重实现: BaseAspect::fromMap(const Utils::Store &map).

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

根据 checkBoxPlacement 在行编辑器中添加一个带有 checkerLabel 的复选框。

当使用非空 checkerKey 时,复选框的状态被持久化。

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

expectedKind 设置为路径选择器显示的预期类型。

另请参阅Utils::PathChooser::setExpectedKind().

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

将此文件路径方面的值设置为 filePath

如果 howToAnnounce 设置为 DoEmit,则发出 valueChanged 信号。

注意:此函数不会对值是否实际上是文件路径进行任何检查。

[覆盖虚函数] void FilePathAspect::toMap(Utils::Store &map) const

重新实现了: BaseAspect::toMap(Utils::Store &map) const

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

返回此方面的值作为 Utils::FilePath

注意:此仅使用 FilePath::fromUserInput() 进行转换。它不会对值是否实际上是有效的文件路径进行检查。

©2024 Qt公司。本文件中包含的文档贡献是各自所有者的版权。本文件中提供的文档受GNU自由文档许可证版本1.3的条款许可,该许可证由自由软件基金会发布。Qt及其相关标志是Qt公司在芬兰及/或世界其他国家的商标。所有其他商标均为其各自所有者的财产。