10#include <QtCore/QMutex>
11#include <QtCore/private/qlocking_p.h>
13#include <QtCore/QFileInfo>
14#include <QtCore/QLocale>
15#include <QtCore/QDebug>
160 return d->select(filePath);
165 bool local =
file ==
"qrc"_L1;
167 local |=
file ==
"assets"_L1;
186 auto scheme =
":"_L1;
189 if (filePath.
scheme() ==
"assets"_L1)
190 scheme =
"assets:"_L1;
194 QString selectedPath =
d->select(equivalentPath);
195 ret.setPath(selectedPath.remove(0, scheme.size()));
199 if (
ret.hasFragment())
200 frag =
ret.fragment();
206 ret.setFragment(frag);
222 for (
const QString &
s : selectors) {
224 if (!indicator.isNull())
225 prospectiveBase += indicator;
226 prospectiveBase +=
s + u
'/';
228 remainingSelectors.removeAll(
s);
232 if (!prospectiveFile.isEmpty())
233 return prospectiveFile;
249 if (
auto path = fi.path(); !
path.isEmpty())
252 fi.fileName(),
q->allSelectors());
287 return d->extras + sharedData->staticSelectors;
292 if (!sharedData->staticSelectors.isEmpty())
298 if (envSelectors.size())
299 sharedData->staticSelectors << envSelectors;
304 sharedData->staticSelectors << sharedData->preloadedStatics;
319#elif defined(Q_OS_UNIX)
321# if !defined(Q_OS_ANDROID) && !defined(Q_OS_QNX)
326 if (productName !=
"unknown"_L1)
335 sharedData->preloadedStatics << statics;
336 sharedData->staticSelectors.clear();
341#include "moc_qfileselector.cpp"
bool exists() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
static void addStatics(const QStringList &)
static QString selectionHelper(const QString &path, const QString &fileName, const QStringList &selectors, QChar indicator=u'+')
static void updateSelectors()
static QStringList platformSelectors()
QString select(const QString &filePath) const
QStringList extraSelectors() const
Returns the list of extra selectors which have been added programmatically to this instance.
void setExtraSelectors(const QStringList &list)
Sets the list of extra selectors which have been added programmatically to this instance.
QStringList allSelectors() const
Returns the complete, ordered list of selectors used by this instance.
QString select(const QString &filePath) const
This function returns the selected version of the path, based on the conditions at runtime.
~QFileSelector()
Destroys this selector instance.
QFileSelector(QObject *parent=nullptr)
Create a QFileSelector instance.
bool exists() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString name(TagSeparator separator=TagSeparator::Underscore) const
The short name of this locale.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
static QString productType()
static QString kernelType()
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
QString scheme() const
Returns the scheme of the URL.
QString path(ComponentFormattingOptions options=FullyDecoded) const
Returns the path of the URL.
Combined button and popup list for selecting options.
static bool isLocalScheme(const QString &file)
static const char env_override[]
static Q_CONSTINIT QBasicMutex sharedDataMutex
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
GLenum GLsizei const void * pathString
GLdouble GLdouble GLdouble GLdouble q
GLsizei const GLchar *const * path
#define QStringLiteral(str)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
Q_CORE_EXPORT bool qEnvironmentVariableIsEmpty(const char *varName) noexcept
\inmodule QtCore \reentrant