Fix compilation against Qt >= 6.11

This commit is contained in:
Robert Griebl
2025-12-28 19:53:06 +01:00
parent bf5cea5926
commit aa820e936e
2 changed files with 18 additions and 6 deletions

View File

@@ -582,8 +582,6 @@ QString qtDiag(unsigned flags)
DUMP_CPU_FEATURE(AVX512IFMA, "AVX512IFMA");
DUMP_CPU_FEATURE(AVX512VBMI2, "AVX512VBMI2");
DUMP_CPU_FEATURE(AVX512FP16, "AVX512FP16");
DUMP_CPU_FEATURE(RDRND, "RDRAND");
DUMP_CPU_FEATURE(RDSEED, "RDSEED");
DUMP_CPU_FEATURE(AES, "AES");
DUMP_CPU_FEATURE(VAES, "VAES");
DUMP_CPU_FEATURE(SHA, "SHA");
@@ -681,7 +679,9 @@ QString qtDiag(unsigned flags)
DUMP_CAPABILITY(str, platformIntegration, NativeWidgets)
DUMP_CAPABILITY(str, platformIntegration, WindowManagement)
DUMP_CAPABILITY(str, platformIntegration, SyncState)
#if QT_VERSION < QT_VERSION_CHECK(6, 11, 0)
DUMP_CAPABILITY(str, platformIntegration, RasterGLSurface)
#endif
DUMP_CAPABILITY(str, platformIntegration, AllGLFunctionsQueryable)
DUMP_CAPABILITY(str, platformIntegration, ApplicationIcon)
DUMP_CAPABILITY(str, platformIntegration, SwitchableWidgetComposition)

View File

@@ -1,7 +1,6 @@
// Copyright (C) 2004-2025 Robert Griebl
// SPDX-License-Identifier: GPL-3.0-only
#include <QAssociativeIterable>
#include <QDir>
#include <QFileInfo>
#include <QJSValue>
@@ -13,9 +12,14 @@
#include <QQmlEngine>
#include <QQmlExpression>
#include <QQmlInfo>
#include <QSequentialIterable>
#include <QStack>
#include <QStandardPaths>
#if QT_VERSION < QT_VERSION_CHECK(6, 11, 0)
# include <QAssociativeIterable>
# include <QSequentialIterable>
#else
# include <qmetaassociation.h>
#endif
#include "utility/exception.h"
@@ -169,7 +173,11 @@ static QString stringify(const QVariant &value, int level, bool indentFirstLine,
str.append(indent);
if (value.canConvert<QVariantHash>()) {
QAssociativeIterable hash = value.value<QAssociativeIterable>();
#if QT_VERSION < QT_VERSION_CHECK(6, 11, 0)
auto hash = value.value<QAssociativeIterable>();
#else
auto hash = value.value<QMetaAssociation::Iterable>();
#endif
if (hash.size() == 0) {
str.append(u"{}");
} else if (level > 0) {
@@ -186,7 +194,11 @@ static QString stringify(const QVariant &value, int level, bool indentFirstLine,
str = str + indent + u'}';
}
} else if (value.canConvert<QVariantList>() && (value.typeId() != QMetaType::QString)) {
QSequentialIterable list = value.value<QSequentialIterable>();
#if QT_VERSION < QT_VERSION_CHECK(6, 11, 0)
auto list = value.value<QSequentialIterable>();
#else
auto list = value.value<QMetaSequence::Iterable>();
#endif
if (list.size() == 0) {
str.append(u"[]");
} else if (level > 0) {