diff --git a/src/corelib/global/qtdeprecationmarkers.h b/src/corelib/global/qtdeprecationmarkers.h index e87c860400..d283954167 100644 --- a/src/corelib/global/qtdeprecationmarkers.h +++ b/src/corelib/global/qtdeprecationmarkers.h @@ -201,6 +201,14 @@ QT_BEGIN_NAMESPACE # define QT_DEPRECATED_VERSION_6_9 #endif +#if QT_WARN_DEPRECATED_UP_TO >= QT_VERSION_CHECK(6, 10, 0) +# define QT_DEPRECATED_VERSION_X_6_10(text) QT_DEPRECATED_X(text) +# define QT_DEPRECATED_VERSION_6_10 QT_DEPRECATED +#else +# define QT_DEPRECATED_VERSION_X_6_10(text) +# define QT_DEPRECATED_VERSION_6_10 +#endif + #define QT_DEPRECATED_VERSION_X_5(minor, text) QT_DEPRECATED_VERSION_X_5_##minor(text) #define QT_DEPRECATED_VERSION_X(major, minor, text) QT_DEPRECATED_VERSION_X_##major##_##minor(text) @@ -297,6 +305,12 @@ QT_BEGIN_NAMESPACE # define QT_IF_DEPRECATED_SINCE_6_9(whenTrue, whenFalse) whenTrue #endif +#if QT_DEPRECATED_SINCE(6, 10) +# define QT_IF_DEPRECATED_SINCE_6_10(whenTrue, whenFalse) whenFalse +#else +# define QT_IF_DEPRECATED_SINCE_6_10(whenTrue, whenFalse) whenTrue +#endif + #ifdef __cplusplus // A tag to help mark stuff deprecated (cf. QStringViewLiteral) namespace QtPrivate { diff --git a/src/corelib/ipc/qsharedmemory.cpp b/src/corelib/ipc/qsharedmemory.cpp index ea0ff4f1b3..9e33b1d995 100644 --- a/src/corelib/ipc/qsharedmemory.cpp +++ b/src/corelib/ipc/qsharedmemory.cpp @@ -132,6 +132,7 @@ QSharedMemory::QSharedMemory(const QNativeIpcKey &key, QObject *parent) setNativeKey(key); } +#if QT_DEPRECATED_SINCE(6, 10) /*! \deprecated @@ -148,6 +149,7 @@ QSharedMemory::QSharedMemory(const QString &key, QObject *parent) { d_func()->legacyKey = key; } +#endif /*! The destructor clears the key, which forces the shared memory object @@ -166,7 +168,9 @@ QSharedMemory::~QSharedMemory() d->cleanHandle(); } +#if QT_DEPRECATED_SINCE(6, 10) /*! + \deprecated \overload Sets the legacy \a key for this shared memory object. If \a key is the same @@ -192,6 +196,7 @@ void QSharedMemory::setKey(const QString &key) setNativeKey(legacyNativeKey(key)); d->legacyKey = key; } +#endif /*! \since 4.8 @@ -300,6 +305,7 @@ bool QSharedMemoryPrivate::initKey(SemaphoreAccessMode mode) return true; } +#if QT_DEPRECATED_SINCE(6, 10) /*! \deprecated Returns the legacy key assigned with setKey() to this shared memory, or a null key @@ -317,6 +323,7 @@ QString QSharedMemory::key() const Q_D(const QSharedMemory); return d->legacyKey; } +#endif /*! \since 4.8 diff --git a/src/corelib/ipc/qsharedmemory.h b/src/corelib/ipc/qsharedmemory.h index 2944366095..f8218cb0fe 100644 --- a/src/corelib/ipc/qsharedmemory.h +++ b/src/corelib/ipc/qsharedmemory.h @@ -50,12 +50,12 @@ public: QSharedMemory(const QNativeIpcKey &key, QObject *parent = nullptr); ~QSharedMemory(); -#if QT_DEPRECATED_SINCE(6, 9) - QT_DEPRECATED_VERSION_X_6_9("Please refer to 'Native IPC Key' documentation") +#if QT_DEPRECATED_SINCE(6, 10) + QT_DEPRECATED_VERSION_X_6_10("Please refer to 'Native IPC Key' documentation") QSharedMemory(const QString &key, QObject *parent = nullptr); - QT_DEPRECATED_VERSION_X_6_9("Please refer to 'Native IPC Key' documentation") + QT_DEPRECATED_VERSION_X_6_10("Please refer to 'Native IPC Key' documentation") void setKey(const QString &key); - QT_DEPRECATED_VERSION_X_6_9("Please refer to 'Native IPC Key' documentation") + QT_DEPRECATED_VERSION_X_6_10("Please refer to 'Native IPC Key' documentation") QString key() const; #endif @@ -102,4 +102,3 @@ private: QT_END_NAMESPACE #endif // QSHAREDMEMORY_H - diff --git a/src/corelib/ipc/qsystemsemaphore.cpp b/src/corelib/ipc/qsystemsemaphore.cpp index c41ae6dbc2..0f59b378a3 100644 --- a/src/corelib/ipc/qsystemsemaphore.cpp +++ b/src/corelib/ipc/qsystemsemaphore.cpp @@ -68,6 +68,7 @@ inline void QSystemSemaphorePrivate::destructBackend() \sa {Inter-Process Communication}, QSharedMemory, QSemaphore */ +#if QT_DEPRECATED_SINCE(6, 10) /*! \deprecated @@ -85,6 +86,7 @@ QSystemSemaphore::QSystemSemaphore(const QString &key, int initialValue, AccessM { d->legacyKey = key; } +#endif /*! Requests a system semaphore for the specified \a key. The parameters @@ -227,6 +229,7 @@ QNativeIpcKey QSystemSemaphore::nativeIpcKey() const return d->nativeKey; } +#if QT_DEPRECATED_SINCE(6, 10) /*! \deprecated This function works the same as the constructor. It reconstructs @@ -255,6 +258,7 @@ QString QSystemSemaphore::key() const { return d->legacyKey; } +#endif /*! Acquires one of the resources guarded by this semaphore, if there is diff --git a/src/corelib/ipc/qsystemsemaphore.h b/src/corelib/ipc/qsystemsemaphore.h index 2eec661ab3..bd0057e6b7 100644 --- a/src/corelib/ipc/qsystemsemaphore.h +++ b/src/corelib/ipc/qsystemsemaphore.h @@ -47,12 +47,12 @@ public: { setNativeKey({ key, type }, initialValue, mode); } QNativeIpcKey nativeIpcKey() const; -#if QT_DEPRECATED_SINCE(6, 9) - QT_DEPRECATED_VERSION_X_6_9("Please refer to 'Native IPC Key' documentation") +#if QT_DEPRECATED_SINCE(6, 10) + QT_DEPRECATED_VERSION_X_6_10("Please refer to 'Native IPC Key' documentation") QSystemSemaphore(const QString &key, int initialValue = 0, AccessMode mode = Open); - QT_DEPRECATED_VERSION_X_6_9("Please refer to 'Native IPC Key' documentation") + QT_DEPRECATED_VERSION_X_6_10("Please refer to 'Native IPC Key' documentation") void setKey(const QString &key, int initialValue = 0, AccessMode mode = Open); - QT_DEPRECATED_VERSION_X_6_9("Please refer to 'Native IPC Key' documentation") + QT_DEPRECATED_VERSION_X_6_10("Please refer to 'Native IPC Key' documentation") QString key() const; #endif @@ -78,4 +78,3 @@ private: QT_END_NAMESPACE #endif // QSYSTEMSEMAPHORE_H -