From 2575eac4c26ad92dde95959a82f576edc3e76e1d Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Fri, 22 May 2009 13:05:11 +1000 Subject: Naively fix handling of qreal properties for ARM. This gets things working, but isn't ideal as it treats qreal properties as type double on ARM (where they should be of type float). --- src/declarative/qml/qmlvme.cpp | 3 ++- src/tools/moc/generator.cpp | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp index 1552cb5..a5cc649 100644 --- a/src/declarative/qml/qmlvme.cpp +++ b/src/declarative/qml/qmlvme.cpp @@ -1017,7 +1017,8 @@ void QmlVME::runStoreInstruction(QStack &stack, QFxCompilerTimer cc; #endif QObject *target = stack.top(); - qreal r = instr.storeReal.value; + //### moc treats qreal properties as having type double + double r = static_cast(instr.storeReal.value); void *a[1]; a[0] = &r; QMetaObject::metacall(target, QMetaObject::WriteProperty, diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 7d617a3..dbad4dc 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -758,6 +758,9 @@ void Generator::generateMetacall() else if (cdef->enumDeclarations.value(p.type, false)) fprintf(out, " case %d: *reinterpret_cast(_v) = QFlag(%s()); break;\n", propindex, p.read.constData()); + else if (p.type == "qreal") + fprintf(out, " case %d: *reinterpret_cast< double*>(_v) = %s(); break;\n", + propindex, p.read.constData()); else fprintf(out, " case %d: *reinterpret_cast< %s*>(_v) = %s(); break;\n", propindex, p.type.constData(), p.read.constData()); @@ -782,6 +785,9 @@ void Generator::generateMetacall() if (cdef->enumDeclarations.value(p.type, false)) { fprintf(out, " case %d: %s(QFlag(*reinterpret_cast(_v))); break;\n", propindex, p.write.constData()); + } else if(p.type == "qreal") { + fprintf(out, " case %d: %s(*reinterpret_cast< double*>(_v)); break;\n", + propindex, p.write.constData()); } else { fprintf(out, " case %d: %s(*reinterpret_cast< %s*>(_v)); break;\n", propindex, p.write.constData(), p.type.constData()); -- cgit v0.12