Extending Qt Creator Manual | PathChooser

Extending Qt Creator Manual 4.6.1

# PathChooser Class

(Utils::PathChooser)

The PathChooser class is a control that lets the user choose a path, consisting of a QLineEdit and a "Browse" button. More...

Header: | #include <PathChooser>

- List of all members, including inherited members

## Public Types

enum | Kind { ExistingDirectory, Directory, File, SaveFile, ..., Any }

## Properties

- baseDirectory : QString
- baseFileName : Utils::FileName
- commandVersionArguments : QStringList
- errorColor : QColor
- expectedKind : Kind
- fileName : Utils::FileName

- okColor : QColor
- path : QString
- promptDialogFilter : QString
- promptDialogTitle : QString
- readOnly : bool

## Public Functions

| PathChooser(QWidget *parent = nullptr)
virtual | ~PathChooser()
void | addButton(const QString &text, QObject *context, const std::function<void() > &callback)
QString | baseDirectory() const
FileName | baseFileName() const
QAbstractButton * | buttonAtIndex(int index) const
QStringList | commandVersionArguments() const
FancyLineEdit::ValidationFunction | defaultValidationFunction() const
QColor | errorColor() const
QString | errorMessage() const
Kind | expectedKind() const
FileName | fileName() const
void | insertButton(int index, const QString &text, QObject *context, const std::function<void() > &callback)
bool | isReadOnly() const
bool | isValid() const
FancyLineEdit * | lineEdit() const
QColor | okColor() const
QString | path() const
QString | promptDialogFilter() const
QString | promptDialogTitle() const
FileName | rawFileName() const
QString | rawPath() const
void | setBaseDirectory(const QString &directory)
void | setBaseFileName(const FileName &base)
void | setCommandVersionArguments(const QStringList &arguments)
void | setEnvironment(const Environment &env)
void | setExpectedKind(Kind expected)
void | setHistoryCompleter(const QString &historyKey, bool restoreLastItemFromHistory = false)
void | setInitialBrowsePathBackup(const QString &path)
void | setPromptDialogFilter(const QString &filter)
void | setPromptDialogTitle(const QString &title)
void | setReadOnly(bool b)
void | setValidationFunction(const FancyLineEdit::ValidationFunction &fn)
void | triggerChanged()

## Public Slots

void | setErrorColor(const QColor &errorColor)
void | setFileName(const Utils::FileName &)
void | setOkColor(const QColor &okColor)
void | setPath(const QString &)

## Signals

void | beforeBrowsing()
void | browsingFinished()
void | editingFinished()
void | pathChanged(const QString &path)
void | rawPathChanged(const QString &text)
void | returnPressed()
void | validChanged(bool validState)

## Static Public Members

QString | browseButtonLabel()
QString | expandedDirectory(const QString &input, const Utils::Environment &env, const QString &baseDir)
QString | homePath()
void | installLineEditVersionToolTip(QLineEdit *le, const QStringList &arguments)
QString | label()
void | setAboutToShowContextMenuHandler(AboutToShowContextMenuHandler handler)
QString | toolVersion(const QString &binary, const QStringList &arguments)

## Detailed Description

The PathChooser class is a control that lets the user choose a path, consisting of a QLineEdit and a "Browse" button.

This class has some validation logic for embedding into QWizardPage.

## Member Type Documentation

### enum PathChooser::Kind

## Property Documentation

### baseDirectory : QString

Access functions:

QString | baseDirectory() const
void | setBaseDirectory(const QString &directory)

### baseFileName : Utils::FileName

Access functions:

FileName | baseFileName() const
void | setBaseFileName(const FileName &base)

### commandVersionArguments : QStringList

Access functions:

QStringList | commandVersionArguments() const
void | setCommandVersionArguments(const QStringList &arguments)

### errorColor : QColor

Access functions:

QColor | errorColor() const
void | setErrorColor(const QColor &errorColor)

### expectedKind : Kind

Access functions:

Kind | expectedKind() const
void | setExpectedKind(Kind expected)

### fileName : Utils::FileName

Access functions:

FileName | fileName() const
void | setFileName(const Utils::FileName &)

### okColor : QColor

Access functions:

QColor | okColor() const
void | setOkColor(const QColor &okColor)

### path : QString

Access functions:

QString | path() const
void | setPath(const QString &)

Notifier signal:

void | pathChanged(const QString &path)

### promptDialogFilter : QString

Access functions:

QString | promptDialogFilter() const
void | setPromptDialogFilter(const QString &filter)

### promptDialogTitle : QString

Access functions:

QString | promptDialogTitle() const
void | setPromptDialogTitle(const QString &title)

### readOnly : bool

Access functions:

bool | isReadOnly() const
void | setReadOnly(bool b)

## Member Function Documentation

### PathChooser::PathChooser(QWidget *parent = nullptr)

Default constructs an instance of PathChooser.

### `[virtual]` PathChooser::~PathChooser()

Destroys the instance of PathChooser. The destructor is virtual.

### void PathChooser::addButton(const QString &text, QObject *context, const std::function<void() > &callback)

### `[signal]` void PathChooser::beforeBrowsing()

### `[static]` QString PathChooser::browseButtonLabel()

### `[signal]` void PathChooser::browsingFinished()

### QAbstractButton *PathChooser::buttonAtIndex(int index) const

### FancyLineEdit::ValidationFunction PathChooser::defaultValidationFunction() const

### `[signal]` void PathChooser::editingFinished()

### QString PathChooser::errorMessage() const

### `[static]` QString PathChooser::expandedDirectory(const QString &input, const Utils::Environment &env, const QString &baseDir)

### `[static]` QString PathChooser::homePath()

### void PathChooser::insertButton(int index, const QString &text, QObject *context, const std::function<void() > &callback)

### `[static]` void PathChooser::installLineEditVersionToolTip(QLineEdit *le, const QStringList &arguments)

### bool PathChooser::isValid() const

### `[static]` QString PathChooser::label()

### FancyLineEdit *PathChooser::lineEdit() const

### FileName PathChooser::rawFileName() const

### QString PathChooser::rawPath() const

### `[signal]` void PathChooser::rawPathChanged(const QString &text)

### `[signal]` void PathChooser::returnPressed()

### `[static]` void PathChooser::setAboutToShowContextMenuHandler(AboutToShowContextMenuHandler handler)

### void PathChooser::setEnvironment(const Environment &env)

### void PathChooser::setHistoryCompleter(const QString &historyKey, bool restoreLastItemFromHistory = false)

### void PathChooser::setInitialBrowsePathBackup(const QString &path)

### void PathChooser::setValidationFunction(const FancyLineEdit::ValidationFunction &fn)

### `[static]` QString PathChooser::toolVersion(const QString &binary, const QStringList &arguments)

### void PathChooser::triggerChanged()

### `[signal]` void PathChooser::validChanged(bool validState)