diff options
author | Marc Mutz <marc.mutz@qt.io> | 2021-12-06 13:30:10 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2021-12-06 19:06:30 +0100 |
commit | d5c605b14896a444430414a7dc719397107cdc9d (patch) | |
tree | a18e83050c0c4d59e25b443ee4b1580092b4e516 /src/corelib/compat | |
parent | d3646d2b05925fba5fbe8fd3118b535ec2d3a05c (diff) |
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 <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/compat')
-rw-r--r-- | src/corelib/compat/removed_api.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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" |