diff options
author | Rym Bouabid <rym.bouabid@qt.io> | 2024-02-13 18:22:06 +0100 |
---|---|---|
committer | Rym Bouabid <rym.bouabid@qt.io> | 2024-02-22 13:37:41 +0100 |
commit | 22ebe86f1511f7f06031df1da030b78c1e8092c9 (patch) | |
tree | 0ed3790749530366d0a129c7eeb4dd3f2dacd42a /src/corelib/io/qprocess.h | |
parent | 14b058048247098ba4d81427290f2a083d513dc2 (diff) |
QProcessEnvironment: Use new comparison helper macros
QProcessEnvironment had operator==() and operator!=() defined as public
member functions, so use QT_CORE_REMOVED_SINCE and removed_api.cpp to
get rid of these methods and replace them with a hidden friend.
Use QT_TEST_ALL_EQUALITY_OPS macro in unit-tests.
Use new \compares command in the documentation to describe the
comparison operators provided by QProcessEnvironment.
Task-number: QTBUG-120303
Change-Id: I4c57f6cfb9589e82a37eea6993e079212b34cecd
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/corelib/io/qprocess.h')
-rw-r--r-- | src/corelib/io/qprocess.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/io/qprocess.h b/src/corelib/io/qprocess.h index dc576ebc04..34724a6794 100644 --- a/src/corelib/io/qprocess.h +++ b/src/corelib/io/qprocess.h @@ -5,6 +5,7 @@ #ifndef QPROCESS_H #define QPROCESS_H +#include <QtCore/qcompare.h> #include <QtCore/qiodevice.h> #include <QtCore/qstringlist.h> #include <QtCore/qshareddata.h> @@ -41,9 +42,11 @@ public: void swap(QProcessEnvironment &other) noexcept { d.swap(other.d); } +#if QT_CORE_REMOVED_SINCE(6, 8) bool operator==(const QProcessEnvironment &other) const; inline bool operator!=(const QProcessEnvironment &other) const - { return !(*this == other); } + { return !operator==(other); } +#endif bool isEmpty() const; [[nodiscard]] bool inheritsFromParent() const; @@ -63,6 +66,9 @@ public: static QProcessEnvironment systemEnvironment(); private: + friend Q_CORE_EXPORT bool comparesEqual(const QProcessEnvironment &lhs, + const QProcessEnvironment &rhs); + Q_DECLARE_EQUALITY_COMPARABLE(QProcessEnvironment) friend class QProcessPrivate; friend class QProcessEnvironmentPrivate; QSharedDataPointer<QProcessEnvironmentPrivate> d; |