ProjectExplorer: Replaace some QVariant::type() uses

Deprecated since Qt 6.0 in favor of typeId()

Change-Id: Ib6ab5196ad9ec4cb2d3dbc2d4f1ceca5cfdcdd07
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2023-06-06 10:26:19 +02:00
parent 9db19c653c
commit 390b4aa895

View File

@@ -150,7 +150,7 @@ QVariant JsonFieldPage::Field::toSettings() const
JsonFieldPage::Field *JsonFieldPage::Field::parse(const QVariant &input, QString *errorMessage) JsonFieldPage::Field *JsonFieldPage::Field::parse(const QVariant &input, QString *errorMessage)
{ {
if (input.type() != QVariant::Map) { if (input.typeId() != QVariant::Map) {
*errorMessage = Tr::tr("Field is not an object."); *errorMessage = Tr::tr("Field is not an object.");
return nullptr; return nullptr;
} }
@@ -393,7 +393,7 @@ QDebug &operator<<(QDebug &debug, const JsonFieldPage::Field &field)
bool LabelField::parseData(const QVariant &data, QString *errorMessage) bool LabelField::parseData(const QVariant &data, QString *errorMessage)
{ {
if (data.type() != QVariant::Map) { if (data.typeId() != QVariant::Map) {
*errorMessage = Tr::tr("Label (\"%1\") data is not an object.").arg(name()); *errorMessage = Tr::tr("Label (\"%1\") data is not an object.").arg(name());
return false; return false;
} }
@@ -431,7 +431,7 @@ bool SpacerField::parseData(const QVariant &data, QString *errorMessage)
if (data.isNull()) if (data.isNull())
return true; return true;
if (data.type() != QVariant::Map) { if (data.typeId() != QVariant::Map) {
*errorMessage = Tr::tr("Spacer (\"%1\") data is not an object.").arg(name()); *errorMessage = Tr::tr("Spacer (\"%1\") data is not an object.").arg(name());
return false; return false;
} }
@@ -476,7 +476,7 @@ bool LineEditField::parseData(const QVariant &data, QString *errorMessage)
if (data.isNull()) if (data.isNull())
return true; return true;
if (data.type() != QVariant::Map) { if (data.typeId() != QVariant::Map) {
*errorMessage = Tr::tr("LineEdit (\"%1\") data is not an object.").arg(name()); *errorMessage = Tr::tr("LineEdit (\"%1\") data is not an object.").arg(name());
return false; return false;
} }
@@ -673,7 +673,7 @@ bool TextEditField::parseData(const QVariant &data, QString *errorMessage)
if (data.isNull()) if (data.isNull())
return true; return true;
if (data.type() != QVariant::Map) { if (data.typeId() != QVariant::Map) {
*errorMessage = Tr::tr("TextEdit (\"%1\") data is not an object.") *errorMessage = Tr::tr("TextEdit (\"%1\") data is not an object.")
.arg(name()); .arg(name());
return false; return false;
@@ -756,7 +756,7 @@ bool PathChooserField::parseData(const QVariant &data, QString *errorMessage)
if (data.isNull()) if (data.isNull())
return true; return true;
if (data.type() != QVariant::Map) { if (data.typeId() != QVariant::Map) {
*errorMessage = Tr::tr("PathChooser data is not an object."); *errorMessage = Tr::tr("PathChooser data is not an object.");
return false; return false;
} }
@@ -861,7 +861,7 @@ bool CheckBoxField::parseData(const QVariant &data, QString *errorMessage)
if (data.isNull()) if (data.isNull())
return true; return true;
if (data.type() != QVariant::Map) { if (data.typeId() != QVariant::Map) {
*errorMessage = Tr::tr("CheckBox (\"%1\") data is not an object.").arg(name()); *errorMessage = Tr::tr("CheckBox (\"%1\") data is not an object.").arg(name());
return false; return false;
} }