aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@nokia.com>2012-05-18 17:30:03 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-21 15:54:56 +0200
commitfdc55ec837c79f1b42896b56f5be2c4abb5183ed (patch)
tree3223e96473b5fe05354674dee1262a6d4803e3a6 /src
parentda0c8b6cd5c824e063c96ba54724ccf13ca2d808 (diff)
Simplify QVariant::convert and QVariant::canConvert calls.
QVariant::Type casts are not necessary in Qt5. Change-Id: Ia2e7d8fa367a59c23bd06993db36d96a0a46a229 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/qml/qqmlproperty.cpp2
-rw-r--r--src/qml/qml/v4/qv4bindings.cpp4
-rw-r--r--src/qml/qml/v8/qv8engine.cpp4
-rw-r--r--src/qml/qml/v8/qv8qobjectwrapper.cpp4
-rw-r--r--src/quick/util/qquickanimation.cpp4
5 files changed, 9 insertions, 9 deletions
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp
index d68d8a9517..761b75acf4 100644
--- a/src/qml/qml/qqmlproperty.cpp
+++ b/src/qml/qml/qqmlproperty.cpp
@@ -1371,7 +1371,7 @@ bool QQmlPropertyPrivate::write(QObject *object,
v = QQmlStringConverters::variantFromString(value.toString(), propertyType, &ok);
if (!ok) {
v = value;
- if (v.convert((QVariant::Type)propertyType)) {
+ if (v.convert(propertyType)) {
ok = true;
} else if ((uint)propertyType >= QVariant::UserType && variantType == QVariant::String) {
QQmlMetaType::StringConverter con = QQmlMetaType::customStringConverter(propertyType);
diff --git a/src/qml/qml/v4/qv4bindings.cpp b/src/qml/qml/v4/qv4bindings.cpp
index f25bfccce4..d4665ac9be 100644
--- a/src/qml/qml/v4/qv4bindings.cpp
+++ b/src/qml/qml/v4/qv4bindings.cpp
@@ -455,8 +455,8 @@ static bool testCompareVariants(const QVariant &qtscriptRaw, const QVariant &v4)
QVariant qtscript = qtscriptRaw;
if (qtscript.userType() == v4.userType()) {
- } else if (qtscript.canConvert((QVariant::Type)v4.userType())) {
- qtscript.convert((QVariant::Type)v4.userType());
+ } else if (qtscript.canConvert(v4.userType())) {
+ qtscript.convert(v4.userType());
} else if (qtscript.userType() == QVariant::Invalid && v4.userType() == QMetaType::QObjectStar) {
qtscript = qVariantFromValue<QObject *>(0);
} else {
diff --git a/src/qml/qml/v8/qv8engine.cpp b/src/qml/qml/v8/qv8engine.cpp
index 5fecd713ce..275b648ee4 100644
--- a/src/qml/qml/v8/qv8engine.cpp
+++ b/src/qml/qml/v8/qv8engine.cpp
@@ -1182,9 +1182,9 @@ bool QV8Engine::metaTypeFromJS(v8::Handle<v8::Value> value, int type, void *data
QMetaType::constructInPlace(type, data, var.constData());
return true;
}
- if (var.canConvert(QVariant::Type(type))) {
+ if (var.canConvert(type)) {
QVariant vv = var;
- vv.convert(QVariant::Type(type));
+ vv.convert(type);
Q_ASSERT(vv.userType() == type);
QMetaType::constructInPlace(type, data, vv.constData());
return true;
diff --git a/src/qml/qml/v8/qv8qobjectwrapper.cpp b/src/qml/qml/v8/qv8qobjectwrapper.cpp
index 95e2be7584..aab66e33a2 100644
--- a/src/qml/qml/v8/qv8qobjectwrapper.cpp
+++ b/src/qml/qml/v8/qv8qobjectwrapper.cpp
@@ -2137,9 +2137,9 @@ void CallArgument::fromValue(int callType, QV8Engine *engine, v8::Handle<v8::Val
if (v.userType() == callType) {
*qvariantPtr = v;
- } else if (v.canConvert((QVariant::Type)callType)) {
+ } else if (v.canConvert(callType)) {
*qvariantPtr = v;
- qvariantPtr->convert((QVariant::Type)callType);
+ qvariantPtr->convert(callType);
} else if (const QMetaObject *mo = ep ? ep->rawMetaObjectForType(callType) : 0) {
QObject *obj = ep->toQObject(v);
diff --git a/src/quick/util/qquickanimation.cpp b/src/quick/util/qquickanimation.cpp
index 2fca7ba80c..77d4809ac6 100644
--- a/src/quick/util/qquickanimation.cpp
+++ b/src/quick/util/qquickanimation.cpp
@@ -1763,7 +1763,7 @@ QAbstractAnimationJob* QQuickParallelAnimation::transition(QQuickStateActions &a
void QQuickPropertyAnimationPrivate::convertVariant(QVariant &variant, int type)
{
if (variant.userType() != QVariant::String) {
- variant.convert((QVariant::Type)type);
+ variant.convert(type);
return;
}
@@ -1783,7 +1783,7 @@ void QQuickPropertyAnimationPrivate::convertVariant(QVariant &variant, int type)
break;
default:
if (QQmlValueTypeFactory::isValueType((uint)type)) {
- variant.convert((QVariant::Type)type);
+ variant.convert(type);
} else {
QQmlMetaType::StringConverter converter = QQmlMetaType::customStringConverter(type);
if (converter)