![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
Represents a consistent set of types organized in modules, it is the top level of the DOM. More...
#include <qqmldomtop_p.h>
Classes | |
| struct | LoadResult |
Public Types | |
| enum class | Option { Default = 0x0 , KeepValid = 0x1 , Exported = 0x2 , NoReload = 0x4 , WeakLoad = 0x8 , SingleThreaded = 0x10 , NoDependencies = 0x20 } |
| Public Types inherited from QQmlJS::Dom::DomTop | |
| using | Callback = DomItem::Callback |
| Public Types inherited from QQmlJS::Dom::DomBase | |
| using | FilterT = function_ref<bool(const DomItem &, const PathEls::PathComponent &, const DomItem &)> |
Public Member Functions | |
| Q_DECLARE_FLAGS (Options, Option) | |
| DomType | kind () const override |
| Path | canonicalPath () const override |
| bool | iterateDirectSubpaths (const DomItem &self, DirectVisitor) const override |
| DomItem | field (const DomItem &self, FieldName namename) const final override |
| std::shared_ptr< DomEnvironment > | makeCopy (const DomItem &self) const |
| bool | hasFile (const QString &filePath) const |
| void | loadFile (const FileToLoad &file, const Callback &callback, std::optional< DomType > fileType=std::optional< DomType >(), const ErrorHandler &hh=nullptr) |
| void | removePath (const QString &pathpath) |
| std::shared_ptr< DomUniverse > | universe () const |
| QSet< QString > | moduleIndexUris (const DomItem &self, EnvLookup lookup=EnvLookup::Normal) const |
| QSet< int > | moduleIndexMajorVersions (const DomItem &self, const QString &uri, EnvLookup lookup=EnvLookup::Normal) const |
| std::shared_ptr< ExternalItemInfoBase > | qmlDirWithPath (const DomItem &self, const QString &pathpath, EnvLookup options=EnvLookup::Normal) const |
| std::shared_ptr< ExternalItemInfo< QmlFile > > | qmlFileWithPath (const DomItem &self, const QString &pathpath, EnvLookup options=EnvLookup::Normal) const |
| QSet< QString > | qmlFilePaths (const DomItem &self, EnvLookup lookup=EnvLookup::Normal) const |
| std::shared_ptr< ExternalItemInfo< JsFile > > | jsFileWithPath (const DomItem &self, const QString &pathpath, EnvLookup options=EnvLookup::Normal) const |
| QSet< QString > | jsFilePaths (const DomItem &self, EnvLookup lookup=EnvLookup::Normal) const |
| DomEnvironment (const QStringList &loadPaths, Options options=Option::SingleThreaded, DomCreationOption domCreationOption=Default, const std::shared_ptr< DomUniverse > &universe=nullptr) | |
| DomEnvironment (const std::shared_ptr< DomEnvironment > &parent, const QStringList &loadPaths, Options options=Option::SingleThreaded, DomCreationOption domCreationOption=Default) | |
| DomEnvironment (const DomEnvironment &o)=delete | |
| void | addQmlFile (const std::shared_ptr< QmlFile > &file, AddOption optionoption=AddOption::KeepExisting) |
| void | addJsFile (const std::shared_ptr< JsFile > &file, AddOption optionoption=AddOption::KeepExisting) |
| bool | commitToBase (const DomItem &self, const std::shared_ptr< DomEnvironment > &validEnv=nullptr) |
| void | addDependenciesToLoad (const Path &pathpath) |
| void | addLoadInfo (const DomItem &self, const std::shared_ptr< LoadInfo > &loadInfo) |
| std::shared_ptr< LoadInfo > | loadInfo (const Path &pathpath) const |
| QList< Path > | loadInfoPaths () const |
| QHash< Path, std::shared_ptr< LoadInfo > > | loadInfos () const |
| void | loadPendingDependencies () |
| bool | finishLoadingDependencies (int waitMSec=30000) |
| void | addWorkForLoadInfo (const Path &elementCanonicalPath) |
| Options | options () const |
| std::shared_ptr< DomEnvironment > | base () const |
| QStringList | loadPaths () const |
| QList< Import > | implicitImports () const |
| void | addAllLoadedCallback (const DomItem &self, Callback cc) |
| void | clearReferenceCache () |
| void | setLoadPaths (const QStringList &vv) |
| void | setResourceFiles (const QStringList &vv) |
| template<typename T> | |
| LoadResult | insertOrUpdateExternalItemInfo (const QString &pathpath, std::shared_ptr< T > extItem) |
| template<typename T> | |
| void | addExternalItemInfo (const DomItem &newExtItem, const Callback &loadCallback, const Callback &endCallback) |
| void | populateFromQmlFile (MutableDomItem &&qmlFile) |
| DomCreationOption | domCreationOption () const |
| SemanticAnalysis | semanticAnalysis () |
| Path | canonicalPath (const DomItem &) const override |
| QQml::Dom::DomTop::loadFile. | |
| Public Member Functions inherited from QQmlJS::Dom::DomTop | |
| DomTop (int derivedFrom=0) | |
| DomTop (const DomTop &o) | |
| Path | canonicalPath (const DomItem &) const override |
| QQml::Dom::DomTop::loadFile. | |
| DomItem | containingObject (const DomItem &) const override |
| bool | iterateDirectSubpaths (const DomItem &self, DirectVisitor) const override |
| Public Member Functions inherited from QQmlJS::Dom::OwningItem | |
| OwningItem (const OwningItem &o) | |
| OwningItem (int derivedFrom=0) | |
| OwningItem (int derivedFrom, const QDateTime &lastDataUpdateAt) | |
| OwningItem (const OwningItem &&)=delete | |
| OwningItem & | operator= (const OwningItem &&)=delete |
| bool | iterateDirectSubpaths (const DomItem &self, DirectVisitor) const override |
| std::shared_ptr< OwningItem > | makeCopy (const DomItem &self) const |
| Path | pathFromOwner () const override final |
| DomItem | containingObject (const DomItem &self) const override |
| int | derivedFrom () const |
| virtual int | revision () const |
| QDateTime | createdAt () const |
| virtual QDateTime | lastDataUpdateAt () const |
| virtual void | refreshedDataAt (QDateTime tNew) |
| virtual bool | frozen () const |
| virtual bool | freeze () |
| QDateTime | frozenAt () const |
| virtual void | addError (const DomItem &self, ErrorMessage &&msg) |
| void | addErrorLocal (ErrorMessage &&msg) |
| void | clearErrors (const ErrorGroups &groupsgroups=ErrorGroups({})) |
| bool | iterateErrors (const DomItem &self, function_ref< bool(const DomItem &source, const ErrorMessage &msg)> visitor, const Path &inPath=Path()) |
| QMultiMap< Path, ErrorMessage > | localErrors () const |
| virtual bool | iterateSubOwners (const DomItem &self, function_ref< bool(const DomItem &owner)> visitor) |
| QBasicMutex * | mutex () const |
| Public Member Functions inherited from QQmlJS::Dom::DomBase | |
| virtual | ~DomBase ()=default |
| DomBase * | domBase () |
| const DomBase * | domBase () const |
| virtual DomKind | domKind () const |
| virtual void | dump (const DomItem &, const Sink &sinksink, int indent, FilterT filterfilter) const |
| virtual quintptr | id () const |
| QString | typeName () const |
| virtual QList< QString > | fields (const DomItem &self) const |
| virtual index_type | indexes (const DomItem &self) const |
| virtual DomItem | index (const DomItem &self, index_type indexindex) const |
| virtual QSet< QString > const | keys (const DomItem &self) const |
| virtual DomItem | key (const DomItem &self, const QString &namename) const |
| virtual QString | canonicalFilePath (const DomItem &self) const |
| virtual void | writeOut (const DomItem &self, OutWriter &lw) const |
| virtual QCborValue | value () const |
Static Public Member Functions | |
| static ErrorGroups | myErrors () |
| static std::shared_ptr< DomEnvironment > | create (const QStringList &loadPaths, Options options=Option::SingleThreaded, DomCreationOption creationOption=DomCreationOption::Default, const DomItem &universe=DomItem::empty) |
| static QList< Import > | defaultImplicitImports () |
| Static Public Member Functions inherited from QQmlJS::Dom::OwningItem | |
| static int | nextRevision () |
Static Public Attributes | |
| static constexpr DomType | kindValue = DomType::DomEnvironment |
Protected Member Functions | |
| std::shared_ptr< OwningItem > | doCopy (const DomItem &self) const override |
Friends | |
| class | RefCacheEntry |
Represents a consistent set of types organized in modules, it is the top level of the DOM.
The DomEnvironment keeps a pointer m_lastValidBase to the last used valid DomEnvironment in the commitToBase() method. This allows the qqmldomastcreator to commit lazily loaded dependencies to the valid environment used by qmlls.
Definition at line 601 of file qqmldomtop_p.h.
|
strong |
| Enumerator | |
|---|---|
| Default | |
| KeepValid | |
| Exported | |
| NoReload | |
| WeakLoad | |
| SingleThreaded | |
| NoDependencies | |
Definition at line 625 of file qqmldomtop_p.h.
|
explicit |
|
explicit |
|
delete |
| void QQmlJS::Dom::DomEnvironment::addAllLoadedCallback | ( | const DomItem & | self, |
| DomTop::Callback | c ) |
Definition at line 1461 of file qqmldomtop.cpp.
References QQmlJS::Dom::Path::Path().
Depending on the creation options, this function adds LoadInfo of the provided path
Definition at line 1081 of file qqmldomtop.cpp.
References addLoadInfo().
|
inline |
Definition at line 766 of file qqmldomtop_p.h.
References QQmlJS::Dom::DomItem::field().
| void QQmlJS::Dom::DomEnvironment::addJsFile | ( | const std::shared_ptr< JsFile > & | file, |
| AddOption | option = AddOption::KeepExisting ) |
Definition at line 1252 of file qqmldomtop.cpp.
| void QQmlJS::Dom::DomEnvironment::addLoadInfo | ( | const DomItem & | self, |
| const std::shared_ptr< LoadInfo > & | loadInfo ) |
Enqueues path to the m_loadsWithWork (queue of the pending "load" jobs). In simpler words, schedule the load of the dependencies of the path from loadInfo.
Definition at line 1096 of file qqmldomtop.cpp.
References QQmlJS::Dom::DomItem::addError(), QQmlJS::Dom::LoadInfo::Done, QQmlJS::Dom::ErrorGroups::error(), and myErrors().
Referenced by addDependenciesToLoad().
| void QQmlJS::Dom::DomEnvironment::addQmlFile | ( | const std::shared_ptr< QmlFile > & | file, |
| AddOption | option = AddOption::KeepExisting ) |
Definition at line 1237 of file qqmldomtop.cpp.
References domCreationOption(), QQmlJS::Dom::Extended, and semanticAnalysis().
Definition at line 1416 of file qqmldomtop.cpp.
| std::shared_ptr< DomEnvironment > QQmlJS::Dom::DomEnvironment::base | ( | ) | const |
Definition at line 1427 of file qqmldomtop.cpp.
Referenced by commitToBase().
|
overridevirtual |
Implements QQmlJS::Dom::DomTop.
Definition at line 755 of file qqmldomtop.cpp.
References QQmlJS::Dom::Env, and QQmlJS::Dom::Path::fromRoot().
|
overridevirtual |
QQml::Dom::DomTop::loadFile.
| filePath | the file path to load |
| logicalPath | the path from the |
| callback | a callback called with an canonical path, the old value, and the current value. |
| loadOptions | are if force is true the file is always read |
Implements QQmlJS::Dom::OwningItem.
Definition at line 144 of file qqmldomtop.cpp.
| void QQmlJS::Dom::DomEnvironment::clearReferenceCache | ( | ) |
Definition at line 1477 of file qqmldomtop.cpp.
| bool QQmlJS::Dom::DomEnvironment::commitToBase | ( | const DomItem & | self, |
| const std::shared_ptr< DomEnvironment > & | validEnv = nullptr ) |
Definition at line 1283 of file qqmldomtop.cpp.
References base().
|
static |
Definition at line 1217 of file qqmldomtop.cpp.
Definition at line 1450 of file qqmldomtop.cpp.
|
overrideprotectedvirtual |
Implements QQmlJS::Dom::OwningItem.
Definition at line 874 of file qqmldomtop.cpp.
Referenced by makeCopy().
|
inline |
Definition at line 801 of file qqmldomtop_p.h.
Referenced by addQmlFile().
|
finaloverridevirtual |
Reimplemented from QQmlJS::Dom::DomBase.
Definition at line 864 of file qqmldomtop.cpp.
References QQmlJS::Dom::DomBase::field().
| bool QQmlJS::Dom::DomEnvironment::finishLoadingDependencies | ( | int | waitMSec = 30000 | ) |
Definition at line 1388 of file qqmldomtop.cpp.
References QQmlJS::Dom::LoadInfo::Done, and loadPendingDependencies().
| bool QQmlJS::Dom::DomEnvironment::hasFile | ( | const QString & | filePath | ) | const |
Definition at line 885 of file qqmldomtop.cpp.
Definition at line 1456 of file qqmldomtop.cpp.
|
inline |
Definition at line 726 of file qqmldomtop_p.h.
References QQmlJS::Dom::BaseOnly.
|
overridevirtual |
Implements QQmlJS::Dom::DomBase.
Definition at line 760 of file qqmldomtop.cpp.
References universe().
| QSet< QString > QQmlJS::Dom::DomEnvironment::jsFilePaths | ( | const DomItem & | self, |
| EnvLookup | lookup = EnvLookup::Normal ) const |
Definition at line 1067 of file qqmldomtop.cpp.
| std::shared_ptr< ExternalItemInfo< JsFile > > QQmlJS::Dom::DomEnvironment::jsFileWithPath | ( | const DomItem & | self, |
| const QString & | path, | ||
| EnvLookup | options = EnvLookup::Normal ) const |
Definition at line 1062 of file qqmldomtop.cpp.
|
overridevirtual |
Implements QQmlJS::Dom::DomBase.
Definition at line 750 of file qqmldomtop.cpp.
References kindValue.
| void QQmlJS::Dom::DomEnvironment::loadFile | ( | const FileToLoad & | file, |
| const Callback & | callback, | ||
| std::optional< DomType > | fileType = std::optional<DomType>(), | ||
| const ErrorHandler & | h = nullptr ) |
Definition at line 889 of file qqmldomtop.cpp.
Definition at line 1118 of file qqmldomtop.cpp.
Definition at line 1130 of file qqmldomtop.cpp.
Definition at line 1124 of file qqmldomtop.cpp.
| QStringList QQmlJS::Dom::DomEnvironment::loadPaths | ( | ) | const |
Definition at line 1444 of file qqmldomtop.cpp.
| void QQmlJS::Dom::DomEnvironment::loadPendingDependencies | ( | ) |
Definition at line 1344 of file qqmldomtop.cpp.
References QQmlJS::Dom::DomItem::addError(), QQmlJS::Dom::ErrorGroups::error(), and myErrors().
Referenced by finishLoadingDependencies().
| std::shared_ptr< DomEnvironment > QQmlJS::Dom::DomEnvironment::makeCopy | ( | const DomItem & | self | ) | const |
Definition at line 869 of file qqmldomtop.cpp.
References doCopy().
| QSet< int > QQmlJS::Dom::DomEnvironment::moduleIndexMajorVersions | ( | const DomItem & | self, |
| const QString & | uri, | ||
| EnvLookup | lookup = EnvLookup::Normal ) const |
| QSet< QString > QQmlJS::Dom::DomEnvironment::moduleIndexUris | ( | const DomItem & | self, |
| EnvLookup | lookup = EnvLookup::Normal ) const |
|
static |
Definition at line 744 of file qqmldomtop.cpp.
Referenced by addLoadInfo(), QQmlJS::Dom::LoadInfo::advanceLoad(), QQmlJS::Dom::LoadInfo::doCopy(), QQmlJS::Dom::LoadInfo::finishedLoadingDep(), and loadPendingDependencies().
| DomEnvironment::Options QQmlJS::Dom::DomEnvironment::options | ( | ) | const |
Definition at line 1422 of file qqmldomtop.cpp.
Referenced by testing.tools.test_runner._TestCaseRunner::_NewImageArtifact(), testing.tools.test_runner._TestCaseRunner::_RegenerateIfNeeded(), testing.tools.test_runner.TestRunner::IsSkiaGoldEnabled(), testing.tools.test_runner._TestCaseRunner::TestPixel(), and testing.tools.test_runner._TestCaseRunner::TestText().
| void QQmlJS::Dom::DomEnvironment::populateFromQmlFile | ( | MutableDomItem && | qmlFile | ) |
Definition at line 1482 of file qqmldomtop.cpp.
References QQmlJS::Dom::CommentCollector::CommentCollector(), QQmlJS::Dom::CommentCollector::collectComments(), QQmlJS::Dom::Default, QQmlJS::Dom::Extended, and QQmlJS::Dom::Minimal.
| std::shared_ptr< ExternalItemInfoBase > QQmlJS::Dom::DomEnvironment::qmlDirWithPath | ( | const DomItem & | self, |
| const QString & | path, | ||
| EnvLookup | options = EnvLookup::Normal ) const |
| QSet< QString > QQmlJS::Dom::DomEnvironment::qmlFilePaths | ( | const DomItem & | self, |
| EnvLookup | lookup = EnvLookup::Normal ) const |
Definition at line 1051 of file qqmldomtop.cpp.
| std::shared_ptr< ExternalItemInfo< QmlFile > > QQmlJS::Dom::DomEnvironment::qmlFileWithPath | ( | const DomItem & | self, |
| const QString & | path, | ||
| EnvLookup | options = EnvLookup::Normal ) const |
Definition at line 1046 of file qqmldomtop.cpp.
Definition at line 1000 of file qqmldomtop.cpp.
| DomEnvironment::SemanticAnalysis QQmlJS::Dom::DomEnvironment::semanticAnalysis | ( | ) |
Do not call this method inside of DomEnvironment's constructor! It requires weak_from_this() that only works after the constructor call finished.
Definition at line 1153 of file qqmldomtop.cpp.
Referenced by addQmlFile().
| void QQmlJS::Dom::DomEnvironment::setLoadPaths | ( | const QStringList & | v | ) |
Definition at line 1432 of file qqmldomtop.cpp.
| void QQmlJS::Dom::DomEnvironment::setResourceFiles | ( | const QStringList & | v | ) |
Definition at line 1438 of file qqmldomtop.cpp.
| shared_ptr< DomUniverse > QQmlJS::Dom::DomEnvironment::universe | ( | ) | const |
Definition at line 1011 of file qqmldomtop.cpp.
Referenced by iterateDirectSubpaths().
|
friend |
Definition at line 804 of file qqmldomtop_p.h.
|
staticconstexpr |
Definition at line 638 of file qqmldomtop_p.h.
Referenced by kind().