diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2021-05-02 01:32:03 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2021-05-11 13:22:44 +0200 |
commit | d2759e0e32c613b18123970ac15aa1f71949a5e7 (patch) | |
tree | 07e5123f8e3f44ca3d74cd7122ab0b9837d6ba79 /src/corelib/global/qglobal.cpp | |
parent | 53049d60277e0168a6c9f514674f26f9c25df84b (diff) |
QFlags: add operator& / &= overloads taking a QFlags object
It makes no sense to offer the "type-unsafe" operators taking a plain
int, and not offer the ones taking a QFlags object. Using these
operators has actually always worked by going through a conversion to
int, but we're going to limit that possibility in the future.
[ChangeLog][QtCore][QFlags] The operator& and operator&= now accept
a QFlags object.
Change-Id: Iee0845640014d35b646787e8bdb77854f180a9ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qglobal.cpp')
-rw-r--r-- | src/corelib/global/qglobal.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index 8753ac65f4..c1a6e7a268 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -378,6 +378,13 @@ static_assert(sizeof(qint64) == 8, "Internal error, qint64 is misdefined"); */ /*! + \fn template <typename Enum> QFlags &QFlags<Enum>::operator&=(QFlags mask) + \since 6.2 + + \overload +*/ + +/*! \fn template <typename Enum> QFlags &QFlags<Enum>::operator|=(QFlags other) Performs a bitwise OR operation with \a other and stores the @@ -467,6 +474,13 @@ static_assert(sizeof(qint64) == 8, "Internal error, qint64 is misdefined"); */ /*! + \fn template <typename Enum> QFlags QFlags<Enum>::operator&(QFlags mask) const + \since 6.2 + + \overload +*/ + +/*! \fn template <typename Enum> QFlags QFlags<Enum>::operator~() const Returns a QFlags object that contains the bitwise negation of |