From f056eed02e959e639c09e2912e7545e79c0ea9ea Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 20 Apr 2022 14:26:25 +0200 Subject: Clear tst_QSettings of deprecation warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Assorted QMetaType and QVariant methods deprecated in Qt 6 were still in use - the deprecation warnings were suppressed by setting QT_DISABLE_DEPRECATED_BEFORE=0 - fix them and clear that suppression. Change-Id: I1aa8f45dcb5a18449b060b346c80ad70536896ab Reviewed-by: Qt CI Bot Reviewed-by: Thiago Macieira Reviewed-by: MÃ¥rten Nordheim --- tests/auto/corelib/io/qsettings/tst_qsettings.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/auto/corelib/io/qsettings/tst_qsettings.cpp') diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp index 9c0030267d..fcbd37fcc4 100644 --- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp +++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp @@ -949,7 +949,7 @@ void tst_QSettings::testIniParsing() if ( settings.status() == QSettings::NoError ) { // else no point proceeding QVariant v = settings.value(key); if (expect.isValid()) - QVERIFY(v.canConvert(expect.type())); + QVERIFY(v.canConvert(expect.metaType())); // check some types so as to give prettier error messages if ( v.typeId() == QMetaType::QString ) { QCOMPARE(v.toString(), expect.toString()); @@ -1177,7 +1177,7 @@ template static void testMetaTypesHelper(QSettings::Format format) { typedef typename MetaEnumToType::Type Type; - const char *key = QMetaType::typeName(MetaTypeId); + const char *key = QMetaType(MetaTypeId).name(); Type *value = TestValueFactory::create(); QVariant inputVariant = QVariant::fromValue(*value); @@ -1196,8 +1196,8 @@ static void testMetaTypesHelper(QSettings::Format format) QSettings settings(format, scope, organization, applicationName); QVariant outputVariant = settings.value(key); if (MetaTypeId != QMetaType::QVariant) - QVERIFY(outputVariant.canConvert(MetaTypeId)); - if (outputVariant.type() != inputVariant.type()) + QVERIFY(outputVariant.canConvert(QMetaType(MetaTypeId))); + if (outputVariant.typeId() != inputVariant.typeId()) qWarning() << "type mismatch between" << inputVariant << "and" << outputVariant; QCOMPARE(qvariant_cast(outputVariant), *value); } @@ -1236,7 +1236,7 @@ void tst_QSettings::testMetaTypes_data() #define ADD_METATYPE_TEST_ROW(MetaTypeName, MetaTypeId, RealType) \ { \ const char *formatName = QMetaEnum::fromType().valueToKey(formats[i]); \ - const char *typeName = QMetaType::typeName(QMetaType::MetaTypeName); \ + const char *typeName = QMetaType(QMetaType::MetaTypeName).name(); \ QTest::newRow(QString("%1:%2").arg(formatName).arg(typeName).toLatin1().constData()) \ << QSettings::Format(formats[i]) << int(QMetaType::MetaTypeName); \ } -- cgit v1.2.3