diff --git a/src/plugins/qmldesigner/core/metainfo/propertymetainfo.cpp b/src/plugins/qmldesigner/core/metainfo/propertymetainfo.cpp
index 5047c3b7b64ff77af34213136ccf2b9702fc3c1b..9e84ae056cf63e709b54d39d9289693aa77ce7d4 100644
--- a/src/plugins/qmldesigner/core/metainfo/propertymetainfo.cpp
+++ b/src/plugins/qmldesigner/core/metainfo/propertymetainfo.cpp
@@ -420,12 +420,14 @@ QVariant PropertyMetaInfo::castedValue(const QVariant &originalVariant) const
         return variant;
     } else if (typeId == QVariant::UserType && m_data->type == QLatin1String("QVariant")) {
         return variant;
+    } else if (typeId == QVariant::UserType && m_data->type == QLatin1String("variant")) {
+        return variant;
     } else if (typeId == QVariant::UserType && m_data->type == QLatin1String("var")) {
         return variant;
     } else if (variant.type() == QVariant::List && variant.type() == QVariant::List) {
         // TODO: check the contents of the list
         return variant;
-    } else if (type() == "var") {
+    } else if (type() == "var" || type() == "variant") {
         return variant;
     } else if (type() == "alias") {
         // TODO: The QML compiler resolves the alias type. We probably should do the same.
diff --git a/src/plugins/qmldesigner/core/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/core/model/texttomodelmerger.cpp
index 934a834a4d1430044ec89f2adec62eac65571644..af2ab7678cc2f47b5723da8874660dda57c44a29 100644
--- a/src/plugins/qmldesigner/core/model/texttomodelmerger.cpp
+++ b/src/plugins/qmldesigner/core/model/texttomodelmerger.cpp
@@ -148,7 +148,7 @@ static inline int propertyType(const QString &typeName)
         return QMetaType::type("QString");
     else if (typeName == QLatin1String("url"))
         return QMetaType::type("QUrl");
-    else if (typeName == QLatin1String("var"))
+    else if (typeName == QLatin1String("var") || typeName == QLatin1String("variant"))
         return QMetaType::type("QVariant");
     else
         return -1;