Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
Path Class Reference

Represents an immutable JsonPath like path in the Qml code model (from a DomItem to another DomItem) More...

+ Collaboration diagram for Path:

Detailed Description

Represents an immutable JsonPath like path in the Qml code model (from a DomItem to another DomItem)

It can be created either from a string, with the path static functions or by modifying an existing path

Path qmlFilePath =
Path::fromString(u"$env.qmlFilesByPath[\"/path/to/file\"]");
Path imports = qmlFilePath.subField(u"imports")
Path currentComponentImports = Path::current(u"component").subField(u"imports");

This is a way to refer to elements in the Dom models that is not dependent from the source location, and thus can be used also be used in visual tools. A Path is quite stable toward reallocations or changes in the Dom model, and accessing it is safe even when "dangling", thus it is a good long term reference to an element in the Dom model.

Path objects are a value type that have a shared pointer to extra data if needed, thus one should use them as value objects. The implementation has still optimization potential, but the behavior for the user should be already the final one.

Path is both a range, and a single element (a bit like strings and characters in python).

The root contexts are: \list

  • \l{$modules} All the known modules (even not imported), this is a global, rename independent reference
  • \l{$cpp} The Cpp names (namespaces, and Cpp types) visible in the current component
  • \l{$libs} The plugins/libraries and their contents
  • \l{$top} A top level entry in the DOM model, either $env or $universe (stepping in the universe one looses the reference to its environment)
  • \l{$env} The environment containing the currently available modules, i.e. the top level entry in the DOM model
  • \l{$universe} The dom unverse used by ths environment, and potentially shared with others that contains all the known parse entries, and also the latest, potentially invalid entries
  • \l{$} ? undecided, one the previous ones? \endlist

The current contexts are: \list

  • \l{@obj} The current object (if in a map or list goes up until it is in the current object) .
  • \l{@component} The root object of the current component.
  • \l{@module} The current module instantiation.
  • \l{@ids} The ids in the current component.
  • \l{@types} All the types in the current component (reachable through imports, respecting renames)
  • \l{@lookupStrict} The strict lookup inside the current object: localJS, ids, properties, proto properties, component, its properties, global context, oterwise error
  • \l{@lookupDynamic} The default lookup inside the current object: localJS, ids, properties, proto properties, component, its properties, global context, ..
  • \l{@lookup} Either lookupStrict or lookupDynamic depending on the current component and context.
  • \l{@} ? undecided, one the previous ones \endlist

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