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"
66 return holder.category();
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;
151#if defined(Q_OS_UNIX)
240 for (
int ii =
set.imports.size() - 1; ii >= 0; --ii) {
256 for (
int ii =
set.imports.size() - 1; ii >= 0; --ii) {
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))
307 ref.typeName = cit->typeName;
309 ref.version = cit->version;
315 module->walkCompositeSingletons([&resultList, &
set, &shouldSkipSingleton](
const QQmlType &singleton) {
316 if (shouldSkipSingleton(singleton.
version()))
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;
378 for (
int ii =
set.imports.size() - 1; ii >= 0; --ii) {
383 ref.nameSpace = script.nameSpace;
392 for (
int ii =
set.imports.size() - 1; ii >= 0; --ii) {
397 ref.nameSpace = script.nameSpace;
398 ref.qualifier =
set.prefix;
464 if (
resolveType(
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()) {
480#undef RESOLVE_TYPE_DEBUG
512 if ((*
it !=
this) && ((*it)->uri ==
uri)) {
514 error.setDescription(
515 QQmlImportDatabase::tr(
"\"%1\" is ambiguous. Found in %2 and in %3")
516 .arg(
uri,
url, (*it)->url));
534 sit != qmldirscripts.
constEnd(); ++sit) {
541 if (vit == versioned.
end()
542 || (vit->version.minorVersion() < sit->version.minorVersion())) {
543 versioned.
insert(sit->nameSpace, *sit);
548 return versioned.
values();
596 switch (registrationType) {
615 if ((candidate ==
end)
616 || (
c.version.majorVersion() > candidate->version.majorVersion())
617 || ((
c.version.majorVersion() == candidate->version.majorVersion())
618 && (
c.version.minorVersion() > candidate->version.minorVersion()))) {
622 if (resolveLocalUrl(*
base,
c.fileName) != componentUrl)
626 const bool recursion = *
base == componentUrl;
627 if (typeRecursionDetected)
628 *typeRecursionDetected = recursion;
642 if (candidate !=
end) {
646 nullptr, candidate->version);
648 *version_return = candidate->version;
650 *type_return = returnType;
656 if (localDirectoryPath.
isEmpty())
666 for (
const QString &urlToTry : urlsToTry) {
667 exists = typeLoader->
fileExists(localDirectoryPath, urlToTry);
669#if defined(Q_OS_MACOS) || defined(Q_OS_WIN)
676 errors->
append(caseError);
683 qmlUrl =
url + urlToTry;
689 const bool recursion =
base && *
base == qmlUrl;
690 if (typeRecursionDetected)
691 *typeRecursionDetected = recursion;
699 *type_return = returnType;
711 bool *typeRecursionDetected)
const
714 auto resolveTypeInNamespace = [&](
717 if (nameSpace->resolveType(
718 m_typeLoader, unqualifiedtype, version_return, type_return, &m_base, errors,
719 registrationType, typeRecursionDetected))
721 if (nameSpace->imports.size() == 1
722 && !nameSpace->imports.at(0)->isLibrary
724 && nameSpace != &m_unqualifiedset) {
727 resolveLocalUrl(nameSpace->imports.at(0)->url,
734 switch (splitName.
size()) {
737 return resolveTypeInNamespace(
type, &m_unqualifiedset, errors);
744 return resolveTypeInNamespace(splitName.
at(1),
s, errors);
746 if (resolveTypeInNamespace(splitName.
at(0), &m_unqualifiedset,
nullptr)) {
749 type_return->
sourceUrl(), splitName.
at(1).toString());
755 error.setDescription(QQmlImportDatabase::tr(
"- %1 is neither a type nor a namespace").
arg(splitName.
at(0).toString()));
767 error.setDescription(QQmlImportDatabase::tr(
"- %1 is not a namespace").
arg(splitName.
at(0).toString()));
769 if (resolveTypeInNamespace(splitName.
at(1),
s,
nullptr)) {
771 type_return->
sourceUrl(), splitName.
at(2).toString());
774 error.setDescription(QQmlImportDatabase::tr(
"- %1 is not a type").
arg(splitName.
at(1).toString()));
786 error.setDescription(QQmlImportDatabase::tr(
"- nested namespaces not allowed"));
798 if (import->uri == uri)
808 bool *typeRecursionDetected)
813 bool localTypeRecursionDetected =
false;
814 if (!typeRecursionDetected)
815 typeRecursionDetected = &localTypeRecursionDetected;
820 return import->isInlineComponent;
826 if (import->resolveType(typeLoader,
type, version_return, type_return,
base,
827 typeRecursionDetected, registrationType, recursionRestriction, errors)) {
828 if (qmlCheckTypes()) {
833 nullptr, registrationType)) {
843 if (
u1.startsWith(
b))
846 u1 = QQmlImportDatabase::tr(
"local directory");
847 if (
u2.startsWith(
b))
848 u2 =
u2.mid(
b.size());
850 u2 = QQmlImportDatabase::tr(
"local directory");
856 error.setDescription(
857 QQmlImportDatabase::tr(
858 "is ambiguous. Found in %1 and in %2")
861 error.setDescription(
862 QQmlImportDatabase::tr(
863 "is ambiguous. Found in %1 in version "
866 .
arg(import->version.majorVersion())
867 .arg(import->version.minorVersion())
882 if (*typeRecursionDetected)
883 error.setDescription(QQmlImportDatabase::tr(
"is instantiated recursively"));
885 error.setDescription(QQmlImportDatabase::tr(
"is not a type"));
894 if (prefix ==
ns->prefix)
915 error.setDescription(
916 QQmlImportDatabase::tr(
"module does not support the designer \"%1\"")
928 return importer.importPlugins();
931bool QQmlImports::getQmldirContent(
const QString &qmldirIdentifier,
const QString &uri,
938 if ((*qmldir).hasContent()) {
940 if ((*qmldir).hasError()) {
943 for (
int i = 0;
i < qmldirErrors.
size(); ++
i) {
962 if (!
paths.isEmpty())
963 std::sort(
paths.begin(),
paths.end(), std::greater<QString>());
977 if (versionDot >= 0) {
978 int nextSlash = stableRelativePath.
indexOf(
Slash, versionDot);
980 stableRelativePath.
remove(versionDot, nextSlash - versionDot);
982 stableRelativePath = stableRelativePath.
left(versionDot);
987 return stableRelativePath;
1000 const auto eos =
path.size();
1001 qsizetype terminatingSlashPos = firstPlus + 1;
1002 while (terminatingSlashPos != eos &&
path.at(terminatingSlashPos) != u
'/')
1003 ++terminatingSlashPos;
1004 path.remove(firstPlus, terminatingSlashPos - firstPlus + 1);
1005 firstPlus =
path.indexOf(u
'+', firstPlus);
1006 }
while (firstPlus != -1);
1031 int bestMajorVersion = -1;
1032 quint8 lowestMinorVersion = std::numeric_limits<quint8>::max();
1033 quint8 highestMinorVersion = 0;
1036 if (!newVersion.hasMajorVersion())
1039 if (newVersion.majorVersion() > bestMajorVersion) {
1040 bestMajorVersion = newVersion.majorVersion();
1041 if (newVersion.hasMinorVersion()) {
1042 lowestMinorVersion = newVersion.minorVersion();
1043 highestMinorVersion = newVersion.minorVersion();
1045 }
else if (newVersion.majorVersion() == bestMajorVersion
1046 && newVersion.hasMinorVersion()) {
1047 lowestMinorVersion =
qMin(lowestMinorVersion, newVersion.minorVersion());
1048 highestMinorVersion =
qMax(highestMinorVersion, newVersion.minorVersion());
1059 for (ConstIterator cit =
components.constBegin(); cit !=
cend; ++cit) {
1060 for (ConstIterator cit2 =
components.constBegin(); cit2 != cit; ++cit2) {
1061 if (cit2->typeName == cit->typeName && cit2->version == cit->version) {
1063 const auto comp2PotentialFileSelectorPos = cit2->fileName.indexOf(u
'+');
1064 const bool comp2MightHaveFileSelector = comp2PotentialFileSelectorPos != -1;
1070 QString compFileName1 = cit->fileName;
1071 QString compFileName2 = cit2->fileName;
1072 if (
auto fileSelectorPos1 = compFileName1.
indexOf(u
'+'); fileSelectorPos1 != -1) {
1076 comp2PotentialFileSelectorPos)
1079 baseFileName2ConflictingComponents.
insert(baseName, cit);
1080 baseFileName2ConflictingComponents.
insert(baseName, cit2);
1084 }
else if (comp2MightHaveFileSelector) {
1087 baseFileName2ConflictingComponents.
insert(compFileName1, cit2);
1094 error.setDescription(QQmlImportDatabase::tr(
"\"%1\" version %2.%3 is defined more than once in module \"%4\"")
1095 .
arg(cit->typeName).arg(cit->version.majorVersion())
1096 .arg(cit->version.minorVersion()).arg(uri));
1102 addVersion(cit->version);
1106 for (
auto keyIt = baseFileName2ConflictingComponents.
keyBegin(); keyIt != baseFileName2ConflictingComponents.
keyEnd(); ++keyIt) {
1107 const QString& baseFileName = *keyIt;
1108 const auto conflictingComponents = baseFileName2ConflictingComponents.
values(baseFileName);
1109 for (ConstIterator
component: conflictingComponents)
1116 SConstIterator send = scripts.
constEnd();
1117 for (SConstIterator sit = scripts.
constBegin(); sit != send; ++sit) {
1118 for (SConstIterator sit2 = scripts.
constBegin(); sit2 != sit; ++sit2) {
1119 if (sit2->nameSpace == sit->nameSpace && sit2->version == sit->version) {
1122 error.setDescription(QQmlImportDatabase::tr(
"\"%1\" version %2.%3 is defined more than once in module \"%4\"")
1123 .arg(sit->nameSpace).arg(sit->version.majorVersion())
1124 .arg(sit->version.minorVersion()).arg(uri));
1130 addVersion(sit->version);
1135 && (bestMajorVersion < 0
1139 errors->
prepend(moduleNotFoundError(uri, version));
1144 if (bestMajorVersion < 0)
1151 : highestMinorVersion);
1159 nameSpace = &m_unqualifiedset;
1161 nameSpace = findQualifiedNamespace(prefix);
1165 nameSpace->
prefix = prefix;
1166 m_qualifiedSets.
append(nameSpace);
1185 import->version = version;
1187 import->precedence = precedence;
1192 if ((*it)->precedence < precedence)
1212 << uri <<
"version '" << version <<
"'" <<
"as" << prefix;
1218 nameSpace, uri, qmldirUrl, version,
1226 if (!qmldirIdentifier.
isEmpty()) {
1227 if (!getQmldirContent(qmldirIdentifier, uri, &qmldir, errors))
1231 version = importExtension(uri, version, database, &qmldir, errors);
1242 if (matchingVersion.
isValid())
1243 return matchingVersion;
1252 errors->
prepend(moduleNotFoundError(uri, relevantVersion(uri, version)));
1256 version = matchingQmldirVersion(qmldir, uri, version, errors);
1296 << uri << version <<
"as" << prefix;
1302 error.setDescription(QQmlImportDatabase::tr(
1303 "\"%1\" is not a valid import URL. "
1304 "You can pass relative paths or URLs with schema, but not "
1305 "absolute paths or resource paths. Try \"%2\".").
arg(uri, fix));
1334 error.setDescription(QQmlImportDatabase::tr(
"\"%1\": no such directory").
arg(uri));
1343 importUri = resolvedUri(
dir, database);
1348 qmldirIdentifier = localFileOrQrc;
1350 *localQmldir = qmldirIdentifier;
1357 error.setDescription(QQmlImportDatabase::tr(
"import \"%1\" has no qmldir and no namespace").
arg(importUri));
1370 error.setDescription(
1371 QQmlImportDatabase::tr(
"Cannot resolve URL for import \"%1\"").
arg(uri));
1372 error.setUrl(m_baseUrl);
1387 if ((*it)->url ==
url) {
1388 (*it)->implicitlyImported =
true;
1396 if (!getQmldirContent(qmldirIdentifier, importUri, &qmldir, errors))
1403 importUri = qmldirUri;
1407 errors, precedence);
1410 version = importExtension(importUri, version, database, &qmldir, errors);
1423 errors, precedence);
1437 << uri <<
"to" << qmldirUrl <<
"as" << prefix;
1444 if (!getQmldirContent(qmldirIdentifier, uri, &qmldir, errors))
1449 uri, import->version, database, &qmldir, errors);
1453 if (import->setQmldirContent(qmldirUrl, qmldir, nameSpace, errors)) {
1454 if (import->qmlDirComponents.isEmpty() && import->qmlDirScripts.isEmpty()) {
1457 errors->
prepend(moduleNotFoundError(uri, relevantVersion(uri, version)));
1462 version = matchingQmldirVersion(qmldir, uri, version, errors);
1473 error.setDescription(QQmlTypeLoader::tr(
"Cannot update qmldir content for '%1'").
arg(uri));
1525 bool wasEmpty =
false;
1565 auto addEnvImportPath = [
this](
const char *
var) {
1568 for (
int ii =
paths.size() - 1; ii >= 0; --ii)
1574 addEnvImportPath(
"QML_IMPORT_PATH");
1575 addEnvImportPath(
"QML2_IMPORT_PATH");
1581 auto addEnvPluginPath = [
this](
const char *
var) {
1584 for (
int ii =
paths.size() - 1; ii >= 0; --ii)
1589 addEnvPluginPath(
"QML_PLUGIN_PATH");
1590#if defined(Q_OS_ANDROID)
1592 addEnvPluginPath(
"QT_BUNDLED_LIBS_PATH");
1593#elif defined(Q_OS_MACOS)
1597 if (CFBundleRef bundleRef = CFBundleGetMainBundle()) {
1602 if (
QCFString path = CFURLCopyFileSystemPath(absoluteUrlRef, kCFURLPOSIXPathStyle)) {
1619 filePluginPath =
paths;
1633 filePluginPath.prepend(
dir.canonicalPath());
1635 filePluginPath.prepend(
path);
1667 cPath =
dir.canonicalPath();
1674 if (fileImportPath.contains(cPath))
1675 fileImportPath.move(fileImportPath.indexOf(cPath), 0);
1677 fileImportPath.prepend(cPath);
1687 return fileImportPath;
1706 fileImportPath.clear();
1723 errors->
prepend(moduleNotFoundError(uri, version));
1732 errors->
prepend(moduleNotFoundError(uri, version));
1749void QQmlImportDatabase::clearDirCache()
1752 while (itr != qmldirCache.
constEnd()) {
1753 QmldirCache *
cache = *itr;
1755 QmldirCache *nextCache =
cache->next;
1762 qmldirCache.
clear();
static QString applicationDirPath()
Returns the directory that contains the application executable.
static constexpr QChar listSeparator() noexcept
\inmodule QtCore \reentrant
bool isAbsolute() const
Returns true if the file path is absolute, otherwise returns false (i.e.
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
void prepend(rvalue_ref t)
const_iterator cend() const noexcept
void append(parameter_type t)
const_iterator constEnd() const noexcept
const_iterator cbegin() const noexcept
iterator insert(const Key &key, const T &value)
QList< T > values() const
iterator find(const Key &key)
iterator find(const Key &key)
key_iterator keyBegin() const noexcept
QList< T > values() const
Returns a list containing all the values in the hash, in an arbitrary order.
const_iterator ConstIterator
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
bool isEmpty() const noexcept
friend class const_iterator
key_iterator keyEnd() const noexcept
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
QQmlTypeLoader typeLoader
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 QFile.
static QString urlToLocalFileOrQrc(const QString &)
If url is a local file returns a path suitable for passing to 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
bool resolveType(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
QList< CompositeSingletonReference > resolvedCompositeSingletons() const
static QString versionString(QTypeRevision version, ImportVersion importVersion)
QList< ScriptReference > resolvedScripts() const
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)
QTypeRevision addLibraryImport(QQmlImportDatabase *importDb, const QString &uri, const QString &prefix, QTypeRevision version, const QString &qmldirIdentifier, const QString &qmldirUrl, ImportFlags flags, quint16 precedence, QList< QQmlError > *errors)
QTypeRevision updateQmldirContent(QQmlImportDatabase *importDb, const QString &uri, const QString &prefix, const QString &qmldirIdentifier, const QString &qmldirUrl, QList< QQmlError > *errors)
QTypeRevision addFileImport(QQmlImportDatabase *importDb, const QString &uri, const QString &prefix, QTypeRevision version, ImportFlags flags, quint16 precedence, QString *localQmldir, 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()
QQmlDirScripts scripts() 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.
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)
bool isCompositeSingleton() const
QTypeRevision version() const
QByteArray typeName() const
bool isInlineComponentType() const
QString elementName() const
iterator erase(const_iterator i)
ConstIterator constEnd() const
ConstIterator constBegin() const
constexpr QStringView left(qsizetype n) const noexcept
QString toString() const
Returns a deep copy of this string view's data as a QString.
constexpr QStringView mid(qsizetype pos, qsizetype n=-1) const noexcept
Returns the substring of length length starting at position start in this object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
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.
QStringList split(const QString &sep, Qt::SplitBehavior behavior=Qt::KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Splits the string into substrings wherever sep occurs, and returns the list of those strings.
qsizetype size() const
Returns the number of characters in this string.
QString mid(qsizetype position, qsizetype n=-1) const
Returns a string that contains n characters of this string, starting at the specified position index.
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 isEmpty() const
Returns true if the string has no characters; 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...
QString left(qsizetype n) const
Returns a substring that contains the n leftmost characters of the string.
static QString static QString qsizetype indexOf(QChar c, qsizetype from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
QString & remove(qsizetype i, qsizetype len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
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...
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}.
static constexpr QTypeRevision fromMinorVersion(Minor minorVersion)
Produces a QTypeRevision from the given minorVersion with an invalid major version.
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)
static qreal component(const QPointF &point, unsigned int i)
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('/')
static QString pathWithoutFileSelectors(QString path, qsizetype firstPlus)
void findCompositeSingletons(const QQmlImportNamespace &set, QList< QQmlImports::CompositeSingletonReference > &resultList, const QUrl &baseUrl)
static bool designerSupportRequired
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]
QFileInfo fi("c:/temp/foo")
[newstuff]
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)
QVector< QQmlTypeModuleVersion > modules