![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
Helper class for parsing QML property and QML method arguments. More...
#include <qmlpropertyarguments.h>
Public Types | |
| enum class | ParsingOptions { None = 0x0 , RequireQualifiedPath = 0x1 , IgnoreType = 0x2 , ParseAsMethod = 0x4 } |
| \value None No options specified. More... | |
Static Public Member Functions | |
| static std::optional< QmlPropertyArguments > | parse (const QString &arg, const Location &loc, ParsingOptions opts=ParsingOptions::None) |
| Parses a QML property from the input string str, with parsing options opts. | |
Public Attributes | |
| QString | m_type {} |
| QString | m_module {} |
| QString | m_qmltype {} |
| QString | m_name {} |
| QString | m_params {} |
| bool | m_isList { false } |
Friends | |
| ParsingOptions | operator& (ParsingOptions lhs, ParsingOptions rhs) |
| ParsingOptions | operator| (ParsingOptions lhs, ParsingOptions rhs) |
Helper class for parsing QML property and QML method arguments.
Definition at line 15 of file qmlpropertyarguments.h.
|
strong |
\value None No options specified.
\value RequireQualifiedPath Require the path segment to be qualified with a QML type name. \value IgnoreType Don’t require a type segment when parsing. \value ParseAsMethod Parse input as a method, expecting to see also QML method/signal parameters.
| Enumerator | |
|---|---|
| None | |
| RequireQualifiedPath | |
| IgnoreType | |
| ParseAsMethod | |
Definition at line 17 of file qmlpropertyarguments.h.
|
static |
Parses a QML property from the input string str, with parsing options opts.
str contains the argument string passed to e.g. the \qmlproperty command.
A valid QML property has the following syntax:
\badcode <type> <QML-type>::<name> <type> <QML-module>::<QML-type>::<name>
In addition, if parsing option RequireQualifiedPath is not set, the following is also accepted:
\badcode <type> <name>
{ <type>} can be omitted if IgnoreType option is set.
This syntax is accepted in QmlDocVisitor where the associated QML type is already known.
If ParseAsMethod option is set, a parameter list enclosed in parentheses must appear at the end. An empty list, i.e. {()}, is accepted.
Returns a populated QmlPropertyArguments container with the property type (m_type), whether the type is a list type (m_isList), property name (m_name), and optionally, the parent QML type name (m_qmltype) and QML module name (m_module) if those were present in the argument string. For methods, the parameter list (m_params) is also set.
If the argument string is incorrect, outputs a warning using loc and returns nullopt.
Definition at line 70 of file qmlpropertyarguments.cpp.
Referenced by CppCodeParser::parseOtherFuncArg(), and CppCodeParser::processQmlProperties().
|
friend |
Definition at line 35 of file qmlpropertyarguments.h.
References operator&.
Referenced by operator&.
|
friend |
Definition at line 43 of file qmlpropertyarguments.h.
References operator|.
Referenced by operator|, and CppCodeParser::parseOtherFuncArg().
| bool QmlPropertyArguments::m_isList { false } |
Definition at line 29 of file qmlpropertyarguments.h.
| QString QmlPropertyArguments::m_module {} |
Definition at line 25 of file qmlpropertyarguments.h.
| QString QmlPropertyArguments::m_name {} |
Definition at line 27 of file qmlpropertyarguments.h.
| QString QmlPropertyArguments::m_params {} |
Definition at line 28 of file qmlpropertyarguments.h.
| QString QmlPropertyArguments::m_qmltype {} |
Definition at line 26 of file qmlpropertyarguments.h.
| QString QmlPropertyArguments::m_type {} |
Definition at line 24 of file qmlpropertyarguments.h.