aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qdeclarativecompiler.cpp
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2012-01-09 14:09:32 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-25 10:59:58 +0100
commitde00d8e2d287344229ef6da0fdb19e9846ab6dd9 (patch)
tree21ccbd8a9e3b0a603d1fe87b18fa3a8de8b26de5 /src/declarative/qml/qdeclarativecompiler.cpp
parent8df8bc5062bf5848a616792c79dddd1626014072 (diff)
Use QMetaType::QVariant as the type for QVariant
Change http://codereview.qt-project.org/#change,12408 in qtbase updates moc and friends to use QMetaType::QVariant instead of the magic -1 / 0xffffffff / QVariant::LastType. This change adapts qtdeclarative accordingly. Change-Id: Ifb120485a4ee1501df6ad42d8ecd590824c85e9f Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com> Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'src/declarative/qml/qdeclarativecompiler.cpp')
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp
index 07e381c18f..8bf1faa2f1 100644
--- a/src/declarative/qml/qdeclarativecompiler.cpp
+++ b/src/declarative/qml/qdeclarativecompiler.cpp
@@ -2833,8 +2833,8 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeScript::Object *obj, Dyn
int metaType;
const char *cppType;
} builtinTypes[] = {
- { Object::DynamicProperty::Var, 0, "QVariant" },
- { Object::DynamicProperty::Variant, 0, "QVariant" },
+ { Object::DynamicProperty::Var, QMetaType::QVariant, "QVariant" },
+ { Object::DynamicProperty::Variant, QMetaType::QVariant, "QVariant" },
{ Object::DynamicProperty::Int, QMetaType::Int, "int" },
{ Object::DynamicProperty::Bool, QMetaType::Bool, "bool" },
{ Object::DynamicProperty::Real, QMetaType::Double, "double" },
@@ -2870,8 +2870,6 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeScript::Object *obj, Dyn
if (typeRefs[p->type].isEmpty())
typeRefs[p->type] = builder.newString(strlen(builtinTypes[p->type].cppType));
typeRef = typeRefs[p->type];
- if (p->type == Object::DynamicProperty::Variant)
- propertyType = -1;
} else {
Q_ASSERT(p->type == Object::DynamicProperty::CustomList ||
@@ -2950,11 +2948,11 @@ bool QDeclarativeCompiler::buildDynamicMeta(QDeclarativeScript::Object *obj, Dyn
QFastMetaBuilder::StringRef typeRef = typeRefs[p->type];
if (buildData) {
vmd->propertyCount++;
- (vmd->propertyData() + effectivePropertyIndex)->propertyType = -1;
+ (vmd->propertyData() + effectivePropertyIndex)->propertyType = QMetaType::QVariant;
}
builder.setProperty(effectivePropertyIndex, p->nameRef, typeRef,
- (QMetaType::Type)-1,
+ QMetaType::QVariant,
p->isReadOnly?QFastMetaBuilder::None:QFastMetaBuilder::Writable,
effectivePropertyIndex);
@@ -3267,8 +3265,8 @@ bool QDeclarativeCompiler::compileAlias(QFastMetaBuilder &builder,
writable = aliasProperty.isWritable() && !prop.isReadOnly;
resettable = aliasProperty.isResettable() && !prop.isReadOnly;
- if (aliasProperty.type() < QVariant::UserType ||
- aliasProperty.type() == QVariant::LastType /* for QVariant */ )
+ if (aliasProperty.type() < QVariant::UserType
+ || uint(aliasProperty.type()) == QMetaType::QVariant)
type = aliasProperty.type();
if (alias.count() == 3) {