diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index c214926ec48..489aaae7900 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -904,7 +904,7 @@ static ConsoleItem *constructLogItemTree(const QVariant &result, const QString & if (child) item->appendChild(child); } - } else if (result.canConvert(QMetaType::QString)) { + } else if (result.canConvert(QMetaType(QMetaType::QString))) { item = new ConsoleItem(ConsoleItem::DefaultType, result.toString()); } else { item = new ConsoleItem(ConsoleItem::DefaultType, "Unknown Value"); diff --git a/src/plugins/effectcomposer/effectcomposercontextobject.cpp b/src/plugins/effectcomposer/effectcomposercontextobject.cpp index dd42092e72e..95ebe7a3670 100644 --- a/src/plugins/effectcomposer/effectcomposercontextobject.cpp +++ b/src/plugins/effectcomposer/effectcomposercontextobject.cpp @@ -39,9 +39,9 @@ QString EffectComposerContextObject::convertColorToString(const QVariant &color) { QString colorString; QColor theColor; - if (color.canConvert(QVariant::Color)) { + if (color.canConvert(QMetaType(QMetaType::QColor))) { theColor = color.value(); - } else if (color.canConvert(QVariant::Vector3D)) { + } else if (color.canConvert(QMetaType(QMetaType::QVector3D))) { auto vec = color.value(); theColor = QColor::fromRgbF(vec.x(), vec.y(), vec.z()); } diff --git a/src/plugins/mcusupport/mcukitaspect.cpp b/src/plugins/mcusupport/mcukitaspect.cpp index 1ab803b2437..7e75288b4f9 100644 --- a/src/plugins/mcusupport/mcukitaspect.cpp +++ b/src/plugins/mcusupport/mcukitaspect.cpp @@ -78,7 +78,7 @@ public: const QVariant checkFormat = kit->value(McuDependenciesKitAspect::id()); if (!checkFormat.isValid() || checkFormat.isNull()) return result; - if (!checkFormat.canConvert(QMetaType::QVariantList)) + if (!checkFormat.canConvert(QMetaType(QMetaType::QVariantList))) return {BuildSystemTask(Task::Error, Tr::tr("The MCU dependencies setting value is invalid."))}; // check paths defined in cmake variables for given dependencies exist @@ -105,7 +105,7 @@ public: QTC_ASSERT(kit, return ); const QVariant variant = kit->value(McuDependenciesKitAspect::id()); - if (!variant.isNull() && !variant.canConvert(QMetaType::QVariantList)) { + if (!variant.isNull() && !variant.canConvert(QMetaType(QMetaType::QVariantList))) { qWarning("Kit \"%s\" has a wrong mcu dependencies value set.", qPrintable(kit->displayName())); McuDependenciesKitAspect::setDependencies(kit, Utils::EnvironmentItems()); diff --git a/src/plugins/projectexplorer/kitaspects.cpp b/src/plugins/projectexplorer/kitaspects.cpp index db3300f3270..35193cf6e90 100644 --- a/src/plugins/projectexplorer/kitaspects.cpp +++ b/src/plugins/projectexplorer/kitaspects.cpp @@ -1539,7 +1539,7 @@ Tasks EnvironmentKitAspectFactory::validate(const Kit *k) const QTC_ASSERT(k, return result); const QVariant variant = k->value(EnvironmentKitAspect::id()); - if (!variant.isNull() && !variant.canConvert(QMetaType::QVariantList)) + if (!variant.isNull() && !variant.canConvert(QMetaType(QMetaType::QVariantList))) result << BuildSystemTask(Task::Error, Tr::tr("The environment setting value is invalid.")); return result; @@ -1550,7 +1550,7 @@ void EnvironmentKitAspectFactory::fix(Kit *k) QTC_ASSERT(k, return); const QVariant variant = k->value(EnvironmentKitAspect::id()); - if (!variant.isNull() && !variant.canConvert(QMetaType::QVariantList)) { + if (!variant.isNull() && !variant.canConvert(QMetaType(QMetaType::QVariantList))) { qWarning("Kit \"%s\" has a wrong environment value set.", qPrintable(k->displayName())); EnvironmentKitAspect::setEnvironmentChanges(k, EnvironmentItems()); } diff --git a/src/plugins/qmldesigner/components/materialeditor/materialeditorcontextobject.cpp b/src/plugins/qmldesigner/components/materialeditor/materialeditorcontextobject.cpp index 664006fb7a5..f583498db78 100644 --- a/src/plugins/qmldesigner/components/materialeditor/materialeditorcontextobject.cpp +++ b/src/plugins/qmldesigner/components/materialeditor/materialeditorcontextobject.cpp @@ -46,9 +46,9 @@ QString MaterialEditorContextObject::convertColorToString(const QVariant &color) { QString colorString; QColor theColor; - if (color.canConvert(QVariant::Color)) { + if (color.canConvert(QMetaType(QMetaType::QColor))) { theColor = color.value(); - } else if (color.canConvert(QVariant::Vector3D)) { + } else if (color.canConvert(QMetaType(QMetaType::QVector3D))) { auto vec = color.value(); theColor = QColor::fromRgbF(vec.x(), vec.y(), vec.z()); } diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp index b6d119a4248..1a49ce0c39e 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorcontextobject.cpp @@ -87,9 +87,9 @@ QString PropertyEditorContextObject::convertColorToString(const QVariant &color) { QString colorString; QColor theColor; - if (color.canConvert(QVariant::Color)) { + if (color.canConvert(QMetaType(QMetaType::QColor))) { theColor = color.value(); - } else if (color.canConvert(QVariant::Vector3D)) { + } else if (color.canConvert(QMetaType(QMetaType::QVector3D))) { auto vec = color.value(); theColor = QColor::fromRgbF(vec.x(), vec.y(), vec.z()); } diff --git a/src/plugins/qmldesigner/components/textureeditor/textureeditorcontextobject.cpp b/src/plugins/qmldesigner/components/textureeditor/textureeditorcontextobject.cpp index 73e784846bb..30f276a48db 100644 --- a/src/plugins/qmldesigner/components/textureeditor/textureeditorcontextobject.cpp +++ b/src/plugins/qmldesigner/components/textureeditor/textureeditorcontextobject.cpp @@ -47,9 +47,9 @@ QString TextureEditorContextObject::convertColorToString(const QVariant &color) { QString colorString; QColor theColor; - if (color.canConvert(QVariant::Color)) { + if (color.canConvert(QMetaType(QMetaType::QColor))) { theColor = color.value(); - } else if (color.canConvert(QVariant::Vector3D)) { + } else if (color.canConvert(QMetaType(QMetaType::QVector3D))) { auto vec = color.value(); theColor = QColor::fromRgbF(vec.x(), vec.y(), vec.z()); } diff --git a/src/plugins/qmldesigner/components/timelineeditor/timelinepropertyitem.cpp b/src/plugins/qmldesigner/components/timelineeditor/timelinepropertyitem.cpp index 762bd85c8b4..04cc8ebebc6 100644 --- a/src/plugins/qmldesigner/components/timelineeditor/timelinepropertyitem.cpp +++ b/src/plugins/qmldesigner/components/timelineeditor/timelinepropertyitem.cpp @@ -107,14 +107,14 @@ static void editValue(const ModelNode &frameNode, const std::pair int userType = value.typeId(); QVariant newValue = dialog->value(); - if (newValue.canConvert(userType)) { + if (newValue.canConvert(QMetaType(userType))) { QVariant newValueConverted = newValue; - bool converted = newValueConverted.convert(userType); + bool converted = newValueConverted.convert(QMetaType(userType)); if (!converted) { // convert() fails for int to double, so we try this combination newValueConverted = newValue; - converted = newValueConverted.convert(QMetaType::Double); + converted = newValueConverted.convert(QMetaType(QMetaType::Double)); } if (converted) diff --git a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp index b66270dca12..ded7fbc5ef4 100644 --- a/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp +++ b/src/plugins/qmldesigner/designercore/model/texttomodelmerger.cpp @@ -1565,7 +1565,7 @@ void TextToModelMerger::syncVariantProperty(AbstractProperty &modelProperty, const TypeName &astType, DifferenceHandler &differenceHandler) { - if (astValue.canConvert(QMetaType::QString)) + if (astValue.canConvert(QMetaType(QMetaType::QString))) populateQrcMapping(astValue.toString()); if (modelProperty.isVariantProperty()) {