From fdbdbbdd4ff05d1ceb7667227db5b14687a77c96 Mon Sep 17 00:00:00 2001 From: Chris Adams Date: Wed, 2 Nov 2011 10:21:37 +1000 Subject: Add support for assigning literal value to sequence property It is a language semantic that we allow clients to assign a single value to a sequence/list property (assuming that the types match). Now that we support sequence types, this commit adds support for this semantic by determining whether the built-in type of the literal corresponds to the associated sequence (eg, int for QList, qreal for QList, bool for QList, QString for QStringList etc). Similarly, some value types can be constructed from literal string values (via string converters) and these need to be handled also. Task-number: QTBUG-18062 Task-number: QTBUG-21770 Change-Id: Iacd91b2af122cd8f20b7df2fa6056a7d7c52bf53 Reviewed-by: Aaron Kennedy --- src/declarative/qml/qdeclarativeinstruction.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/declarative/qml/qdeclarativeinstruction.cpp') diff --git a/src/declarative/qml/qdeclarativeinstruction.cpp b/src/declarative/qml/qdeclarativeinstruction.cpp index 5f8b253858..da5c29069e 100644 --- a/src/declarative/qml/qdeclarativeinstruction.cpp +++ b/src/declarative/qml/qdeclarativeinstruction.cpp @@ -93,21 +93,39 @@ void QDeclarativeCompiledData::dump(QDeclarativeInstruction *instr, int idx) case QDeclarativeInstruction::StoreDouble: qWarning().nospace() << idx << "\t\t" << "STORE_DOUBLE\t\t" << instr->storeDouble.propertyIndex << "\t" << instr->storeDouble.value; break; + case QDeclarativeInstruction::StoreDoubleQList: + qWarning().nospace() << idx << "\t\t" << "STORE_DOUBLE_QLIST\t\t" << instr->storeDouble.propertyIndex << "\t" << instr->storeDouble.value; + break; case QDeclarativeInstruction::StoreInteger: qWarning().nospace() << idx << "\t\t" << "STORE_INTEGER\t\t" << instr->storeInteger.propertyIndex << "\t" << instr->storeInteger.value; break; + case QDeclarativeInstruction::StoreIntegerQList: + qWarning().nospace() << idx << "\t\t" << "STORE_INTEGER_QLIST\t\t" << instr->storeInteger.propertyIndex << "\t" << instr->storeInteger.value; + break; case QDeclarativeInstruction::StoreBool: qWarning().nospace() << idx << "\t\t" << "STORE_BOOL\t\t" << instr->storeBool.propertyIndex << "\t" << instr->storeBool.value; break; + case QDeclarativeInstruction::StoreBoolQList: + qWarning().nospace() << idx << "\t\t" << "STORE_BOOL_QLIST\t\t" << instr->storeBool.propertyIndex << "\t" << instr->storeBool.value; + break; case QDeclarativeInstruction::StoreString: qWarning().nospace() << idx << "\t\t" << "STORE_STRING\t\t" << instr->storeString.propertyIndex << "\t" << instr->storeString.value << "\t\t" << primitives.at(instr->storeString.value); break; + case QDeclarativeInstruction::StoreStringList: + qWarning().nospace() << idx << "\t\t" << "STORE_STRINGLIST\t\t" << instr->storeString.propertyIndex << "\t" << instr->storeString.value << "\t\t" << primitives.at(instr->storeString.value); + break; + case QDeclarativeInstruction::StoreStringQList: + qWarning().nospace() << idx << "\t\t" << "STORE_STRING_QLIST\t\t" << instr->storeString.propertyIndex << "\t" << instr->storeString.value << "\t\t" << primitives.at(instr->storeString.value); + break; case QDeclarativeInstruction::StoreByteArray: qWarning().nospace() << idx << "\t\t" << "STORE_BYTEARRAY" << instr->storeByteArray.propertyIndex << "\t" << instr->storeByteArray.value << "\t\t" << datas.at(instr->storeByteArray.value); break; case QDeclarativeInstruction::StoreUrl: qWarning().nospace() << idx << "\t\t" << "STORE_URL\t\t" << instr->storeUrl.propertyIndex << "\t" << instr->storeUrl.value << "\t\t" << urls.at(instr->storeUrl.value); break; + case QDeclarativeInstruction::StoreUrlQList: + qWarning().nospace() << idx << "\t\t" << "STORE_URL_QLIST\t\t" << instr->storeUrl.propertyIndex << "\t" << instr->storeUrl.value << "\t\t" << urls.at(instr->storeUrl.value); + break; case QDeclarativeInstruction::StoreColor: qWarning().nospace() << idx << "\t\t" << "STORE_COLOR\t\t" << instr->storeColor.propertyIndex << "\t\t\t" << QString::number(instr->storeColor.value, 16); break; -- cgit v1.2.3