QSizePolicy: make qHash() a hidden friend
Less noisy compiler error messages. [ChangeLog][Potentially Source-Incompatible Changes][QSizePolicy] qHash() is now a hidden friend and can only be called by unqualified (qHash(sp)), not by qualified lookup (as in, say, ::qHash(sp) or QT_PREPEND_NAMESPACE(qHash)(sp)). Task-number: QTBUG-98863 Change-Id: I37d26c661c2d8bb74350eb9378bd19fa426678d2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
parent
f1c2b6f5f9
commit
2d2104da7c
@ -317,9 +317,8 @@ void QSizePolicy::setControlType(ControlType type) noexcept
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn size_t qHash(QSizePolicy key, size_t seed = 0)
|
\fn size_t QSizePolicy::qHash(QSizePolicy key, size_t seed = 0)
|
||||||
\since 5.6
|
\since 5.6
|
||||||
\relates QSizePolicy
|
|
||||||
|
|
||||||
Returns the hash value for \a key, using
|
Returns the hash value for \a key, using
|
||||||
\a seed to seed the calculation.
|
\a seed to seed the calculation.
|
||||||
|
@ -43,14 +43,13 @@
|
|||||||
#include <QtWidgets/qtwidgetsglobal.h>
|
#include <QtWidgets/qtwidgetsglobal.h>
|
||||||
#include <QtCore/qobject.h>
|
#include <QtCore/qobject.h>
|
||||||
#include <QtCore/qalgorithms.h>
|
#include <QtCore/qalgorithms.h>
|
||||||
|
#include <QtCore/qhashfunctions.h>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class QVariant;
|
class QVariant;
|
||||||
class QSizePolicy;
|
class QSizePolicy;
|
||||||
|
|
||||||
Q_DECL_CONST_FUNCTION inline size_t qHash(QSizePolicy key, size_t seed = 0) noexcept;
|
|
||||||
|
|
||||||
class Q_WIDGETS_EXPORT QSizePolicy
|
class Q_WIDGETS_EXPORT QSizePolicy
|
||||||
{
|
{
|
||||||
Q_GADGET
|
Q_GADGET
|
||||||
@ -122,7 +121,7 @@ public:
|
|||||||
constexpr bool operator==(const QSizePolicy& s) const noexcept { return data == s.data; }
|
constexpr bool operator==(const QSizePolicy& s) const noexcept { return data == s.data; }
|
||||||
constexpr bool operator!=(const QSizePolicy& s) const noexcept { return data != s.data; }
|
constexpr bool operator!=(const QSizePolicy& s) const noexcept { return data != s.data; }
|
||||||
|
|
||||||
friend Q_DECL_CONST_FUNCTION size_t qHash(QSizePolicy key, size_t seed) noexcept { return qHash(key.data, seed); }
|
friend Q_DECL_CONST_FUNCTION size_t qHash(QSizePolicy key, size_t seed = 0) noexcept { return qHash(key.data, seed); }
|
||||||
|
|
||||||
operator QVariant() const;
|
operator QVariant() const;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user