Utils::PathChooser Class
class Utils::PathChooserPathChooser 类是一个允许用户选择路径的控件。该控件由一个QLineEdit 和一个“浏览”按钮组成,并可选地支持变量替换。更多内容...
| Header: | #include <PathChooser> |
公共类型
| enum | 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::Lazy<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::ExistingDirectory | 0 | 已存在的目录 |
Utils::PathChooser::Directory | 1 | 一个无需存在的目录 |
Utils::PathChooser::File | 2 | 已存在的文件 |
Utils::PathChooser::SaveFile | 3 | 一个无需存在的文件 |
Utils::PathChooser::ExistingCommand | 4 | 在选择时必须存在的可执行文件 |
Utils::PathChooser::Command | 5 | 在选择时可能存在也可能不存在的可执行文件(例如构建结果) |
Utils::PathChooser::Any | 6 | 对所选路径无限制 |
另请参阅 setExpectedKind() 和expectedKind()。
成员函数文档
Utils::PathChooser::Kind PathChooser::expectedKind() const
返回PathChooser 认为有效的路径类型。
另请参阅 Utils::PathChooser::Kind 和setExpectedKind()。
void PathChooser::setExpectedKind(Utils::PathChooser::Kind expected)
将PathChooser 视为有效路径的类型设置为expected 。
另请参阅 Utils::PathChooser::Kind 和expectedKind()。
Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.