|
Adds more groundwork for the Dom library.
QQml::Dom::Path represents a path in the Dom model.
It goes from an element of the Dom model (DomItem) to another.
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.
In this commit the element of the Dom Model (DomItem) is represented
just by a stub object, it will be added in a subsequent commit.
This commit also introduces the ErrorMessage object.
ErrorMessage is an object used to represent error, warning and other
messages in the Dom model.
Errors are grouped by tags (ErrorGroups).
ErrorMessages might have a unique identifying string (using a number
in a base library that cannot have a list of all possible errors does
not work well.
ErrorMessages should be localized and *can* be pre-registered, but
do not have to be.
ErrorMessages can be associated with a QQml::Dom::Path, a file and a
Sourcelocation. The path (if present) might allows one to show errors
also in more visual tools.
Task-number: QTBUG-74840
Change-Id: I77fb4b78e15ba3674d74937106d40dba4076cedc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|