10#ifndef QT_BOOTSTRAPPED
15#if __has_include(<paths.h>)
23#ifndef QT_NO_STANDARDPATHS
433 pathExt :
QStringList{
".exe"_L1,
".com"_L1,
".bat"_L1,
".cmd"_L1};
441 return info.bundleName();
442 if (
info.isFile() &&
info.isExecutable())
451 for (
const QString &searchPath : searchPaths) {
454 if (!absPath.isEmpty())
465 searchExecutableAppendSuffix(
const QStringList &searchPaths,
470 for (
const QString &searchPath : searchPaths) {
472 for (
const QString &suffix : suffixes) {
474 if (!absPath.isEmpty())
488 if (
QFileInfo(executableName).isAbsolute())
492 if (
paths.isEmpty()) {
498#if defined(_PATH_DEFPATH)
500 pEnv = _PATH_DEFPATH;
501#elif defined(_CS_PATH)
503 size_t n = confstr(_CS_PATH,
nullptr, 0);
507 confstr(_CS_PATH, pEnv.data(), pEnv.size() + 1);
518 searchPaths.reserve(rawPaths.size());
519 for (
const QString &rawPath : rawPaths) {
523 searchPaths.push_back(cleanPath);
530 static const QStringList executable_extensions = executableExtensions();
531 if (executableName.contains(u
'.')) {
534 return searchExecutableAppendSuffix(searchPaths, executableName, executable_extensions);
536 return searchExecutableAppendSuffix(searchPaths, executableName, executable_extensions);
548#if !defined(Q_OS_DARWIN) && !defined(QT_BOOTSTRAPPED)
633#include "moc_qstandardpaths.cpp"
static QString translate(const char *context, const char *key, const char *disambiguation=nullptr, int n=-1)
\threadsafe
static QDir current()
Returns the application's current directory.
bool exists() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString cleanPath(const QString &path)
Returns path with directory separators normalized (that is, platform-native separators converted to "...
QString absoluteFilePath(const QString &fileName) const
Returns the absolute path name of a file in the directory.
static constexpr QChar listSeparator() noexcept
QString suffix() const
Returns the suffix (extension) of the file.
bool isFile() const
Returns true if this object points to a file or to a symbolic link to a file.
static QStringList locateAll(StandardLocation type, const QString &fileName, LocateOptions options=LocateFile)
[0]
static bool isTestModeEnabled()
static void setTestModeEnabled(bool testMode)
static QStringList standardLocations(StandardLocation type)
static QString displayName(StandardLocation type)
static QString findExecutable(const QString &executableName, const QStringList &paths=QStringList())
static QString locate(StandardLocation type, const QString &fileName, LocateOptions options=LocateFile)
StandardLocation
This enum describes the different locations that can be queried using methods such as QStandardPaths:...
\macro QT_RESTRICTED_CAST_FROM_ASCII
const_iterator constEnd() const
Returns a const \l{STL-style iterators}{STL-style iterator} pointing just after the last character in...
void truncate(qsizetype pos)
Truncates the string at the given position index.
static QString fromLocal8Bit(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isEmpty() const noexcept
Returns true if the string has no characters; otherwise returns false.
qsizetype size() const noexcept
Returns the number of characters in this string.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
QString & append(QChar c)
const_iterator constBegin() const
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first character in the st...
Combined button and popup list for selecting options.
GLsizei const GLuint * paths
GLsizei const GLchar *const * path
static bool existsAsSpecified(const QString &path, QStandardPaths::LocateOptions options)
static QString searchExecutable(const QStringList &searchPaths, const QString &executableName)
static Q_CONSTINIT bool qsp_testMode
static QString checkExecutable(const QString &path)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)