diff options
author | hjk <hjk@qt.io> | 2020-05-20 14:40:27 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2020-05-27 07:50:26 +0000 |
commit | de58fc104a8170f17df779847f4af06b1816a412 (patch) | |
tree | 79162fe35281014bc292e9bee8cf1dfc45d843c9 | |
parent | f197b8f64c080ff1958f456d5addf509a118caf2 (diff) | |
download | qt-creator-de58fc104a8170f17df779847f4af06b1816a412.tar.gz |
Utils: Document PathChooser::Kind
Change-Id: I0d984c9cae98b59abfb62a3fd6932d63783e9015
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r-- | src/libs/utils/pathchooser.cpp | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/src/libs/utils/pathchooser.cpp b/src/libs/utils/pathchooser.cpp index 01e2fa3e5f..b460c0ea57 100644 --- a/src/libs/utils/pathchooser.cpp +++ b/src/libs/utils/pathchooser.cpp @@ -42,14 +42,32 @@ /*! \class Utils::PathChooser + \inmodule QtCreator - \brief The PathChooser class is a control that lets the user choose a path, - consisting of a QLineEdit and - a "Browse" button. + \brief 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. This class has some validation logic for embedding into QWizardPage. */ +/*! + \enum Utils::PathChooser::Kind + \inmodule QtCreator + + The Kind enum describes the kind of path a PathChooser considers valid. + + \value ExistingDirectory An existing directory + \value Directory A directory that does not need to exist + \value File An existing file + \value SaveFile A file that does not need to exist + \value ExistingCommand An executable file that must exist at the time of selection + \value Command An executable file that may or may not exist at the time of selection (e.g. result of a build) + \value Any No restriction on the selected path + + \sa setExpectedKind(), expectedKind() +*/ + namespace Utils { static QString appBundleExpandedPath(const QString &path) @@ -620,6 +638,13 @@ QString PathChooser::homePath() return QDir::homePath(); } +/*! + Sets the kind of path the PathChooser will consider valid to select + to \a expected. + + \sa Utils::PathChooser::Kind, expectedKind() +*/ + void PathChooser::setExpectedKind(Kind expected) { if (d->m_acceptingKind == expected) @@ -628,6 +653,12 @@ void PathChooser::setExpectedKind(Kind expected) d->m_lineEdit->validate(); } +/*! + Returns the kind of path the PathChooser considers valid to select. + + \sa Utils::PathChooser::Kind, setExpectedKind() +*/ + PathChooser::Kind PathChooser::expectedKind() const { return d->m_acceptingKind; |