![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
Abstract class common to all elements of the Qml code model. More...
Abstract class common to all elements of the Qml code model.
DomBase represents the base class common to all objects exposed by the Dom Model through a DomItem. Single inheritence is mandatory for the inline items (Empty, Map, List, ConstantData, Reference), so that the base pointer of the object can be used a base pointer of the superclass directly.
The subclass must have a
entry with its kind to enable casting usng the DomItem::as DomItem::ownerAs templates.
The minimal overload set to be usable consists of following methods: \list
{kind()} returns the kind of the current element:
{pathFromOwner()} returns the path from the owner to the current element
{canonicalPath()} returns the path
{iterateDirectSubpaths} iterates the direct subpaths/children and returns false if a quick end was requested: \endlist
But you probably want to subclass either DomElement
or OwningItem
for your element. DomElement
stores its pathFromOwner
, and computes the canonicalPath
from it and its owner. OwningItem
is the unit for updates to the Dom model, exposed changes always change at least one OwningItem
. They have their lifetime handled with shared_ptr
and own (i.e. are responsible of freeing) other items in them.