From 32d23904b29fcab0d7dfca3d6ac9b97563ba88ff Mon Sep 17 00:00:00 2001 From: Axel Spoerl Date: Fri, 21 Mar 2025 12:25:13 +0100 Subject: [PATCH] QtCore: fix build w/o itemmodel removed_api.cpp included qabstractitemmodel.h unconditionally. Wrap it in #if QT_CONFIG(itemmodel) As a drive-by, add the missing blank line after the initial #if QT_CORE_REMOVED_SINCE(6, 8) Amends cbda9583521633fa6e8a9274d2e47aa14c8bd175. Pick-to: 6.9 6.8 Change-Id: I6888d9a76078a2473a0a8f063cf8b93ac3025385 Reviewed-by: Marc Mutz --- src/corelib/compat/removed_api.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp index d315aed8e6b..a8d62fc8f28 100644 --- a/src/corelib/compat/removed_api.cpp +++ b/src/corelib/compat/removed_api.cpp @@ -926,6 +926,8 @@ QUrl QUrl::fromEncoded(const QByteArray &input, ParsingMode mode) #endif // QT_CORE_REMOVED_SINCE(6, 7) #if QT_CORE_REMOVED_SINCE(6, 8) + +#if QT_CONFIG(itemmodel) #include "qabstractitemmodel.h" bool QPersistentModelIndex::operator<(const QPersistentModelIndex &other) const noexcept @@ -948,6 +950,8 @@ bool QPersistentModelIndex::operator!=(const QModelIndex &other) const noexcept return !comparesEqual(*this, other); } +#endif // QT_CONFIG(itemmodel) + #include "qbitarray.h" // inlined API #include "qbytearray.h" // inlined API