Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QQmlJS::Dom::AttachedInfo Class Referenceabstract

Attached info creates a tree to attach extra info to DomItems. More...

#include <qqmldomattachedinfo_p.h>

+ Inheritance diagram for QQmlJS::Dom::AttachedInfo:
+ Collaboration diagram for QQmlJS::Dom::AttachedInfo:

Public Types

enum class  PathType { Relative , Canonical }
 
enum class  FindOption { None = 0 , SetRootTreePath = 0x1 , SetFoundTreePath = 0x2 , Default = 0x3 }
 
using Ptr = std::shared_ptr< AttachedInfo >
 
- Public Types inherited from QQmlJS::Dom::DomBase
using FilterT = function_ref< bool(DomItem &, const PathEls::PathComponent &, DomItem &)>
 

Public Member Functions

DomType kind () const override
 
Path canonicalPath (DomItem &self) const override
 
bool iterateDirectSubpaths (DomItem &self, DirectVisitor visitor) override
 
AttachedInfo::Ptr makeCopy (DomItem &self) const
 
Ptr parent () const
 
Path path () const
 
void setPath (Path p)
 
 AttachedInfo (Ptr parent=nullptr, Path p=Path())
 
 AttachedInfo (const AttachedInfo &o)
 
DomItem itemAtPath (DomItem &self, Path p, PathType pType=PathType::Relative) const
 
DomItem infoAtPath (DomItem &self, Path p, PathType pType=PathType::Relative) const
 
MutableDomItem ensureItemAtPath (MutableDomItem &self, Path p, PathType pType=PathType::Relative)
 
MutableDomItem ensureInfoAtPath (MutableDomItem &self, Path p, PathType pType=PathType::Relative)
 
virtual AttachedInfo::Ptr instantiate (AttachedInfo::Ptr parent, Path p=Path()) const =0
 
virtual DomItem infoItem (DomItem &self)=0
 
DomItem infoItem (DomItem &self) const
 
QMap< Path, PtrsubItems () const
 
void setSubItems (QMap< Path, Ptr > v)
 
- Public Member Functions inherited from QQmlJS::Dom::OwningItem
 OwningItem (const OwningItem &o)
 
 OwningItem (int derivedFrom=0)
 
 OwningItem (int derivedFrom, QDateTime lastDataUpdateAt)
 
 OwningItem (const OwningItem &&)=delete
 
OwningItemoperator= (const OwningItem &&)=delete
 
Path canonicalPath (DomItem &self) const override=0
 
bool iterateDirectSubpaths (DomItem &self, DirectVisitor) override
 
std::shared_ptr< OwningItemmakeCopy (DomItem &self) const
 
Path pathFromOwner () const
 
Path pathFromOwner (DomItem &) const override final
 
