QmlJS Namespace

Header: #include <QmlJS>

Namespaces

namespace PersistentTrie

Classes

class Bind
class Context
class Document
class Evaluate
class LibraryInfo
class Link
class ModelManagerInterface
class ScopeChain
class Snapshot
class Value
class ValueOwner
class ViewerContext

Functions

QString idOfObject(AST::Node *object, AST::UiScriptBinding **idBinding = nullptr)
AST::UiObjectInitializer *initializerOfObject(AST::Node *object)
bool maybeModuleVersion(const QString &version)
QString modulePath(const QString &name, const QString &version, const QStringList &importPaths)

Detailed Description

QML and JavaScript language support library

Namespaces

namespace QmlJS::PersistentTrie

Classes

class Bind

The Bind class collects information about a single Document. More...

class Context

The Context class holds information about relationships between documents in a Snapshot. More...

class Document

The Document class creates a QML or JavaScript document. More...

class Evaluate

The Evaluate class evaluates AST::Nodes to Values. More...

class LibraryInfo

The LibraryInfo class creates a QML library. More...

class Link

The Link class creates a Context for a Snapshot. More...

class ModelManagerInterface

The ModelManagerInterface class acts as an interface to the global state of the QmlJS code model. More...

class ScopeChain

The ScopeChain class describes the scopes used for global lookup in a specific location. More...

class Snapshot

The Snapshot class holds and offers access to a set of Document::Ptr and LibraryInfo instances. More...

class Value

The Value class is an abstract base class for the result of a JS expression. More...

class ValueOwner

The ValueOwner class manages the lifetime of QmlJS::Values. More...

class ViewerContext

The ViewerContext class encapsulate selector and paths for a given viewer. More...

Function Documentation

QString QmlJS::idOfObject(AST::Node *object, AST::UiScriptBinding **idBinding = nullptr)

\returnsthe value of the 'id:' binding in object idBinding optional out parameter to get the UiScriptBinding for the id binding

AST::UiObjectInitializer *QmlJS::initializerOfObject(AST::Node *object)

\returnsthe UiObjectInitializer if object is a UiObjectDefinition or UiObjectBinding, otherwise 0

bool QmlJS::maybeModuleVersion(const QString &version)

Permissive validation of a string representing a module version. version Returns True if \p version is a valid version format (<digit(s)>.<digit(s)>), if it is the undefined version (-1.-1) or if it is empty. False otherwise.

QString QmlJS::modulePath(const QString &name, const QString &version, const QStringList &importPaths)

Get the path of a module name version importPaths

Given the qualified \p name and \p version of a module, look for a valid path in \p importPaths. Most specific version are searched first, the version is searched also in parent modules. For example, given the \p name QtQml.Models and \p version 2.0, the following directories are searched in every element of \p importPath:

- QtQml/Models.2.0 - QtQml.2.0/Models - QtQml/Models.2 - QtQml.2/Models - QtQml/Models

Returns The module paths if found, an empty string otherwise

See also qmlimportscanner, in, and qtdeclarative/tools.