From a45a3b1ece490bcae5cccd858dbe11408a19bee0 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 28 Oct 2020 00:02:59 +0100 Subject: Make comparison operators in gui/painting classes hidden friends Reduce ADL noise from QColorSpace, QPageSize, and QPageLayout with the help of a private equals method. Change-Id: I0082597dd216b982e8d8eb5a4bd7dd29a5d3263b Reviewed-by: Allan Sandfeld Jensen --- src/gui/painting/qpagesize.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/gui/painting/qpagesize.h') diff --git a/src/gui/painting/qpagesize.h b/src/gui/painting/qpagesize.h index fbaec0da3f..72d24ed938 100644 --- a/src/gui/painting/qpagesize.h +++ b/src/gui/painting/qpagesize.h @@ -283,6 +283,13 @@ public: private: friend class QPageSizePrivate; friend class QPlatformPrintDevice; + + bool equals(const QPageSize &other) const; + friend inline bool operator==(const QPageSize &lhs, const QPageSize &rhs) + { return lhs.equals(rhs); } + friend inline bool operator!=(const QPageSize &lhs, const QPageSize &rhs) + { return !(lhs == rhs); } + QPageSize(const QString &key, const QSize &pointSize, const QString &name); QPageSize(int windowsId, const QSize &pointSize, const QString &name); QPageSize(QPageSizePrivate &dd); @@ -291,10 +298,6 @@ private: Q_DECLARE_SHARED(QPageSize) -Q_GUI_EXPORT bool operator==(const QPageSize &lhs, const QPageSize &rhs); -inline bool operator!=(const QPageSize &lhs, const QPageSize &rhs) -{ return !operator==(lhs, rhs); } - #ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug dbg, const QPageSize &pageSize); #endif -- cgit v1.2.3