42 #include "private/qdeclarativecompiler_p.h" 44 #include "private/qdeclarativeparser_p.h" 45 #include "private/qdeclarativescriptparser_p.h" 48 #include "private/qmetaobjectbuilder_p.h" 49 #include "private/qdeclarativestringconverters_p.h" 50 #include "private/qdeclarativeengine_p.h" 53 #include "private/qdeclarativemetatype_p.h" 54 #include "private/qdeclarativecustomparser_p_p.h" 55 #include "private/qdeclarativecontext_p.h" 56 #include "private/qdeclarativecomponent_p.h" 58 #include "private/qdeclarativevmemetaobject_p.h" 59 #include "private/qdeclarativeexpression_p.h" 60 #include "private/qdeclarativeproperty_p.h" 61 #include "private/qdeclarativerewrite_p.h" 63 #include "private/qdeclarativeglobal_p.h" 64 #include "private/qdeclarativescriptparser_p.h" 65 #include "private/qdeclarativebinding_p.h" 66 #include "private/qdeclarativecompiledbindings_p.h" 67 #include "private/qdeclarativeglobalscriptclass_p.h" 75 #include <QtCore/qdebug.h> 76 #include <QtCore/qdatetime.h> 90 : output(0), engine(0), unitRoot(0), unit(0)
120 return !name.
isEmpty() && name.
at(0) >=
'A' && name.
at(0) <=
'Z';
132 'A' <= name.
at(2) &&
'Z' >= name.
at(2);
153 #define COMPILE_EXCEPTION(token, desc) \ 155 QString exceptionDescription; \ 156 QDeclarativeError error; \ 157 error.setUrl(output->url); \ 158 error.setLine((token)->location.start.line); \ 159 error.setColumn((token)->location.start.column); \ 160 error.setDescription(desc.trimmed()); \ 161 exceptions << error; \ 173 #define COMPILE_CHECK(a) \ 175 if (!a) return false; \ 218 if (
double(
uint(n)) != n)
221 if (!ok)
COMPILE_EXCEPTION(v, tr(
"Invalid property assignment: unsigned int expected"));
229 if (
double(
int(n)) != n)
245 if (!ok)
COMPILE_EXCEPTION(v, tr(
"Invalid property assignment: color expected"));
248 #ifndef QT_NO_DATESTRING 267 if (!ok)
COMPILE_EXCEPTION(v, tr(
"Invalid property assignment: datetime expected"));
270 #endif // QT_NO_DATESTRING 276 if (!ok)
COMPILE_EXCEPTION(v, tr(
"Invalid property assignment: point expected"));
304 if (!ok)
COMPILE_EXCEPTION(v, tr(
"Invalid property assignment: 3D vector expected"));
357 if (
double(
int(n)) == n) {
428 #ifndef QT_NO_DATESTRING 462 #endif // QT_NO_DATESTRING 469 float data[] = { float(point.
x()),
float(point.
y()) };
499 float data[] = { float(rect.
x()),
float(rect.
y()),
523 float data[] = { float(vector.
x()),
float(vector.
y()),
float(vector.
z()) };
588 for (
int ii = 0; ii < resolvedTypes.
count(); ++ii) {
599 err = tr(
"Element is not creatable.");
633 if (compilerStatDump())
677 Object::ScriptBlock::Pragmas pragmas = script.
script->
pragmas();
684 scriptBlock.
code = scriptCode;
691 iter != importedScripts.
end(); ++iter) {
693 importedScriptIndexes.
append(iter.key());
712 for (
int ii = 0; ii < importedScriptIndexes.
count(); ++ii)
786 if (prop->
name ==
"id") {
801 if (explicitProperty && !explicitProperty->
value) {
802 skipProperty = explicitProperty;
805 defaultProperty->
parent = obj;
819 defaultProperty->
addref();
823 defaultProperty->
addref();
834 if (prop == skipProperty)
836 if (prop->
name ==
"id")
839 bool canDefer =
false;
840 if (isCustomParser) {
860 if (canDefer && !deferredList.
isEmpty() &&
867 if (defaultProperty) {
870 bool canDefer =
false;
871 if (isCustomParser) {
885 if (canDefer && !deferredList.
isEmpty() &&
894 if (isCustomParser && !customProps.
isEmpty()) {
970 for (
int ii = 0; ii < vmeMetaData->
aliasCount; ++ii) {
1023 bool seenDefer =
false;
1062 if (v->
type == Value::SignalObject) {
1073 }
else if (v->
type == Value::SignalExpression) {
1162 if (!vprop->
values.isEmpty()) {
1229 id.setId.index = obj->
idIndex;
1255 if (idProp->
value || idProp->
values.count() > 1 || idProp->
values.at(0)->object)
1342 for (
int ii =
output->
types.count() - 1; ii >= 0; --ii) {
1361 if(name[0] >=
'A' && name[0] <=
'Z')
1362 name[0] = name[0] -
'A' +
'a';
1364 bool notInRevision =
false;
1389 prop->
index = sigIdx;
1392 if (prop->
values.at(0)->object) {
1394 prop->
values.at(0)->type = Value::SignalObject;
1396 prop->
values.at(0)->type = Value::SignalExpression;
1398 if (!prop->
values.at(0)->value.isScript())
1399 COMPILE_EXCEPTION(prop, tr(
"Cannot assign a value to a signal (expecting a script to be run)"));
1426 return p.
name() != 0;
1460 if (typeNamespace) {
1489 bool notInRevision =
false;
1491 if (prop->
index == -1 && notInRevision) {
1501 if (prop->
index != -1) {
1518 if (prop->
index != -1 &&
1540 prop->
values.at(0)->value.isString())
1547 }
else if (prop->
index == -1) {
1555 }
else if (prop->
value) {
1563 }
else if (prop->
type == qMetaTypeId<QDeclarativeScriptString>()) {
1633 for (
int ii = 0; ii < prop->
values.count(); ++ii) {
1636 if (v->
type == Value::CreatedObject) {
1639 if (listTypeIsInterface) {
1651 }
else if (v->
type == Value::PropertyBinding) {
1669 for (
int ii = 0; ii < prop->
values.count(); ++ii) {
1673 v->
type == Value::PropertyBinding ||
1674 v->
type == Value::Literal);
1676 if (v->
type == Value::CreatedObject) {
1688 }
else if (prop->
type == -1) {
1705 }
else if (v->
type == Value::PropertyBinding) {
1709 }
else if (v->
type == Value::Literal) {
1718 for (
int ii = 0; ii < prop->
onValues.count(); ++ii) {
1723 v->
type == Value::ValueInterceptor);
1725 if (v->
type == Value::ValueSource) {
1731 if (valueTypeProperty) {
1742 }
else if (v->
type == Value::ValueInterceptor) {
1748 if (valueTypeProperty) {
1767 prop->
values.count() > 1 ||
1768 prop->
values.at(0)->object)
1779 prop->
values.at(0)->type = Value::Id;
1854 if (prop->
values.count()) {
1885 if (prop->
values.count())
1919 if (prop->
values.count() > 1) {
1921 }
else if (prop->
values.count()) {
1930 bool isEnumAssignment =
false;
1932 if (isEnumAssignment) {
1933 value->
type = Value::Literal;
1938 reference.
value = value;
1942 value->
type = Value::PropertyBinding;
1946 value->
type = Value::Literal;
1950 for (
int ii = 0; ii < prop->
onValues.count(); ++ii) {
1979 bool assignedBinding =
false;
1980 for (
int ii = 0; ii < prop->
values.count(); ++ii) {
1983 v->
type = Value::CreatedObject;
1988 if (!listTypeIsInterface) {
1995 if (assignedBinding)
1998 assignedBinding =
true;
2000 v->
type = Value::PropertyBinding;
2014 if (prop->
values.count() > 1)
2017 if (prop->
values.at(0)->object)
2032 if (prop->
values.count() > 1)
2035 for (
int ii = 0; ii < prop->
values.count(); ++ii) {
2048 for (
int ii = 0; ii < prop->
onValues.count(); ++ii) {
2075 v->
type = Value::CreatedObject;
2077 }
else if (prop->
type == -1) {
2082 v->
type = Value::CreatedObject;
2097 bool isAssignable =
false;
2099 if (propertyMetaObject) {
2111 v->
type = Value::CreatedObject;
2117 component->
typeName =
"Qt/Component";
2121 componentValue->
object = root;
2160 bool isPropertyValue =
false;
2162 bool isPropertyInterceptor =
false;
2164 isPropertyValue = valueType->propertyValueSourceCast() != -1;
2165 isPropertyInterceptor = valueType->propertyValueInterceptorCast() != -1;
2168 if (isPropertyValue || isPropertyInterceptor) {
2174 v->
type = isPropertyValue ? Value::ValueSource : Value::ValueInterceptor;
2193 bool isEnumAssignment =
false;
2195 if (isEnumAssignment) {
2196 v->type = Value::Literal;
2202 v->type = Value::PropertyBinding;
2208 v->
type = Value::Literal;
2225 *isAssignment =
false;
2233 if (!
string.
at(0).isUpper())
2237 if (parts.
count() != 2)
2268 for (
int ii = metaObject->
enumeratorCount() - 1; value == -1 && ii >= 0; --ii) {
2276 v->
type = Value::Literal;
2278 *isAssignment =
true;
2320 bool isSharable =
false;
2349 bool seenDefaultProperty =
false;
2357 if (seenDefaultProperty)
2359 seenDefaultProperty =
true;
2367 COMPILE_EXCEPTION(&prop, tr(
"Property names cannot begin with an upper case letter"));
2381 COMPILE_EXCEPTION(obj, tr(
"Signal names cannot begin with an upper case letter"));
2384 methodNames.
insert(name);
2386 for (
int ii = 0; ii < obj->
dynamicSlots.count(); ++ii) {
2392 COMPILE_EXCEPTION(obj, tr(
"Method names cannot begin with an upper case letter"));
2395 methodNames.
insert(name);
2424 property->values.append(v);
2438 obj->dynamicProperties.isEmpty() &&
2439 obj->dynamicSignals.isEmpty() &&
2440 obj->dynamicSlots.isEmpty())
2445 QByteArray newClassName = obj->metatype->className();
2446 newClassName.
append(
"_QML_");
2447 int idx = classIndexCounter()->fetchAndAddRelaxed(1);
2452 if (lastSlash > -1) {
2463 bool hasAlias =
false;
2464 for (
int ii = 0; ii < obj->dynamicProperties.count(); ++ii) {
2467 int propIdx = obj->metaObject()->indexOfProperty(p.
name.
constData());
2468 if (-1 != propIdx) {
2475 (p.
type != Object::DynamicProperty::Alias ||
2480 int propertyType = 0;
2481 bool readonly =
false;
2483 case Object::DynamicProperty::Alias:
2487 case Object::DynamicProperty::CustomList:
2488 case Object::DynamicProperty::Custom:
2502 customTypeName = data->root->className();
2506 customTypeName = qmltype->
typeName();
2509 if (p.
type == Object::DynamicProperty::Custom) {
2510 type = customTypeName +
'*';
2514 type =
"QDeclarativeListProperty<";
2515 type.
append(customTypeName);
2517 propertyType = qMetaTypeId<QDeclarativeListProperty<QObject> >();
2521 case Object::DynamicProperty::Variant:
2525 case Object::DynamicProperty::Int:
2529 case Object::DynamicProperty::Bool:
2533 case Object::DynamicProperty::Real:
2541 case Object::DynamicProperty::Url:
2549 case Object::DynamicProperty::Time:
2553 case Object::DynamicProperty::Date:
2557 case Object::DynamicProperty::DateTime:
2565 dynamicData.
append((
char *)&propertyData,
sizeof(propertyData));
2573 for (
int ii = 0; ii < obj->dynamicProperties.count(); ++ii) {
2576 if (p.
type == Object::DynamicProperty::Alias) {
2588 for (
int ii = 0; ii < obj->dynamicSignals.count(); ++ii) {
2603 for (
int ii = 0; ii < obj->dynamicSlots.count(); ++ii) {
2620 funcScripts << funcScript;
2630 dynamicData.
append((
char *)&methodData,
sizeof(methodData));
2633 for (
int ii = 0; ii < obj->dynamicSlots.count(); ++ii) {
2634 const QString &funcScript = funcScripts.
at(ii);
2650 obj->synthdata = dynamicData;
2652 if (obj->synthCache) {
2653 obj->synthCache->release();
2654 obj->synthCache = 0;
2657 if (obj->type != -1) {
2662 obj->synthCache = cache;
2677 for (
int ii = 0; ii < val.
count(); ++ii) {
2682 COMPILE_EXCEPTION(v, tr(
"IDs must contain only letters, numbers, and underscores"));
2733 COMPILE_EXCEPTION(prop.
defaultValue, tr(
"Invalid alias reference. An alias reference must be specified as <id>, <id>.<property> or <id>.<value property>.<property>"));
2744 bool writable =
false;
2745 if (alias.
count() == 2 || alias.
count() == 3) {
2748 if (-1 == propIdx) {
2750 }
else if (propIdx > 0xFFFF) {
2760 if (alias.
count() == 3) {
2765 propIdx |= ((
unsigned int)aliasProperty.
type()) << 24;
2768 if (valueTypeIndex == -1)
2773 propIdx |= (valueTypeIndex << 16);
2779 typeName = aliasProperty.
typeName();
2786 typeName = typeName.
left(index);
2788 index = typeName.
indexOf(
"_QMLTYPE_");
2790 while (index != -1 && mo) {
2792 index = typeName.
indexOf(
"_QMLTYPE_");
2804 data.
append((
const char *)&propIdx,
sizeof(propIdx));
2805 data.
append((
const char *)&flags,
sizeof(flags));
2829 reference.
value = value;
2851 if (valueTypeProperty)
2853 ((valueTypeProperty->
type & 0xFF)) << 16 |
2854 ((prop->
index & 0xFF) << 24);
2872 Q_ASSERT(ref.bindingContext.owner == 0 ||
2873 (ref.bindingContext.owner != 0 && valueTypeProperty));
2874 if (ref.bindingContext.owner) {
2893 cache->
add(iter.key(), (*iter)->idIndex);
2905 valueTypeProp->
index);
2960 bool isSharable =
false;
2984 if (bindingCompiler.
isValid()) {
3002 qWarning().nospace() <<
" IDs Used: " << stat.
ids;
3008 if (0 == (ii % 10)) {
3009 if (ii) output.
append(
"\n");
3027 if (0 == (ii % 10)) {
3028 if (ii) output.
append(
"\n");
3067 while (!type && mo) {
3089 bool *notInRevision)
3091 if (notInRevision) *notInRevision =
false;
3097 object->synthCache?
object->synthCache:
output->
types.at(object->
type).propertyCache();
3100 if (notInRevision) *notInRevision =
false;
3106 if (notInRevision) *notInRevision =
true;
3116 if (propIndex != -1) {
3130 bool *notInRevision)
3132 if (notInRevision) *notInRevision =
false;
3138 object->synthCache?
object->synthCache:
output->
types.at(object->
type).propertyCache();
3146 if (notInRevision) *notInRevision =
true;
const QDeclarativeImports & imports() const
void addSignalProperty(Property *)
The QColor class provides colors based on RGB, HSV or CMYK values.
static void dump(const QByteArray &)
QDeclarativeParser::Object * context
QHash< QDeclarativeParser::Value *, BindingContext > signalExpressions
static QStringList astNodeToStringList(QDeclarativeJS::AST::Node *node)
QString scriptSource() const
const QString asString() const
void genObjectBody(QDeclarativeParser::Object *obj)
DEFINE_BOOL_CONFIG_OPTION(compilerDump, QML_COMPILER_DUMP)
qreal y() const
Returns the y-coordinate of the rectangle's top edge.
The QVector3D class represents a vector or vertex in 3D space.
The QHash::const_iterator class provides an STL-style const iterator for QHash and QMultiHash...
QColor Q_DECLARATIVE_PRIVATE_EXPORT colorFromString(const QString &, bool *ok=0)
QByteArray module() const
bool buildSubObject(QDeclarativeParser::Object *obj, const BindingContext &)
QDeclarativeImports imports
bool isLetter() const
Returns true if the character is a letter (Letter_* categories); otherwise returns false...
const QMetaObject * resolveType(const QByteArray &name) const
void setName(const QByteArray &name)
QList< Property * > attachedProperties
QList< QDeclarativeError > exceptions
#define QT_END_NAMESPACE
This macro expands to.
int propertyValueInterceptorCast() const
void addScriptStringProperty(Property *, int=0)
char * data()
Returns a pointer to the data stored in the byte array.
static bool ValuePtrLessThan(const QDeclarativeParser::Value *t1, const QDeclarativeParser::Value *t2)
const QChar at(int i) const
Returns the character at the given index position in the string.
int indexForString(const QString &)
bool buildPropertyObjectAssignment(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj, QDeclarativeParser::Value *value, const BindingContext &ctxt)
QUrl finalUrl() const
Returns the final url of the data.
QString toString(FormattingOptions options=None) const
Returns the human-displayable string representation of the URL.
int indexForByteArray(const QByteArray &)
The QAtomicInt class provides platform-independent atomic operations on integers. ...
void genComponent(QDeclarativeParser::Object *obj)
const QMetaObject * metaObject() const
static void reset(QDeclarativeCompiledData *)
Resets data by clearing the lists that the QDeclarativeCompiler modifies.
QByteArray & append(char c)
Appends the character ch to this byte array.
QByteArray toUtf8() const Q_REQUIRED_RESULT
Returns a UTF-8 representation of the string as a QByteArray.
QList< TypeReference * > referencedTypes() const
int indexForFloat(float *, int)
qreal width() const
Returns the width.
QList< int > listCommaPositions
#define at(className, varName)
The QByteArray class provides an array of bytes.
static Expression::Ptr create(Expression *const expr, const YYLTYPE &sourceLocator, const ParserContext *const parseInfo)
int length() const
Returns the number of characters in this string.
FetchAttachedInstruction fetchAttached
static QMetaMethod findSignalByName(const QMetaObject *mo, const QByteArray &)
Return the signal corresponding to name.
void genLiteralAssignment(const QMetaProperty &prop, QDeclarativeParser::Value *value)
Generate a store instruction for assigning literal v to property prop.
QDeclarativePropertyCache * cache(QObject *obj)
Returns a QDeclarativePropertyCache for obj if one is available.
QDeclarativeCompiledData * compiledData() const
bool canCoerce(int to, QDeclarativeParser::Object *from)
Returns true if from can be assigned to a (QObject) property of type to.
QDeclarativePropertyCache * typePropertyCache
The QPointF class defines a point in the plane using floating point precision.
qreal height() const
Returns the height.
QVector3D Q_DECLARATIVE_PRIVATE_EXPORT vector3DFromString(const QString &, bool *ok=0)
ComponentStat componentStat
QDeclarativeGlobalScriptClass * globalClass
int parserStatusCast() const
void add(const QString &, int)
QList< Property * > valueProperties
static const QMetaObject staticMetaObject
This variable stores the meta-object for the class.
Property * defaultProperty
QList< QDeclarativeParser::Object::ScriptBlock > scripts
int genValueTypeData(QDeclarativeParser::Property *prop, QDeclarativeParser::Property *valueTypeProp)
const QMetaObject * metaObject() const
bool doesPropertyExist(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj)
Returns true if (value) property prop exists on obj, false otherwise.
The QDate class provides date functions.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
QDeclarativeParser::Object * component
int msec() const
Returns the millisecond part (0 to 999) of the time.
bool resolveType(const QByteArray &type, QDeclarativeType **type_return, QUrl *url_return, int *version_major, int *version_minor, QDeclarativeImportedNamespace **ns_return, QString *errorString=0) const
The given (namespace qualified) type is resolved to either.
int count(const T &t) const
Returns the number of occurrences of value in the list.
void addAttachedProperty(Property *)
QDeclarativeParser::Property * property
int attachedPropertiesId() const
void genValueTypeProperty(QDeclarativeParser::Object *obj, QDeclarativeParser::Property *)
StoreBoolInstruction storeBool
qreal x() const
Returns the x coordinate of this point.
QDeclarativeParser::Object * root
bool testQualifiedEnumAssignment(const QMetaProperty &prop, QDeclarativeParser::Object *obj, QDeclarativeParser::Value *value, bool *isAssignment)
int genPropertyData(QDeclarativeParser::Property *prop)
The QUrl class provides a convenient interface for working with URLs.
QDeclarativeTypeLoader typeLoader
The QString class provides a Unicode character string.
bool checkDynamicMeta(QDeclarativeParser::Object *obj)
BindingContext incr() const
The QHash class is a template class that provides a hash-table-based dictionary.
static QDeclarativeType * toQmlType(QDeclarativeParser::Object *from)
#define COMPILE_EXCEPTION(token, desc)
Inserts an error into the QDeclarativeCompiler error list, and returns false (failure).
static const char * typeToName(Type type)
Converts the enum representation of the storage type, typ, to its string representation.
QList< QByteArray > parameterNames
The QObject class is the base class of all Qt objects.
bool startsWith(const QByteArray &a) const
Returns true if this byte array starts with byte array ba; otherwise returns false.
void genPropertyAssignment(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj, QDeclarativeParser::Property *valueTypeProperty=0)
QDateTime Q_DECLARATIVE_PRIVATE_EXPORT dateTimeFromString(const QString &, bool *ok=0)
static QDeclarativeEnginePrivate * get(QDeclarativeEngine *e)
LocationRange listValueRange
bool contains(const Key &key) const
Returns true if the hash contains an item with the key; otherwise returns false.
The QSizeF class defines the size of a two-dimensional object using floating point precision...
bool checkValidId(QDeclarativeParser::Value *, const QString &)
The QChar class provides a 16-bit Unicode character.
bool buildSignal(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj, const BindingContext &)
bool containsRevisionedAttributes() const
QDeclarativeParser::Property * property
ComponentCompileState componentState(QDeclarativeParser::Object *)
QDeclarativeTypeData * typeData
QList< QDeclarativeParser::LocationSpan > optimizedBindings
QDeclarativeEngine * engine
QRectF Q_DECLARATIVE_PRIVATE_EXPORT rectFFromString(const QString &, bool *ok=0)
QDeclarativePropertyCache * synthCache
AssignSignalObjectInstruction assignSignalObject
QString path() const
Returns the path of the URL.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
bool isLower() const
Returns true if the character is a lowercase letter, i.
qreal x() const
Returns the x-coordinate of this point.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
const QList< TypeReference > & resolvedTypes() const
QList< QByteArray > parameterTypes
bool completeComponentBuild()
QDeclarativePropertyCache * createPropertyCache(QDeclarativeEngine *)
Returns the property cache, creating one if it doesn't already exist.
const QMetaObject * metatype
int indexOfProperty(QDeclarativeParser::Object *, const QByteArray &, bool *notInRevision=0)
void append(const T &t)
Inserts value at the end of the list.
bool isError() const
Returns true if the last call to compile() caused errors.
QByteArray compiledBindingData
StoreMetaInstruction storeMeta
ComponentCompileState compileState
void genBindingAssignment(QDeclarativeParser::Value *binding, QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj, QDeclarativeParser::Property *valueTypeProperty=0)
FetchValueInstruction fetchValue
The QTime class provides clock time functions.
#define QT_BEGIN_NAMESPACE
This macro expands to.
QList< DynamicSlot > dynamicSlots
The QRectF class defines a rectangle in the plane using floating point precision. ...
QHash< QString, QDeclarativeParser::Object * > ids
int lastIndexOf(char c, int from=-1) const
Returns the index position of the last occurrence of character ch in the byte array, searching backward from index position from.
StoreUrlInstruction storeUrl
bool buildObject(QDeclarativeParser::Object *obj, const BindingContext &)
QByteArray typeName() const
QList< ComponentStat > savedComponentStats
QPointF Q_DECLARATIVE_PRIVATE_EXPORT pointFFromString(const QString &, bool *ok=0)
bool contains(const T &value) const
QString trimmed() const Q_REQUIRED_RESULT
Returns a string that has whitespace removed from the start and the end.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QList< QDeclarativeParser::Object * > refObjects
QByteArray bindingBitmask
QList< DynamicProperty > dynamicProperties
void saveComponentState()
StoreRealPairInstruction storeRealPair
bool buildPropertyOnAssignment(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj, QDeclarativeParser::Object *baseObj, QDeclarativeParser::Value *value, const BindingContext &ctxt)
qreal height() const
Returns the height of the rectangle.
bool buildIdProperty(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj)
static bool isAttachedPropertyName(const QByteArray &)
Returns true if name refers to an attached property, false otherwise.
bool buildComponent(QDeclarativeParser::Object *obj, const BindingContext &)
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
const T & at(int i) const
Returns the item at index position i in the list.
QList< QPair< Property *, int > > scriptStringProperties
QString description() const
Returns the error description.
The QStringList class provides a list of strings.
bool testLiteralAssignment(const QMetaProperty &prop, QDeclarativeParser::Value *value)
Returns true if literal v can be assigned to property prop, otherwise false.
StoreColorInstruction storeColor
bool buildGroupedProperty(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj, const BindingContext &ctxt)
Data * property(const QScriptDeclarativeClass::Identifier &id) const
int propertyValueSourceCast() const
QList< QDeclarativeError > errors() const
QDeclarativeAttachedPropertiesFunc attachedPropertiesFunction() const
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
Q_CORE_EXPORT void qWarning(const char *,...)
QDeclarativeCompiler * compiler
QList< DynamicSignal > dynamicSignals
int second() const
Returns the second part (0 to 59) of the time.
const_iterator insert(const T &value)
QDeclarativeCompiledData * output
static const char * data(const QByteArray &arr)
QString primitive() const
StoreTimeInstruction storeTime
StoreDateTimeInstruction storeDateTime
QList< QScriptProgram * > cachedPrograms
QDeclarativeParser::Object * unitRoot
qreal width() const
Returns the width of the rectangle.
QByteArray qmlTypeName() const
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
StoreFloatInstruction storeFloat
static void split(QT_FT_Vector *b)
The QDeclarativeError class encapsulates a QML error.
QList< QDeclarativeParser::LocationSpan > scriptBindings
QString noCreationReason() const
void clear()
Removes all items from the list.
QList< QDeclarativePropertyCache * > propertyCaches
int compile(const Expression &, QDeclarativeEnginePrivate *)
QByteArray left(int len) const
Returns a byte array that contains the leftmost len bytes of this byte array.
int minute() const
Returns the minute part (0 to 59) of the time.
static qreal component(const QPointF &point, unsigned int i)
#define COMPILE_CHECK(a)
Returns false if is false, otherwise does nothing.
qreal z() const
Returns the z coordinate of this point.
The QDeclarativeCustomParser class allows you to add new arbitrary types to QML.
QByteArray mid(int index, int len=-1) const
Returns a byte array containing len bytes from this byte array, starting at position pos...
int indexOf(char c, int from=0) const
Returns the index position of the first occurrence of the character ch in the byte array...
StoreObjectInstruction storeObject
QList< Property * > signalProperties
BindingContext bindingContext
QDeclarativeCompiledData * component
void addGroupedProperty(Property *)
void qSort(RandomAccessIterator start, RandomAccessIterator end)
Q_CORE_EXPORT int QT_FASTCALL script(uint ucs4)
QList< QString > primitives
QList< QScriptValue * > cachedClosures
bool buildValueTypeProperty(QObject *type, QDeclarativeParser::Object *obj, QDeclarativeParser::Object *baseObj, const BindingContext &ctxt)
Property * getDefaultProperty()
QDeclarativeScriptData * script
bool buildPropertyInNamespace(QDeclarativeImportedNamespace *ns, QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj, const BindingContext &)
QList< QDeclarativeIntegerCache * > contextCaches
static QByteArray saveValueType(const QMetaObject *, int, const QMetaObject *, int)
bool isUpper() const
Returns true if the character is an uppercase letter, i.
int rewriteBinding(const QString &expression, const QByteArray &name)
int length() const
Same as size().
void addId(const QString &, QDeclarativeParser::Object *)
T & first()
Returns a reference to the first item in the list.
const char * constData() const
Returns a pointer to the data stored in the byte array.
QDate date() const
Returns the date part of the datetime.
int toJulianDay() const
Converts the date to a Julian day.
QDeclarativeTypeData * unit
QDeclarativeParser::Object::ScriptBlock::Pragmas pragmas() const
StoreDateInstruction storeDate
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
QSizeF Q_DECLARATIVE_PRIVATE_EXPORT sizeFFromString(const QString &, bool *ok=0)
static QDeclarativeCustomParserProperty fromProperty(QDeclarativeParser::Property *)
QDeclarativePropertyCache * rootPropertyCache
QDeclarativeParser::Variant expression
const QMetaObject * metaObject() const
void populateCache(QDeclarativeTypeNameCache *cache, QDeclarativeEngine *) const
QStringList deferredProperties(QDeclarativeParser::Object *)
bool mergeDynamicMetaProperties(QDeclarativeParser::Object *obj)
void compileTree(QDeclarativeParser::Object *tree)
QDeclarativeJS::AST::Node * asAST() const
QList< Property * > groupedProperties
void append(QDeclarativeEngine *, const QMetaObject *, Data::Flag propertyFlags=Data::NoFlags, Data::Flag methodFlags=Data::NoFlags, Data::Flag signalFlags=Data::NoFlags)
QString & append(QChar c)
void addValueTypeProperty(Property *)
void genValueProperty(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj)
The QDateTime class provides date and time functions.
const QMetaObject * attachedPropertiesType() const
bool isComplete() const
Returns true if the status is Complete.
bool buildAttachedProperty(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj, const BindingContext &ctxt)
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the hash...
QList< Property * > valueTypeProperties
void setUrl(const QUrl &)
Sets the url for the file that caused this error.
static bool isValueType(int)
QDeclarativeParser::Value * value
bool isAllowedInRevision(Data *) const
The QDeclarativeEngine class provides an environment for instantiating QML components.
CreateComponentInstruction createComponent
qreal x() const
Returns the x-coordinate of the rectangle's left edge.
QDeclarativeCompiler()
Instantiate a new QDeclarativeCompiler.
QDeclarativeValueTypeFactory valueTypes
QHash< QString, QDeclarativeParser::Object * > ids
int lastIndexOf(QChar c, int from=-1, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
const QSet< QString > & illegalNames() const
QList< QByteArray > parameterNames
const QMetaObject * metaObjectForType(int) const
AssignBindingInstruction assignBinding
int length() const
This function is identical to count().
StoreDoubleInstruction storeDouble
QList< QDeclarativeError > errors() const
Return the list of errors from the last call to compile(), or an empty list if there were no errors...
The QHash::iterator class provides an STL-style non-const iterator for QHash and QMultiHash.
QList< QDeclarativeParser::Object * > aliasingObjects
StoreSignalInstruction storeSignal
int indexForUrl(const QUrl &)
qreal y() const
Returns the y coordinate of this point.
QDeclarativeParser::Object * object
CreateSimpleInstruction createSimple
bool buildListProperty(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj, const BindingContext &ctxt)
bool buildComponentFromRoot(QDeclarativeParser::Object *obj, const BindingContext &)
int evaluateEnum(const QByteArray &script) const
void genListProperty(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj)
iterator begin()
Returns an STL-style iterator pointing to the first item in the hash.
Data * overrideData(Data *) const
bool buildDynamicMeta(QDeclarativeParser::Object *obj, DynamicMetaMode mode)
void add(const QString &, int)
QAbstractDynamicMetaObject rootData
int indexForInt(int *, int)
int size() const
Returns the number of bytes in this byte array.
QList< CustomTypeData > customTypeData
bool isValueTypeSubProperty
void addBindingReference(const BindingReference &)
qreal y() const
Returns the y-coordinate of this point.
QHash< QDeclarativeParser::Value *, BindingReference > bindings
FetchQmlListInstruction fetchQmlList
int indexOfSignal(QDeclarativeParser::Object *, const QByteArray &, bool *notInRevision=0)
QDeclarativeTypeData * get(const QUrl &url)
Returns a QDeclarativeTypeData for the specified url.
QHash< int, QDeclarativeParser::Object * > idIndexes
StoreRectInstruction storeRect
int count(const Key &key) const
Returns the number of items associated with the key.
QDeclarativeTypeNameCache * importCache
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
bool compile(QDeclarativeEngine *, QDeclarativeTypeData *, QDeclarativeCompiledData *)
Compile unit, and store the output in out.
Property * getProperty(const QByteArray &name, bool create=true)
QTime time() const
Returns the time part of the datetime.
const QList< ScriptReference > & resolvedScripts() const
bool buildPropertyLiteralAssignment(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj, QDeclarativeParser::Value *value, const BindingContext &ctxt)
QRgb rgba() const
Returns the RGB value of the color, including its alpha.
AssignValueInterceptorInstruction assignValueInterceptor
const QDeclarativeScriptParser & parser() const
void addValueProperty(Property *)
QDeclarativeEnginePrivate * enginePrivate
char at(int i) const
Returns the character at index position i in the byte array.
QUrl resolved(const QUrl &relative) const
Returns the result of the merge of this URL with relative.
void registerCompositeType(QDeclarativeCompiledData *)
QByteArray program() const
virtual QByteArray compile(const QList< QDeclarativeCustomParserProperty > &)=0
bool buildScriptStringProperty(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj, const BindingContext &ctxt)
QDeclarativeParser::Variant expression
static qreal dot(const QPointF &a, const QPointF &b)
bool buildProperty(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj, const BindingContext &)
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
const QMetaObject * rawMetaObjectForType(int) const
StoreIntegerInstruction storeInteger
QTime Q_DECLARATIVE_PRIVATE_EXPORT timeFromString(const QString &, bool *ok=0)
static QByteArray number(int, int base=10)
Returns a byte array containing the string equivalent of the number n to base base (10 by default)...
bool compileAlias(QMetaObjectBuilder &, QByteArray &data, QDeclarativeParser::Object *obj, const QDeclarativeParser::Object::DynamicProperty &)
QDeclarativeParser::Object * object
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
QList< TypeReference > types
AssignValueSourceInstruction assignValueSource
bool isSubContext() const
const QChar * constData() const
Returns a pointer to the data stored in the QString.
QDeclarativeParser::Object * tree() const
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
bool buildBinding(QDeclarativeParser::Value *, QDeclarativeParser::Property *prop, const BindingContext &ctxt)
static QByteArray saveProperty(const QMetaObject *, int)
QList< QDeclarativeInstruction > bytecode
QDate Q_DECLARATIVE_PRIVATE_EXPORT dateFromString(const QString &, bool *ok=0)
StoreStringInstruction storeString
AssignCustomTypeInstruction assignCustomType
int hour() const
Returns the hour part (0 to 23) of the time.
bool isLetterOrNumber() const
Returns true if the character is a letter or number (Letter_* or Number_* categories); otherwise retu...
static bool equal(const QMetaObject *, const QMetaObject *)
Returns true if lhs and rhs refer to the same metaobject data.
bool endsWith(const QByteArray &a) const
Returns true if this byte array ends with byte array ba; otherwise returns false. ...
bool buildPropertyAssignment(QDeclarativeParser::Property *prop, QDeclarativeParser::Object *obj, const BindingContext &ctxt)
QHash< QByteArray, Property * > properties
QList< QByteArray > datas
StoreScriptStringInstruction storeScriptString
QHash< QDeclarativeParser::Object *, ComponentCompileState > savedCompileStates
QList< Value * > onValues
QDeclarativeParser::Property * defaultValue
void genObject(QDeclarativeParser::Object *obj)
static bool isSignalPropertyName(const QByteArray &)
Returns true if name refers to a signal property, false otherwise.