7#include <QtCore/qdebug.h>
8#include <QtCore/qdir.h>
9#include <QtQml/qqmlfile.h>
10#include <QtCore/qfileinfo.h>
11#include <QtCore/qpluginloader.h>
12#include <QtCore/qlibraryinfo.h>
13#include <QtCore/qloggingcategory.h>
14#include <QtQml/qqmlextensioninterface.h>
15#include <QtQml/qqmlextensionplugin.h>
16#include <private/qqmlextensionplugin_p.h>
17#include <private/qqmlglobal_p.h>
18#include <private/qqmltypenamecache_p.h>
19#include <private/qqmlengine_p.h>
20#include <private/qqmltypemodule_p.h>
21#include <private/qqmltypeloaderqmldircontent_p.h>
22#include <private/qqmlpluginimporter_p.h>
23#include <QtCore/qjsonobject.h>
24#include <QtCore/qjsonarray.h>
25#include <QtQml/private/qqmltype_p_p.h>
26#include <QtQml/private/qqmlimportresolver_p.h>
29#include "private/qcore_mac_p.h"
92 error.setDescription(QQmlImportDatabase::tr(
93 "module \"%1\" version %2.%3 is not installed")
99 error.setDescription(QQmlImportDatabase::tr(
"module \"%1\" is not installed")
110 }
else if (relative.
isEmpty()) {
132 int removeLength = (
index - previous) + 3;
133 base.remove(previous + 1, removeLength);
151#if defined(Q_OS_UNIX)
155 return fi.isAbsolute();
240 for (
int ii =
set.imports.size() - 1; ii >= 0; --ii) {
242 QQmlTypeModule *
module = QQmlMetaType::typeModule(import->uri, import->version);
254 typeimport.m_qualifier =
set.prefix;
256 for (
int ii =
set.imports.size() - 1; ii >= 0; --ii) {
258 QQmlTypeModule *
module = QQmlMetaType::typeModule(import->uri, import->version);
272 if (importUrl.isEmpty())
275 if (
baseUrl.startsWith(importUrl))
288 for (
int ii =
set.imports.size() - 1; ii >= 0; --ii) {
294 auto shouldSkipSingleton = [importVersion](
QTypeRevision singletonVersion) ->
bool {
296 (singletonVersion.majorVersion() > importVersion.majorVersion()
297 || (singletonVersion.majorVersion() == importVersion.majorVersion()
298 && singletonVersion.minorVersion() > importVersion.minorVersion()));
302 for (ConstIterator cit =
components.constBegin(); cit != cend; ++cit) {
304 if (shouldSkipSingleton(cit->version))
309 ref.version = cit->version;
310 resultList.append(
ref);
315 module->walkCompositeSingletons([&resultList, &set, &shouldSkipSingleton](const QQmlType &singleton) {
316 if (shouldSkipSingleton(singleton.version()))
321 ref.version = singleton.version();
322 resultList.append(
ref);
339 QList<QQmlImports::CompositeSingletonReference> compositeSingletons;
349 std::stable_sort(compositeSingletons.begin(), compositeSingletons.end(),
352 if (lhs.prefix != rhs.prefix)
353 return lhs.prefix < rhs.prefix;
355 if (lhs.typeName != rhs.typeName)
356 return lhs.typeName < rhs.typeName;
358 return lhs.version.majorVersion() != rhs.version.majorVersion()
359 ? lhs.version.majorVersion() < rhs.version.majorVersion()
360 : lhs.version.minorVersion() < rhs.version.minorVersion();
363 return compositeSingletons;
374 QList<QQmlImports::ScriptReference> scripts;
378 for (
int ii =
set.imports.size() - 1; ii >= 0; --ii) {
392 for (
int ii =
set.imports.size() - 1; ii >= 0; --ii) {
398 ref.qualifier =
set.prefix;
464 if (
resolveType(typeLoader,
type, version_return, type_return, errors, registrationType,
465 typeRecursionDetected)) {
467#define RESOLVE_TYPE_DEBUG qCDebug(lcQmlImport) \
468 << "resolveType:" << qPrintable(baseUrl().toString()) << type.toString() << " => "
470 if (type_return && type_return->isValid()) {
471 if (type_return->isCompositeSingleton())
472 RESOLVE_TYPE_DEBUG << type_return->typeName() <<
' ' << type_return->sourceUrl() <<
" TYPE/URL-SINGLETON";
473 else if (type_return->isComposite())
474 RESOLVE_TYPE_DEBUG << type_return->typeName() <<
' ' << type_return->sourceUrl() <<
" TYPE/URL";
475 else if (type_return->isInlineComponentType())
476 RESOLVE_TYPE_DEBUG << type_return->typeName() <<
' ' << type_return->sourceUrl() <<
" TYPE(INLINECOMPONENT)";
480#undef RESOLVE_TYPE_DEBUG
502 if ((*
it !=
this) && ((*it)->uri ==
uri)) {
504 error.setDescription(
505 QQmlImportDatabase::tr(
"\"%1\" is ambiguous. Found in %2 and in %3")
506 .arg(
uri,
url, (*it)->url));
507 errors->prepend(
error);
521 QMap<QString, QQmlDirParser::Script> versioned;
524 sit != qmldirscripts.constEnd(); ++sit) {
530 const auto vit = versioned.constFind(sit->nameSpace);
531 if (vit == versioned.cend()
532 || (vit->version.minorVersion() < sit->version.minorVersion())) {
533 versioned.insert(sit->nameSpace, *sit);
538 return versioned.values();
558 QList<QQmlError> *errors)
const
586 switch (registrationType) {
605 if ((candidate ==
end)
606 || (
c.version.majorVersion() > candidate->version.majorVersion())
607 || ((
c.version.majorVersion() == candidate->version.majorVersion())
608 && (
c.version.minorVersion() > candidate->version.minorVersion()))) {
612 if (resolveLocalUrl(*
base,
c.fileName) != componentUrl)
616 const bool recursion = *
base == componentUrl;
617 if (typeRecursionDetected)
618 *typeRecursionDetected = recursion;
632 if (candidate !=
end) {
636 nullptr, candidate->version);
638 *version_return = candidate->version;
640 *type_return = returnType;
646 if (localDirectoryPath.isEmpty())
656 for (
const QString &urlToTry : urlsToTry) {
657 exists = typeLoader->
fileExists(localDirectoryPath, urlToTry);
659#if defined(Q_OS_MACOS) || defined(Q_OS_WIN)
666 errors->append(caseError);
673 qmlUrl =
url + urlToTry;
679 const bool recursion =
base && *
base == qmlUrl;
680 if (typeRecursionDetected)
681 *typeRecursionDetected = recursion;
689 *type_return = returnType;
700 QQmlType *type_return, QList<QQmlError> *errors,
703 const QVector<QHashedStringRef> splitName =
type.split(
Dot);
704 auto resolveTypeInNamespace = [&](
706 QList<QQmlError> *errors) ->
bool {
707 if (nameSpace->resolveType(
708 typeLoader, unqualifiedtype, version_return, type_return, &m_base, errors,
709 registrationType, typeRecursionDetected))
711 if (nameSpace->imports.size() == 1
712 && !nameSpace->imports.at(0)->isLibrary
714 && nameSpace != &m_unqualifiedset) {
717 resolveLocalUrl(nameSpace->imports.at(0)->url,
720 return type_return->isValid();
724 switch (splitName.size()) {
727 return resolveTypeInNamespace(
type, &m_unqualifiedset, errors);
734 return resolveTypeInNamespace(splitName.at(1),
s, errors);
736 if (resolveTypeInNamespace(splitName.at(0), &m_unqualifiedset,
nullptr)) {
739 *type_return, splitName.at(1).toString());
745 error.setDescription(QQmlImportDatabase::tr(
"- %1 is neither a type nor a namespace").
arg(splitName.at(0).toString()));
746 errors->prepend(
error);
757 error.setDescription(QQmlImportDatabase::tr(
"- %1 is not a namespace").
arg(splitName.at(0).toString()));
759 if (resolveTypeInNamespace(splitName.at(1),
s,
nullptr)) {
761 *type_return, splitName.at(2).toString());
764 error.setDescription(QQmlImportDatabase::tr(
"- %1 is not a type").
arg(splitName.at(1).toString()));
768 errors->prepend(
error);
776 error.setDescription(QQmlImportDatabase::tr(
"- nested namespaces not allowed"));
777 errors->prepend(
error);
788 if (import->uri == uri)
798 bool *typeRecursionDetected)
803 bool localTypeRecursionDetected =
false;
804 if (!typeRecursionDetected)
805 typeRecursionDetected = &localTypeRecursionDetected;
810 return import->isInlineComponent;
816 if (import->resolveType(typeLoader,
type, version_return, type_return,
base,
817 typeRecursionDetected, registrationType, recursionRestriction, errors)) {
818 if (qmlCheckTypes()) {
822 if (import2->resolveType(typeLoader,
type, version_return,
nullptr,
base,
823 nullptr, registrationType)) {
833 if (
u1.startsWith(
b))
834 u1 =
u1.mid(
b.size());
836 u1 = QQmlImportDatabase::tr(
"local directory");
837 if (
u2.startsWith(
b))
838 u2 =
u2.mid(
b.size());
840 u2 = QQmlImportDatabase::tr(
"local directory");
846 error.setDescription(
847 QQmlImportDatabase::tr(
848 "is ambiguous. Found in %1 and in %2")
851 error.setDescription(
852 QQmlImportDatabase::tr(
853 "is ambiguous. Found in %1 in version "
856 .
arg(import->version.majorVersion())
857 .arg(import->version.minorVersion())
858 .arg(import2->version.majorVersion())
859 .arg(import2->version.minorVersion()));
861 errors->prepend(
error);
872 if (*typeRecursionDetected)
873 error.setDescription(QQmlImportDatabase::tr(
"is instantiated recursively"));
875 error.setDescription(QQmlImportDatabase::tr(
"is not a type"));
876 errors->prepend(
error);
884 if (prefix ==
ns->prefix)
905 error.setDescription(
906 QQmlImportDatabase::tr(
"module does not support the designer \"%1\"")
909 errors->prepend(
error);
923 uri, version, typeLoader->
importDatabase(), qmldir, typeLoader, errors);
924 return importer.importPlugins();
927QString QQmlImports::redirectQmldirContent(
940 *qmldir = std::move(redirected);
944bool QQmlImports::getQmldirContent(
966 if (!
paths.isEmpty())
967 std::sort(
paths.begin(),
paths.end(), std::greater<QString>());
981 if (versionDot >= 0) {
982 int nextSlash = stableRelativePath.indexOf(
Slash, versionDot);
984 stableRelativePath.remove(versionDot, nextSlash - versionDot);
986 stableRelativePath = stableRelativePath.left(versionDot);
989 stableRelativePath.replace(
Slash,
Dot);
991 return stableRelativePath;
1013 QList<QQmlError> *errors)
1015 int bestMajorVersion = -1;
1016 quint8 lowestMinorVersion = std::numeric_limits<quint8>::max();
1017 quint8 highestMinorVersion = 0;
1020 if (!newVersion.hasMajorVersion())
1023 if (newVersion.majorVersion() > bestMajorVersion) {
1024 bestMajorVersion = newVersion.majorVersion();
1025 if (newVersion.hasMinorVersion()) {
1026 lowestMinorVersion = newVersion.minorVersion();
1027 highestMinorVersion = newVersion.minorVersion();
1029 }
else if (newVersion.majorVersion() == bestMajorVersion
1030 && newVersion.hasMinorVersion()) {
1031 lowestMinorVersion =
qMin(lowestMinorVersion, newVersion.minorVersion());
1032 highestMinorVersion =
qMax(highestMinorVersion, newVersion.minorVersion());
1041 for (ConstIterator cit =
components.constBegin(); cit !=
cend; ++cit) {
1042 for (ConstIterator cit2 =
components.constBegin(); cit2 != cit; ++cit2) {
1043 if (cit2->typeName == cit->typeName && cit2->version == cit->version) {
1046 error.setDescription(
1047 QQmlImportDatabase::tr(
1048 "\"%1\" version %2.%3 is defined more than once in module \"%4\"")
1049 .arg(cit->typeName).arg(cit->version.majorVersion())
1050 .arg(cit->version.minorVersion()).arg(uri));
1051 errors->prepend(
error);
1056 addVersion(cit->version);
1062 SConstIterator send = scripts.
constEnd();
1063 for (SConstIterator sit = scripts.
constBegin(); sit != send; ++sit) {
1064 for (SConstIterator sit2 = scripts.
constBegin(); sit2 != sit; ++sit2) {
1065 if (sit2->nameSpace == sit->nameSpace && sit2->version == sit->version) {
1068 error.setDescription(QQmlImportDatabase::tr(
"\"%1\" version %2.%3 is defined more than once in module \"%4\"")
1069 .arg(sit->nameSpace).arg(sit->version.majorVersion())
1070 .arg(sit->version.minorVersion()).arg(uri));
1071 errors->prepend(
error);
1076 addVersion(sit->version);
1081 && (bestMajorVersion < 0
1085 errors->prepend(moduleNotFoundError(uri, version));
1090 if (bestMajorVersion < 0)
1097 : highestMinorVersion);
1105 nameSpace = &m_unqualifiedset;
1107 nameSpace = findQualifiedNamespace(prefix);
1111 nameSpace->
prefix = prefix;
1112 m_qualifiedSets.
append(nameSpace);
1131 import->version = version;
1133 import->precedence = precedence;
1138 if ((*it)->precedence < precedence)
1151 ImportFlags
flags,
quint16 precedence, QList<QQmlError> *errors)
1158 << uri <<
"version '" << version <<
"'" <<
"as" << prefix;
1164 nameSpace, uri, qmldirUrl, version,
1172 if (!qmldirIdentifier.isEmpty()) {
1173 if (!getQmldirContent(typeLoader, qmldirIdentifier, uri, &qmldir, errors))
1177 version = importExtension(typeLoader, uri, version, &qmldir, errors);
1182 ? redirectQmldirContent(typeLoader, &qmldir)
1185 if (!inserted->setQmldirContent(
resolvedUrl, qmldir, nameSpace, errors))
1192 if (matchingVersion.isValid())
1193 return matchingVersion;
1195 if (inserted->qmlDirComponents.isEmpty() && inserted->qmlDirScripts.isEmpty()) {
1202 errors->prepend(moduleNotFoundError(uri, relevantVersion(uri, version)));
1206 version = matchingQmldirVersion(qmldir, uri, version, errors);
1239 QList<QQmlError> *errors)
1246 << uri << version <<
"as" << prefix;
1252 error.setDescription(QQmlImportDatabase::tr(
1253 "\"%1\" is not a valid import URL. "
1254 "You can pass relative paths or URLs with schema, but not "
1255 "absolute paths or resource paths. Try \"%2\".").
arg(uri, fix));
1256 errors->prepend(
error);
1278 Q_ASSERT(!localFileOrQrc.isEmpty());
1284 error.setDescription(QQmlImportDatabase::tr(
"\"%1\": no such directory").
arg(uri));
1286 errors->prepend(
error);
1298 qmldirIdentifier = std::move(localFileOrQrc);
1300 *localQmldir = qmldirIdentifier;
1307 error.setDescription(QQmlImportDatabase::tr(
"import \"%1\" has no qmldir and no namespace").
arg(importUri));
1309 errors->prepend(
error);
1320 error.setDescription(
1321 QQmlImportDatabase::tr(
"Cannot resolve URL for import \"%1\"").
arg(uri));
1322 error.setUrl(m_baseUrl);
1323 errors->prepend(
error);
1337 if ((*it)->url ==
url) {
1338 (*it)->implicitlyImported =
true;
1346 if (!getQmldirContent(typeLoader, qmldirIdentifier, importUri, &qmldir, errors))
1352 if (!qmldirUri.isEmpty())
1353 importUri = qmldirUri;
1357 errors, precedence);
1360 version = importExtension(typeLoader, importUri, version, &qmldir, errors);
1365 url = redirectQmldirContent(typeLoader, &qmldir);
1367 if (!inserted->setQmldirContent(
url, qmldir, nameSpace, errors))
1376 errors, precedence);
1383 const QString &qmldirIdentifier,
const QString &qmldirUrl, QList<QQmlError> *errors)
1390 << uri <<
"to" << qmldirUrl <<
"as" << prefix;
1397 if (!getQmldirContent(typeLoader, qmldirIdentifier, uri, &qmldir, errors))
1402 typeLoader, uri, import->version, &qmldir, errors);
1407 ? redirectQmldirContent(typeLoader, &qmldir)
1410 if (import->setQmldirContent(
resolvedUrl, qmldir, nameSpace, errors)) {
1411 if (import->qmlDirComponents.isEmpty() && import->qmlDirScripts.isEmpty()) {
1414 errors->prepend(moduleNotFoundError(uri, relevantVersion(uri, version)));
1419 version = matchingQmldirVersion(qmldir, uri, version, errors);
1428 if (errors->isEmpty()) {
1430 error.setDescription(QQmlTypeLoader::tr(
"Cannot update qmldir content for '%1'").
arg(uri));
1431 errors->prepend(
error);
1453 importInstance->url = importUrl.toString();
1454 importInstance->uri =
name;
1455 importInstance->isInlineComponent =
true;
1482 bool wasEmpty =
false;
1522 auto addEnvImportPath = [
this](
const char *
var) {
1525 for (
int ii =
paths.size() - 1; ii >= 0; --ii)
1531 addEnvImportPath(
"QML_IMPORT_PATH");
1532 addEnvImportPath(
"QML2_IMPORT_PATH");
1538 auto addEnvPluginPath = [
this](
const char *
var) {
1541 for (
int ii =
paths.size() - 1; ii >= 0; --ii)
1546 addEnvPluginPath(
"QML_PLUGIN_PATH");
1547#if defined(Q_OS_ANDROID)
1549 addEnvPluginPath(
"QT_BUNDLED_LIBS_PATH");
1550#elif defined(Q_OS_MACOS)
1554 if (CFBundleRef bundleRef = CFBundleGetMainBundle()) {
1555 if (QCFType<CFURLRef> urlRef = CFBundleCopyResourceURL(
1558 if (QCFType<CFURLRef> absoluteUrlRef = CFURLCopyAbsoluteURL(urlRef)) {
1559 if (
QCFString path = CFURLCopyFileSystemPath(absoluteUrlRef, kCFURLPOSIXPathStyle)) {
1576 filePluginPath =
paths;
1590 filePluginPath.prepend(
dir.canonicalPath());
1592 filePluginPath.prepend(
path);
1624 cPath =
dir.canonicalPath();
1630 if (!cPath.isEmpty()) {
1631 if (fileImportPath.contains(cPath))
1632 fileImportPath.move(fileImportPath.indexOf(cPath), 0);
1634 fileImportPath.prepend(cPath);
1644 return fileImportPath;
1663 fileImportPath.clear();
1680 errors->prepend(moduleNotFoundError(uri, version));
1689 errors->prepend(moduleNotFoundError(uri, version));
1706void QQmlImportDatabase::clearDirCache()
1709 while (itr != qmldirCache.
constEnd()) {
1710 QmldirCache *
cache = *itr;
1712 QmldirCache *nextCache =
cache->next;
1719 qmldirCache.
clear();
static QString applicationDirPath()
Returns the directory that contains the application executable.
static constexpr QChar listSeparator() noexcept
bool exists() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString path(LibraryPath p)
qsizetype size() const noexcept
bool isEmpty() const noexcept
iterator insert(qsizetype i, parameter_type t)
void push_back(parameter_type t)
const_reference at(qsizetype i) const noexcept
const_iterator constBegin() const noexcept
const_iterator cend() const noexcept
void append(parameter_type t)
const_iterator constEnd() const noexcept
const_iterator cbegin() const noexcept
iterator find(const Key &key)
const_iterator ConstIterator
friend class const_iterator
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
static QQmlEnginePrivate * get(QQmlEngine *e)
The QQmlEngine class provides an environment for instantiating QML components.
QUrl interceptUrl(const QUrl &url, QQmlAbstractUrlInterceptor::DataType type) const
Run the current URL interceptors on the given url of the given type and return the result.
The QQmlError class encapsulates a QML error.
void setDescription(const QString &)
Sets the error description.
static bool isLocalFile(const QString &url)
Returns true if url is a local file that can be opened with \l{QFile}.
static QString urlToLocalFileOrQrc(const QString &)
If url is a local file returns a path suitable for passing to \l{QFile}.
The QQmlImportDatabase class manages the QML imports for a QQmlEngine.
void addPluginPath(const QString &path)
QStringList dynamicPlugins() const
QStringList importPathList(PathType type=LocalOrRemote) const
bool removeDynamicPlugin(const QString &pluginId)
void setPluginPathList(const QStringList &paths)
void addImportPath(const QString &dir)
static QTypeRevision lockModule(const QString &uri, const QString &typeNamespace, QTypeRevision version, QList< QQmlError > *errors)
QQmlImportDatabase(QQmlEngine *)
void setImportPathList(const QStringList &paths)
bool needsSorting() const
QQmlImportInstance * findImport(const QString &uri) const
bool resolveType(QQmlTypeLoader *typeLoader, const QHashedStringRef &type, QTypeRevision *version_return, QQmlType *type_return, const QString *base=nullptr, QList< QQmlError > *errors=nullptr, QQmlType::RegistrationType registrationType=QQmlType::AnyRegistrationType, bool *typeRecursionDeteced=nullptr)
QList< QQmlImportInstance * > imports
void setNeedsSorting(bool needsSorting)
void populateCache(QQmlTypeNameCache *cache) const
QList< CompositeSingletonReference > resolvedCompositeSingletons() const
static QString versionString(QTypeRevision version, ImportVersion importVersion)
QList< ScriptReference > resolvedScripts() const
QTypeRevision updateQmldirContent(QQmlTypeLoader *typeLoader, const QString &uri, const QString &prefix, const QString &qmldirIdentifier, const QString &qmldirUrl, QList< QQmlError > *errors)
bool addInlineComponentImport(QQmlImportInstance *const importInstance, const QString &name, const QUrl importUrl)
void setBaseUrl(const QUrl &url, const QString &urlString=QString())
Sets the base URL to be used for all relative file imports added.
static QUrl urlFromLocalFileOrQrcOrUrl(const QString &)
static void setDesignerSupportRequired(bool b)
bool resolveType(QQmlTypeLoader *typeLoader, const QHashedStringRef &type, QQmlType *type_return, QTypeRevision *version_return, QQmlImportNamespace **ns_return, QList< QQmlError > *errors=nullptr, QQmlType::RegistrationType registrationType=QQmlType::AnyRegistrationType, bool *typeRecursionDetected=nullptr) const
QTypeRevision addFileImport(QQmlTypeLoader *typeLoader, const QString &uri, const QString &prefix, QTypeRevision version, ImportFlags flags, quint16 precedence, QString *localQmldir, QList< QQmlError > *errors)
QTypeRevision addLibraryImport(QQmlTypeLoader *typeLoader, const QString &uri, const QString &prefix, QTypeRevision version, const QString &qmldirIdentifier, const QString &qmldirUrl, ImportFlags flags, quint16 precedence, QList< QQmlError > *errors)
static QStringList completeQmldirPaths(const QString &uri, const QStringList &basePaths, QTypeRevision version)
Forms complete paths to a qmldir file, from a base URL, a module URI and version specification.
static QTypeRevision validVersion(QTypeRevision version=QTypeRevision())
static bool removePlugin(const QString &pluginId)
static QStringList plugins()
QList< QQmlError > errors(const QString &uri, const QUrl &url) const
QQmlDirScripts scripts() const
bool hasRedirection() const
QQmlDirComponents components() const
QString typeNamespace() const
bool designerSupported() const
QString qmldirLocation() const
QString preferredPath() const
QQmlDirImports imports() const
QQmlDirPlugins plugins() const
The QQmlTypeLoader class abstracts loading files and their dependencies over the network.
QQmlEngine * engine() const
Return the QQmlEngine associated with this loader.
QString absoluteFilePath(const QString &path)
Returns the absolute filename of path via a directory cache.
QQmlImportDatabase * importDatabase() const
bool directoryExists(const QString &path)
Returns true if the path is a directory via a directory cache.
const QQmlTypeLoaderQmldirContent qmldirContent(const QString &filePath)
Return a QQmlTypeLoaderQmldirContent for absoluteFilePath.
bool fileExists(const QString &path, const QString &file)
iterator erase(const_iterator i)
ConstIterator constEnd() const
ConstIterator constBegin() const
constexpr QStringView left(qsizetype n) const noexcept
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString left(qsizetype n) const &
qsizetype lastIndexOf(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
QString & replace(qsizetype i, qsizetype len, QChar after)
void chop(qsizetype n)
Removes n characters from the end of the string.
QString mid(qsizetype position, qsizetype n=-1) const &
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.
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
bool endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string ends with s; otherwise returns false.
bool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static QString number(int, int base=10)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString static QString asprintf(const char *format,...) Q_ATTRIBUTE_FORMAT_PRINTF(1
static constexpr QTypeRevision fromVersion(Major majorVersion, Minor minorVersion)
Produces a QTypeRevision from the given majorVersion and minorVersion, both of which need to be a val...
static constexpr QTypeRevision fromMinorVersion(Minor minorVersion)
Produces a QTypeRevision from the given minorVersion with an invalid major version.
constexpr bool hasMinorVersion() const
Returns true if the minor version is known, otherwise false.
static constexpr QTypeRevision zero()
Produces a QTypeRevision with major and minor version {0}.
constexpr bool hasMajorVersion() const
Returns true if the major version is known, otherwise false.
constexpr quint8 minorVersion() const
Returns the minor version encoded in the revision.
constexpr bool isValid() const
Returns true if the major version or the minor version is known, otherwise false.
constexpr quint8 majorVersion() const
Returns the major version encoded in the revision.
static QUrl fromLocalFile(const QString &localfile)
Returns a QUrl representation of localFile, interpreted as a local file.
QUrl resolved(const QUrl &relative) const
Returns the result of the merge of this URL with relative.
bool isRelative() const
Returns true if the URL is relative; otherwise returns false.
bool isEmpty() const
Returns true if the URL has no data; otherwise returns false.
QString scheme() const
Returns the scheme of the URL.
QString toString(FormattingOptions options=FormattingOptions(PrettyDecoded)) const
Returns a string representation of the URL.
const QLoggingCategory & category() const
~QmlImportCategoryHolder()=default
QmlImportCategoryHolder()
QCache< int, Employee > cache
[0]
QSet< QString >::iterator it
const PluginKeyMapConstIterator cend
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
#define qCDebug(category,...)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLboolean GLboolean GLboolean b
GLint GLenum GLint components
GLenum GLuint GLenum GLsizei length
GLsizei const GLuint * paths
GLsizei const GLchar *const * path
static qreal dot(const QPointF &a, const QPointF &b)
bool QQml_isFileCaseCorrect(const QString &fileName, int lengthIn)
Returns true if the case of fileName is equivalent to the file case of fileName on disk,...
#define DEFINE_BOOL_CONFIG_OPTION(name, var)
#define RESOLVE_TYPE_DEBUG
static const QLatin1Char Backslash('\\')
static const QLatin1Char Dot('.')
static const QString dotuidotqml_string(QStringLiteral(".ui.qml"))
static const QLatin1Char Colon(':')
static const QLatin1String Slash_qmldir("/qmldir")
static const QLatin1Char Slash('/')
void findCompositeSingletons(const QQmlImportNamespace &set, QList< QQmlImports::CompositeSingletonReference > &resultList, const QUrl &baseUrl)
static bool designerSupportRequired
static QQmlImportInstance * addImportToNamespace(QQmlImportNamespace *nameSpace, const QString &uri, const QString &url, QTypeRevision version, QV4::CompiledData::Import::ImportType type, QList< QQmlError > *errors, quint16 precedence)
bool excludeBaseUrl(const QString &importUrl, const QString &fileName, const QString &baseUrl)
static const QLatin1String String_qmldir("qmldir")
static QStringList parseEnvPath(const QString &envImportPath)
static const QString dotqml_string(QStringLiteral(".qml"))
const QLoggingCategory & lcQmlImport()
const QLoggingCategory & lcQmlImport()
QStringList qQmlResolveImportPaths(QStringView uri, const QStringList &basePaths, QTypeRevision version)
static QUrl resolvedUrl(const QUrl &url, const QQmlRefPointer< QQmlContextData > &context)
static QLatin1StringView typeStr(QShaderDescription::VariableType t)
static QString canonicalPath(const QString &rootPath)
#define qPrintable(string)
QLatin1StringView QLatin1String
#define QStringLiteral(str)
QString qEnvironmentVariable(const char *varName, const QString &defaultValue)
Q_CORE_EXPORT bool qEnvironmentVariableIsEmpty(const char *varName) noexcept
static QV4::CompiledData::Lookup::Mode lookupMode(QV4::Compiler::JSUnitGenerator::LookupMode mode)
QFuture< QSet< QChar > > set
[10]
QUrl url("example.com")
[constructor-url-reference]
char * toString(const MyType &t)
[31]
\inmodule QtCore \reentrant
QQmlDirComponents qmlDirComponents
bool resolveType(QQmlTypeLoader *typeLoader, const QHashedStringRef &type, QTypeRevision *version_return, QQmlType *type_return, const QString *base=nullptr, bool *typeRecursionDetected=nullptr, QQmlType::RegistrationType=QQmlType::AnyRegistrationType, QQmlImport::RecursionRestriction recursionRestriction=QQmlImport::PreventRecursion, QList< QQmlError > *errors=nullptr) const
bool setQmldirContent(const QString &resolvedUrl, const QQmlTypeLoaderQmldirContent &qmldir, QQmlImportNamespace *nameSpace, QList< QQmlError > *errors)
QQmlDirScripts qmlDirScripts
static QQmlDirScripts getVersionedScripts(const QQmlDirScripts &qmldirscripts, QTypeRevision version)