PathChooser Class

class Utils::PathChooser

The PathChooser class is a control that lets the user choose a path. The control consist of a QLineEdit and a "Browse" button, and is optionally able to perform variable substitution. More...

Header: #include <PathChooser>
Inherits: QWidget

Public Types

enum Kind { ExistingDirectory, Directory, File, SaveFile, ExistingCommand, …, Any }

Public Functions

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)

Public Slots

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

Signals

void textChanged(const QString &text)

Detailed Description

This class has some validation logic for embedding into QWizardPage.

Member Type Documentation

enum PathChooser::Kind

The Kind enum describes the kind of path a PathChooser considers valid.

ConstantValueDescription
Utils::PathChooser::ExistingDirectory0An existing directory
Utils::PathChooser::Directory1A directory that does not need to exist
Utils::PathChooser::File2An existing file
Utils::PathChooser::SaveFile3A file that does not need to exist
Utils::PathChooser::ExistingCommand4An executable file that must exist at the time of selection
Utils::PathChooser::Command5An executable file that may or may not exist at the time of selection (e.g. result of a build)
Utils::PathChooser::Any6No restriction on the selected path

See also setExpectedKind() and expectedKind().

Member Function Documentation

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

Returns the kind of path the PathChooser considers valid to select.

Note: Getter function for property expectedKind.

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

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

Sets the kind of path the PathChooser will consider valid to select to expected.

Note: Setter function for property expectedKind.

See also Utils::PathChooser::Kind and expectedKind().

© 2023 The Qt Company Ltd. 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.