From 7e08cd128535362d4ed1843b00e5749dd6c7d840 Mon Sep 17 00:00:00 2001 From: Dieter Mayer Date: Sun, 12 Jul 2026 21:47:29 +0200 Subject: [PATCH] Replace deprecated QVariant::Type with QMetaType in UserProperties QVariant::type() and the QVariant::Type enum are deprecated in Qt6. Switch on userType() (non-deprecated, returns the QMetaType id and works on Qt5 too) with QMetaType enum cases. Clears 6 -Wdeprecated- declarations warnings; the numeric type ids are unchanged. --- sources/properties/userproperties.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sources/properties/userproperties.cpp b/sources/properties/userproperties.cpp index 79343f9f1..f2cdeb6f3 100644 --- a/sources/properties/userproperties.cpp +++ b/sources/properties/userproperties.cpp @@ -44,17 +44,17 @@ QDomElement UserProperties::toXml(QDomDocument &xml_document) const for (auto i = m_properties.begin(); i != m_properties.end(); ++i) { - auto type = i.value().type(); + auto type = i.value().userType(); switch(type) { - case QVariant::Type::String: + case QMetaType::QString: up.appendChild(QETXML::createXmlProperty(i.key(), i.value().toString())); break; - case QVariant::Type::Int: + case QMetaType::Int: up.appendChild(QETXML::createXmlProperty(i.key(), i.value().toInt())); break; - case QVariant::Type::Double: + case QMetaType::Double: up.appendChild(QETXML::createXmlProperty(i.key(), i.value().toDouble())); break; - case QVariant::Type::Bool: + case QMetaType::Bool: up.appendChild(QETXML::createXmlProperty(i.key(), i.value().toBool())); break; - case QVariant::Type::Color: + case QMetaType::QColor: up.appendChild(QETXML::createXmlProperty(i.key(), QColor(i.value().value()))); break; default: break;