aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlmetaobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml/qqmlmetaobject.cpp')
-rw-r--r--src/qml/qml/qqmlmetaobject.cpp62
1 files changed, 1 insertions, 61 deletions
diff --git a/src/qml/qml/qqmlmetaobject.cpp b/src/qml/qml/qqmlmetaobject.cpp
index e84c5a366e..352db7bd69 100644
--- a/src/qml/qml/qqmlmetaobject.cpp
+++ b/src/qml/qml/qqmlmetaobject.cpp
@@ -8,28 +8,6 @@
QT_BEGIN_NAMESPACE
-// Returns true if \a from is assignable to a property of type \a to
-bool QQmlMetaObject::canConvert(const QQmlMetaObject &from, const QQmlMetaObject &to)
-{
- Q_ASSERT(!from.isNull() && !to.isNull());
-
- auto equal = [] (const QMetaObject *lhs, const QMetaObject *rhs) -> bool {
- return lhs == rhs || (lhs && rhs && lhs->d.stringdata == rhs->d.stringdata);
- };
-
- const QMetaObject *tom = to.metaObject();
- if (tom == &QObject::staticMetaObject) return true;
-
- const QMetaObject *fromm = from.metaObject();
- while (fromm) {
- if (equal(fromm, tom))
- return true;
- fromm = fromm->superClass();
- }
-
- return false;
-}
-
void QQmlMetaObject::resolveGadgetMethodOrPropertyIndex(QMetaObject::Call type, const QMetaObject **metaObject, int *index)
{
int offset;
@@ -70,7 +48,7 @@ QMetaType QQmlMetaObject::methodReturnType(const QQmlPropertyData &data, QByteAr
type = _m->method(data.coreIndex()).returnMetaType();
}
if (type.flags().testFlag(QMetaType::IsEnumeration))
- type = QMetaType::fromType<int>();
+ type = type.underlyingType();
if (type.isValid())
return type;
else if (unknownTypeError)
@@ -78,42 +56,4 @@ QMetaType QQmlMetaObject::methodReturnType(const QQmlPropertyData &data, QByteAr
return QMetaType();
}
-bool QQmlMetaObject::methodParameterTypes(int index, ArgTypeStorage *argStorage,
- QByteArray *unknownTypeError) const
-{
- Q_ASSERT(_m && index >= 0);
-
- QMetaMethod m = _m->method(index);
- return methodParameterTypes(m, argStorage, unknownTypeError);
-}
-
-bool QQmlMetaObject::constructorParameterTypes(int index, ArgTypeStorage *dummy,
- QByteArray *unknownTypeError) const
-{
- QMetaMethod m = _m->constructor(index);
- return methodParameterTypes(m, dummy, unknownTypeError);
-}
-
-bool QQmlMetaObject::methodParameterTypes(const QMetaMethod &m, ArgTypeStorage *argStorage,
- QByteArray *unknownTypeError)
-{
- Q_ASSERT(argStorage);
-
- int argc = m.parameterCount();
- argStorage->resize(argc);
- for (int ii = 0; ii < argc; ++ii) {
- QMetaType type = m.parameterMetaType(ii);
- // we treat enumerations as int
- if (type.flags().testFlag(QMetaType::IsEnumeration))
- type = QMetaType::fromType<int>();
- if (!type.isValid()) {
- if (unknownTypeError)
- *unknownTypeError = m.parameterTypeName(ii);
- return false;
- }
- argStorage->operator[](ii) = type;
- }
- return true;
-}
-
QT_END_NAMESPACE