Qt 4.8
|
The QDeclarativeCustomParser class allows you to add new arbitrary types to QML. More...
#include <qdeclarativecustomparser_p.h>
Public Types | |
enum | Flag { NoFlag = 0x00000000, AcceptsAttachedProperties = 0x00000001 } |
Public Functions | |
void | clearErrors () |
virtual QByteArray | compile (const QList< QDeclarativeCustomParserProperty > &)=0 |
QList< QDeclarativeError > | errors () const |
Flags | flags () const |
QDeclarativeCustomParser () | |
QDeclarativeCustomParser (Flags f) | |
virtual void | setCustomData (QObject *, const QByteArray &)=0 |
virtual | ~QDeclarativeCustomParser () |
Protected Functions | |
void | error (const QString &description) |
Reports an error with the given description. More... | |
void | error (const QDeclarativeCustomParserProperty &, const QString &description) |
Reports an error in parsing prop, with the given description. More... | |
void | error (const QDeclarativeCustomParserNode &, const QString &description) |
Reports an error in parsing node, with the given description. More... | |
int | evaluateEnum (const QByteArray &) const |
If script is a simply enum expression (eg. More... | |
const QMetaObject * | resolveType (const QByteArray &) const |
Resolves name to a type, or 0 if it is not a type. More... | |
QDeclarativeBinding::Identifier | rewriteBinding (const QString &, const QByteArray &) |
Rewrites expression and returns an identifier that can be used to construct the binding later. More... | |
Properties | |
QDeclarativeCompiler * | compiler |
QList< QDeclarativeError > | exceptions |
Flags | m_flags |
QDeclarativeParser::Object * | object |
Friends | |
class | QDeclarativeCompiler |
The QDeclarativeCustomParser class allows you to add new arbitrary types to QML.
By subclassing QDeclarativeCustomParser, you can add a parser for building a particular type.
The subclass must implement compile() and setCustomData(), and register itself in the meta type system by calling the macro:
Definition at line 114 of file qdeclarativecustomparser_p.h.
Enumerator | |
---|---|
NoFlag | |
AcceptsAttachedProperties |
Definition at line 117 of file qdeclarativecustomparser_p.h.
|
inline |
Definition at line 123 of file qdeclarativecustomparser_p.h.
|
inline |
Definition at line 124 of file qdeclarativecustomparser_p.h.
|
inlinevirtual |
Definition at line 125 of file qdeclarativecustomparser_p.h.
void QDeclarativeCustomParser::clearErrors | ( | ) |
Definition at line 237 of file qdeclarativecustomparser.cpp.
Referenced by QDeclarativeCompiler::buildObject().
|
pure virtual |
Implemented in QDeclarativeListModelParser, QDeclarativePropertyChangesParser, QDeclarativeConnectionsParser, and QDeclarativeGestureAreaParser.
Referenced by QDeclarativeCompiler::buildObject().
|
protected |
Reports an error with the given description.
This can only be used during the compile() step. For errors during setCustomData(), use qmlInfo().
An error is generated referring to the position of the element in the source file.
Definition at line 249 of file qdeclarativecustomparser.cpp.
|
protected |
Reports an error in parsing prop, with the given description.
An error is generated referring to the position of node in the source file.
Definition at line 265 of file qdeclarativecustomparser.cpp.
|
protected |
Reports an error in parsing node, with the given description.
An error is generated referring to the position of node in the source file.
Definition at line 280 of file qdeclarativecustomparser.cpp.
|
inline |
Definition at line 133 of file qdeclarativecustomparser_p.h.
Referenced by QDeclarativeCompiler::buildObject().
|
protected |
If script is a simply enum expression (eg.
Text.AlignLeft), returns the integer equivalent (eg. 1).
Otherwise, returns -1.
Definition at line 296 of file qdeclarativecustomparser.cpp.
|
inline |
Definition at line 128 of file qdeclarativecustomparser_p.h.
Referenced by QDeclarativeCompiler::buildObject().
|
protected |
Resolves name to a type, or 0 if it is not a type.
This can be used to type-check object nodes.
Definition at line 305 of file qdeclarativecustomparser.cpp.
|
protected |
Rewrites expression and returns an identifier that can be used to construct the binding later.
name is used as the name of the rewritten function.
Definition at line 315 of file qdeclarativecustomparser.cpp.
|
pure virtual |
Implemented in QDeclarativeListModelParser, QDeclarativePropertyChangesParser, QDeclarativeConnectionsParser, and QDeclarativeGestureAreaParser.
Referenced by QDeclarativeVME::run().
|
friend |
Definition at line 151 of file qdeclarativecustomparser_p.h.
|
private |
Definition at line 148 of file qdeclarativecustomparser_p.h.
Referenced by QDeclarativeCompiler::buildObject().
|
private |
Definition at line 147 of file qdeclarativecustomparser_p.h.
|
private |
Definition at line 150 of file qdeclarativecustomparser_p.h.
|
private |
Definition at line 149 of file qdeclarativecustomparser_p.h.
Referenced by QDeclarativeCompiler::buildObject().