PathChooser 类

class Utils::PathChooser

PathChooser 类是一个允许用户选择路径的控制组件。该控件由一个 QLineEdit 和一个“浏览”按钮组成,并且可以可选地执行变量替换。 更多...

头文件 #include <PathChooser>
继承 QWidget

公共类型

枚举 Kind { ExistingDirectory, Directory, File, SaveFile, ExistingCommand, …, Any }

公共函数

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)

公共槽

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

信号

void textChanged (const QString &text)

详细描述

此类包含了一些用于嵌入到 QWizardPage 的验证逻辑。

成员类型文档

enum PathChooser::Kind

Kind 枚举描述了 PathChooser 认可的有效路径类型。

常量描述
Utils::PathChooser::ExistingDirectory0已存在的目录
Utils::PathChooser::Directory1不需要存在的目录
Utils::PathChooser::File2已存在的文件
Utils::PathChooser::SaveFile3不需要存在的文件
Utils::PathChooser::ExistingCommand4必须在选择时存在的可执行文件
Utils::PathChooser::Command5在选择时可能或可能不存在的可执行文件(例如,构建的结果)
Utils::PathChooser::Any6对选择的路径没有限制

另请参阅 setExpectedKind() 和 expectedKind

成员函数文档

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

返回PathChooser认为是有效选择路径的类型。

注意:expectedKind属性的获取器函数。

另请参阅:Utils::PathChooser::KindsetExpectedKind

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

设置PathChooser将考虑为有效选择路径的类型为expected

注意:expectedKind属性的设置器函数。

另请参阅:Utils::PathChooser::KindexpectedKind

©2024 The Qt Company Ltd. 本文档中包含的贡献是各自所有者的版权。本提供的文档是根据由自由软件基金会发布的GNU自由文档许可证版本1.3的条款许可的。Qt及其相应的商标是芬兰和/或其他国家的Qt公司的商标。所有其他商标属于其各自所有者。