From d5c605b14896a444430414a7dc719397107cdc9d Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 6 Dec 2021 13:30:10 +0100 Subject: QMetaType: port the BC fix for id() to new QT_REMOVED_SINCE The allows qmetatype.cpp compilation to enjoy PCH again. Change-Id: I47c5af33a5dbc930ee4c120b254e732c52bc2369 Reviewed-by: Fabian Kosmale --- src/corelib/compat/removed_api.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/corelib/compat/removed_api.cpp') diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp index 8d5bfb44a7..566c7b608b 100644 --- a/src/corelib/compat/removed_api.cpp +++ b/src/corelib/compat/removed_api.cpp @@ -43,6 +43,23 @@ QT_USE_NAMESPACE +#if QT_REMOVED_SINCE(6, 1) + +#include "qmetatype.h" + +// keep in sync with version in header +int QMetaType::id() const +{ + if (d_ptr) { + if (int id = d_ptr->typeId.loadRelaxed()) + return id; + return idHelper(); + } + return 0; +} + +#endif // QT_REMOVED_SINCE(6, 1) + #if QT_REMOVED_SINCE(6, 3) #include "tools/qcryptographichash.h" -- cgit v1.2.3