DomItem containingObject (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 (DomItem &self, ErrorMessage msg)
 
void addErrorLocal (ErrorMessage msg)
 
void clearErrors (ErrorGroups groups=ErrorGroups({}))
 
bool iterateErrors (DomItem &self, function_ref< bool(DomItem source, ErrorMessage msg)> visitor, Path inPath=Path())
 
QMultiMap< Path, ErrorMessagelocalErrors () const
 
virtual bool iterateSubOwners (DomItem &self, function_ref< bool(DomItem &owner)> visitor)
 
QBasicMutexmutex () const
 
- Public Member Functions inherited from QQmlJS::Dom::DomBase
virtual ~DomBase ()=default
 
DomBasedomBase ()
 
virtual DomType kind () const =0
 
virtual DomKind domKind () const
 
virtual Path pathFromOwner (DomItem &self) const =0
 
virtual Path canonicalPath (DomItem &self) const =0
 
virtual bool iterateDirectSubpaths (DomItem &self, DirectVisitor visitor)=0
 
bool iterateDirectSubpathsConst (DomItem &self, DirectVisitor) const
 
virtual DomItem containingObject (DomItem &self) const
 
virtual void dump (DomItem &, Sink sink, int indent, FilterT filter) const
 
virtual quintptr id () const
 
QString typeName () const
 
virtual QList< QStringfields (DomItem &self) const
 
virtual DomItem field (DomItem &self, QStringView name) const
 
virtual index_type indexes (DomItem &self) const
 
virtual DomItem index (DomItem &self, index_type index) const
 
virtual QSet< QString > const keys (DomItem &self) const
 
virtual DomItem key (DomItem &self, QString name) const
 
virtual QString canonicalFilePath (DomItem &self) const
 
virtual void writeOut (DomItem &self, OutWriter &lw) const
 
virtual QCborValue value () const
 

Static Public Member Functions

static Ptr ensure (Ptr self, Path path, PathType pType=PathType::Relative)
 Returns that the AttachedInfo corresponding to the given path, creating it if it does not exists.
 
static Ptr find (Ptr self, Path p, PathType pType=PathType::Relative)
 
static AttachedInfoLookupResult< PtrfindAttachedInfo (DomItem &item, QStringView treeFieldName, FindOptions options=AttachedInfo::FindOption::None)
 
static Ptr treePtr (DomItem &item, QStringView fieldName)
 
- Static Public Member Functions inherited from QQmlJS::Dom::OwningItem
static int nextRevision ()
 

Static Public Attributes

static constexpr DomType kindValue = DomType::AttachedInfo
 

Protected Attributes

Path m_path
 
std::weak_ptr< AttachedInfom_parent
 
QMap< Path, Ptrm_subItems
 

Additional Inherited Members

- Protected Member Functions inherited from QQmlJS::Dom::OwningItem
virtual std::shared_ptr< OwningItemdoCopy (DomItem &self) const =0
 

Detailed Description

Attached info creates a tree to attach extra info to DomItems.

Normally one uses the template AttachedInfoT<SpecificInfoToAttach>

static methods Attributes: \list

  • parent: parent AttachedInfo in tree (might be empty)
  • subItems: subItems of the tree (path -> AttachedInfo)
  • infoItem: the attached information \endlist
See also
QQmlJs::Dom::AttachedInfo

Definition at line 48 of file qqmldomattachedinfo_p.h.

Member Typedef Documentation

◆ Ptr

using QQmlJS::Dom::AttachedInfo::Ptr = std::shared_ptr<AttachedInfo>

Definition at line 66 of file qqmldomattachedinfo_p.h.

Member Enumeration Documentation

◆ FindOption

Enumerator
None 
SetRootTreePath 
SetFoundTreePath 
Default 

Definition at line 56 of file qqmldomattachedinfo_p.h.

◆ PathType

Enumerator
Relative 
Canonical 

Definition at line 51 of file qqmldomattachedinfo_p.h.

Constructor & Destructor Documentation

◆ AttachedInfo() [1/2]

QQmlJS::Dom::AttachedInfo::AttachedInfo ( Ptr  parent = nullptr,
Path  p = Path() 
)
inline

Definition at line 81 of file qqmldomattachedinfo_p.h.

◆ AttachedInfo() [2/2]

QQmlJS::Dom::AttachedInfo::AttachedInfo ( const AttachedInfo o)

Definition at line 201 of file qqmldomattachedinfo.cpp.

Member Function Documentation

◆ canonicalPath()

Path QQmlJS::Dom::AttachedInfo::canonicalPath ( DomItem self) const
inlineoverridevirtual

Implements QQmlJS::Dom::OwningItem.

Definition at line 69 of file qqmldomattachedinfo_p.h.

◆ ensure()

AttachedInfo::Ptr QQmlJS::Dom::AttachedInfo::ensure ( AttachedInfo::Ptr  self,
Path  path,
AttachedInfo::PathType  pType = PathType::Relative 
)
static

Returns that the AttachedInfo corresponding to the given path, creating it if it does not exists.

The path might be either a relative path or a canonical path, as specified by the PathType

Definition at line 213 of file qqmldomattachedinfo.cpp.

References Canonical, QString::insert(), QString::length(), QQmlJS::Dom::Path::mid(), path(), Q_ASSERT, and Relative.

+ Here is the call graph for this function:

◆ ensureInfoAtPath()

MutableDomItem QQmlJS::Dom::AttachedInfo::ensureInfoAtPath ( MutableDomItem self,
Path  p,
PathType  pType = PathType::Relative 
)
inline

Definition at line 128 of file qqmldomattachedinfo_p.h.

References QQmlJS::Dom::MutableDomItem::field().

+ Here is the call graph for this function:

◆ ensureItemAtPath()

MutableDomItem QQmlJS::Dom::AttachedInfo::ensureItemAtPath ( MutableDomItem self,
Path  p,
PathType  pType = PathType::Relative 
)
inline

Definition at line 113 of file qqmldomattachedinfo_p.h.

References QQmlJS::Dom::Path::field(), and QQmlJS::Dom::Path::key().

+ Here is the call graph for this function:

◆ find()

AttachedInfo::Ptr QQmlJS::Dom::AttachedInfo::find ( AttachedInfo::Ptr  self,
Path  p,
AttachedInfo::PathType  pType = PathType::Relative 
)
static

Definition at line 240 of file qqmldomattachedinfo.cpp.

References Canonical, QQmlJS::Dom::Path::dropFront(), QQmlJS::Dom::Path::head(), QString::length(), and QQmlJS::Dom::Path::mid().

Referenced by findAttachedInfo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ findAttachedInfo()

AttachedInfoLookupResult< AttachedInfo::Ptr > QQmlJS::Dom::AttachedInfo::findAttachedInfo ( DomItem item,
QStringView  treeFieldName,
FindOptions  options = AttachedInfo::FindOption::None 
)
static

Definition at line 260 of file qqmldomattachedinfo.cpp.

References QQmlJS::Dom::DomItem::canonicalPath(), QQmlJS::Dom::Path::field(), find(), item, QQmlJS::Dom::Path::key(), o, QQmlJS::Dom::DomItem::ownerAs(), Relative, SetFoundTreePath, and SetRootTreePath.

+ Here is the call graph for this function:

◆ infoAtPath()

DomItem QQmlJS::Dom::AttachedInfo::infoAtPath ( DomItem self,
Path  p,
PathType  pType = PathType::Relative 
) const
inline

Definition at line 108 of file qqmldomattachedinfo_p.h.

References QQmlJS::Dom::DomItem::field().

+ Here is the call graph for this function:

◆ infoItem() [1/2]

DomItem QQmlJS::Dom::AttachedInfo::infoItem ( DomItem self) const
inline

Definition at line 136 of file qqmldomattachedinfo_p.h.

◆ infoItem() [2/2]

virtual DomItem QQmlJS::Dom::AttachedInfo::infoItem ( DomItem self)
pure virtual

◆ instantiate()

virtual AttachedInfo::Ptr QQmlJS::Dom::AttachedInfo::instantiate ( AttachedInfo::Ptr  parent,
Path  p = Path() 
) const
pure virtual

◆ itemAtPath()

DomItem QQmlJS::Dom::AttachedInfo::itemAtPath ( DomItem self,
Path  p,
PathType  pType = PathType::Relative 
) const
inline

Definition at line 94 of file qqmldomattachedinfo_p.h.

References QQmlJS::Dom::Path::field(), and QQmlJS::Dom::Path::key().

+ Here is the call graph for this function:

◆ iterateDirectSubpaths()

bool QQmlJS::Dom::AttachedInfo::iterateDirectSubpaths ( DomItem self,
DirectVisitor  visitor 
)
overridevirtual

Implements QQmlJS::Dom::DomBase.

Definition at line 171 of file qqmldomattachedinfo.cpp.

References QMap< Key, T >::key(), map, and parent.

+ Here is the call graph for this function:

◆ kind()

DomType QQmlJS::Dom::AttachedInfo::kind ( ) const
inlineoverridevirtual

Implements QQmlJS::Dom::DomBase.

Definition at line 68 of file qqmldomattachedinfo_p.h.

◆ makeCopy()

AttachedInfo::Ptr QQmlJS::Dom::AttachedInfo::makeCopy ( DomItem self) const
inline

Definition at line 72 of file qqmldomattachedinfo_p.h.

◆ parent()

Ptr QQmlJS::Dom::AttachedInfo::parent ( ) const
inline

Definition at line 77 of file qqmldomattachedinfo_p.h.

◆ path()

Path QQmlJS::Dom::AttachedInfo::path ( ) const
inline

Definition at line 78 of file qqmldomattachedinfo_p.h.

Referenced by ensure().

+ Here is the caller graph for this function:

◆ setPath()

void QQmlJS::Dom::AttachedInfo::setPath ( Path  p)
inline

Definition at line 79 of file qqmldomattachedinfo_p.h.

◆ setSubItems()

void QQmlJS::Dom::AttachedInfo::setSubItems ( QMap< Path, Ptr v)
inline

Definition at line 143 of file qqmldomattachedinfo_p.h.

◆ subItems()

QMap< Path, Ptr > QQmlJS::Dom::AttachedInfo::subItems ( ) const
inline

Definition at line 140 of file qqmldomattachedinfo_p.h.

◆ treePtr()

static Ptr QQmlJS::Dom::AttachedInfo::treePtr ( DomItem item,
QStringView  fieldName 
)
inlinestatic

Definition at line 89 of file qqmldomattachedinfo_p.h.

References item.

Member Data Documentation

◆ kindValue

constexpr DomType QQmlJS::Dom::AttachedInfo::kindValue = DomType::AttachedInfo
staticconstexpr

Definition at line 65 of file qqmldomattachedinfo_p.h.

◆ m_parent

std::weak_ptr<AttachedInfo> QQmlJS::Dom::AttachedInfo::m_parent
protected

Definition at line 148 of file qqmldomattachedinfo_p.h.

◆ m_path

Path QQmlJS::Dom::AttachedInfo::m_path
protected

Definition at line 147 of file qqmldomattachedinfo_p.h.

◆ m_subItems

QMap<Path, Ptr> QQmlJS::Dom::AttachedInfo::m_subItems
protected

Definition at line 149 of file qqmldomattachedinfo_p.h.


The documentation for this class was generated from the following files: