![]() |
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 arguments. More...
#include <qmlpropertyarguments.h>
Public Types | |
enum class | ParsingOptions { None = 0x0 , RequireQualifiedPath = 0x1 , IgnoreType = 0x2 } |
\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 {} |
bool | m_isList { false } |
Friends | |
ParsingOptions | operator& (ParsingOptions lhs, ParsingOptions rhs) |
ParsingOptions | operator| (ParsingOptions lhs, ParsingOptions rhs) |
Helper class for parsing QML property 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.
Enumerator | |
---|---|
None | |
RequireQualifiedPath | |
IgnoreType |
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.
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.
If the argument string is incorrect, outputs a warning using loc and returns nullopt
.
Definition at line 62 of file qmlpropertyarguments.cpp.
Referenced by CppCodeParser::processQmlProperties().
|
friend |
Definition at line 33 of file qmlpropertyarguments.h.
References operator&.
Referenced by operator&.
|
friend |
Definition at line 41 of file qmlpropertyarguments.h.
References operator|.
Referenced by operator|.
bool QmlPropertyArguments::m_isList { false } |
Definition at line 27 of file qmlpropertyarguments.h.
QString QmlPropertyArguments::m_module {} |
Definition at line 24 of file qmlpropertyarguments.h.
QString QmlPropertyArguments::m_name {} |
Definition at line 26 of file qmlpropertyarguments.h.
QString QmlPropertyArguments::m_qmltype {} |
Definition at line 25 of file qmlpropertyarguments.h.
QString QmlPropertyArguments::m_type {} |
Definition at line 23 of file qmlpropertyarguments.h.