From 7b738ffc583a19138d9772d7ed84c8d771c85a77 Mon Sep 17 00:00:00 2001 From: Tatiana Borisova Date: Fri, 19 Apr 2024 15:20:05 +0200 Subject: QRegularExpression: use modernize comparisons Replace class operators operator==(), operator!=() of QRegularExpression to friend method comparesEqual() and Q_DECLARE_EQUALITY_COMPARABLE macro. Use QT_CORE_REMOVED_SINCE and removed_api.cpp to get rid of current comparison methods and replace them with a friend. Task-number: QTBUG-120304 Change-Id: Ib6fc83d29ad9bc710c2fdf32a3d60131fbf298b6 Reviewed-by: Ivan Solovev --- src/corelib/compat/removed_api.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/corelib/compat') diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp index 23679bf4cc..ed285dc8f1 100644 --- a/src/corelib/compat/removed_api.cpp +++ b/src/corelib/compat/removed_api.cpp @@ -1069,6 +1069,11 @@ qsizetype QRegularExpressionMatch::capturedEnd(QStringView name) const { return capturedEnd(QAnyStringView(name)); } + +bool QRegularExpression::operator==(const QRegularExpression &other) const +{ + return comparesEqual(*this, other); +} #endif // QT_CONFIG(regularexpression) #include "qstring.h" // inlined API -- cgit v1.2.3