summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qurlquery.h
diff options
context:
space:
mode:
authorRym Bouabid <rym.bouabid@qt.io>2024-02-14 16:15:19 +0100
committerRym Bouabid <rym.bouabid@qt.io>2024-02-23 19:46:02 +0100
commitcd67684c89ab6e8b951778c317d459124e6d9c5d (patch)
tree5359934955503ec164009cf2edee22418344c61f /src/corelib/io/qurlquery.h
parentddcbf02d2004baab53c88a5661b5350942ebff75 (diff)
QUrlQuery: Use new comparison helper macros
QUrlQuery 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 QUrlQuery. Task-number: QTBUG-120303 Change-Id: I083487a134887010ebbb78906d2c1982f2ad41b5 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/corelib/io/qurlquery.h')
-rw-r--r--src/corelib/io/qurlquery.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/io/qurlquery.h b/src/corelib/io/qurlquery.h
index de2cdf4940..061107606e 100644
--- a/src/corelib/io/qurlquery.h
+++ b/src/corelib/io/qurlquery.h
@@ -5,6 +5,7 @@
#ifndef QURLQUERY_H
#define QURLQUERY_H
+#include <QtCore/qcompare.h>
#include <QtCore/qshareddata.h>
#include <QtCore/qurl.h>
@@ -34,9 +35,11 @@ public:
QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QUrlQuery)
~QUrlQuery();
+#if QT_CORE_REMOVED_SINCE(6, 8)
bool operator==(const QUrlQuery &other) const;
bool operator!=(const QUrlQuery &other) const
- { return !(*this == other); }
+ { return !operator==(other); }
+#endif
void swap(QUrlQuery &other) noexcept { d.swap(other.d); }
@@ -67,6 +70,8 @@ public:
static constexpr char16_t defaultQueryPairDelimiter() noexcept { return u'&'; }
private:
+ friend Q_CORE_EXPORT bool comparesEqual(const QUrlQuery &lhs, const QUrlQuery &rhs);
+ Q_DECLARE_EQUALITY_COMPARABLE(QUrlQuery)
friend class QUrl;
friend Q_CORE_EXPORT size_t qHash(const QUrlQuery &key, size_t seed) noexcept;
QSharedDataPointer<QUrlQueryPrivate> d;