Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qflags.h File Reference

(0677d334f85f6d39f6f6495162eec69712e42370)

#include <QtCore/qcompare_impl.h>
#include <QtCore/qtypeinfo.h>
#include <initializer_list>
+ Include dependency graph for qflags.h:

Go to the source code of this file.

Classes

class  QFlag
 
class  QIncompatibleFlag
 
class  QFlags< Enum >
 

Macros

#define Q_DECLARE_FLAGS(Flags, Enum)   typedef QFlags<Enum> Flags;
 
#define QT_DECLARE_TYPESAFE_OPERATORS_FOR_FLAGS_ENUM(Flags)
 
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
 
#define Q_DECLARE_MIXED_ENUM_OPERATOR(op, Ret, LHS, RHS)    static_assert(std::is_same_v<decltype(std::declval<LHS>() op std::declval<RHS>()), Ret>);
 
#define Q_DECLARE_MIXED_ENUM_OPERATORS(Ret, Flags, Enum)
 
#define Q_DECLARE_MIXED_ENUM_OPERATORS_SYMMETRIC(Ret, Flags, Enum)
 

Functions

 Q_DECLARE_TYPEINFO (QFlag, Q_PRIMITIVE_TYPE)
 
 Q_DECLARE_TYPEINFO (QIncompatibleFlag, Q_PRIMITIVE_TYPE)
 

Macro Definition Documentation

◆ Q_DECLARE_FLAGS

#define Q_DECLARE_FLAGS ( Flags,
Enum )   typedef QFlags<Enum> Flags;

Definition at line 174 of file qflags.h.

Referenced by QV4::Heap::DECLARE_HEAP_OBJECT().

◆ Q_DECLARE_MIXED_ENUM_OPERATOR

#define Q_DECLARE_MIXED_ENUM_OPERATOR ( op,
Ret,
LHS,
RHS )    static_assert(std::is_same_v<decltype(std::declval<LHS>() op std::declval<RHS>()), Ret>);

Definition at line 237 of file qflags.h.

◆ Q_DECLARE_MIXED_ENUM_OPERATORS

#define Q_DECLARE_MIXED_ENUM_OPERATORS ( Ret,
Flags,
Enum )
Value:
Q_DECLARE_MIXED_ENUM_OPERATOR(&, Ret, Flags, Enum) \
Q_DECLARE_MIXED_ENUM_OPERATOR(^, Ret, Flags, Enum) \
/* end */
#define Q_DECLARE_MIXED_ENUM_OPERATOR(op, Ret, LHS, RHS)
Definition qflags.h:237
Flags

Definition at line 241 of file qflags.h.

◆ Q_DECLARE_MIXED_ENUM_OPERATORS_SYMMETRIC

#define Q_DECLARE_MIXED_ENUM_OPERATORS_SYMMETRIC ( Ret,
Flags,
Enum )
Value:
Q_DECLARE_MIXED_ENUM_OPERATORS(Ret, Enum, Flags) \
/* end */
#define Q_DECLARE_MIXED_ENUM_OPERATORS(Ret, Flags, Enum)
Definition qflags.h:241

Definition at line 247 of file qflags.h.

◆ Q_DECLARE_OPERATORS_FOR_FLAGS

#define Q_DECLARE_OPERATORS_FOR_FLAGS ( Flags)
Value:
[[maybe_unused]] \
constexpr inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, Flags::enum_type f2) noexcept \
{ return QFlags<Flags::enum_type>(f1) | f2; } \
[[maybe_unused]] \
constexpr inline QFlags<Flags::enum_type> operator|(Flags::enum_type f1, QFlags<Flags::enum_type> f2) noexcept \
{ return f2 | f1; } \
[[maybe_unused]] \
constexpr inline QFlags<Flags::enum_type> operator&(Flags::enum_type f1, Flags::enum_type f2) noexcept \
{ return QFlags<Flags::enum_type>(f1) & f2; } \
[[maybe_unused]] \
constexpr inline QFlags<Flags::enum_type> operator&(Flags::enum_type f1, QFlags<Flags::enum_type> f2) noexcept \
{ return f2 & f1; } \
[[maybe_unused]] \
constexpr inline QFlags<Flags::enum_type> operator^(Flags::enum_type f1, Flags::enum_type f2) noexcept \
{ return QFlags<Flags::enum_type>(f1) ^ f2; } \
[[maybe_unused]] \
constexpr inline QFlags<Flags::enum_type> operator^(Flags::enum_type f1, QFlags<Flags::enum_type> f2) noexcept \
{ return f2 ^ f1; } \
constexpr inline void operator+(Flags::enum_type f1, Flags::enum_type f2) noexcept = delete; \
constexpr inline void operator+(Flags::enum_type f1, QFlags<Flags::enum_type> f2) noexcept = delete; \
constexpr inline void operator+(int f1, QFlags<Flags::enum_type> f2) noexcept = delete; \
constexpr inline void operator-(Flags::enum_type f1, Flags::enum_type f2) noexcept = delete; \
constexpr inline void operator-(Flags::enum_type f1, QFlags<Flags::enum_type> f2) noexcept = delete; \
constexpr inline void operator-(int f1, QFlags<Flags::enum_type> f2) noexcept = delete; \
constexpr inline void operator+(int f1, Flags::enum_type f2) noexcept = delete; \
constexpr inline void operator+(Flags::enum_type f1, int f2) noexcept = delete; \
constexpr inline void operator-(int f1, Flags::enum_type f2) noexcept = delete; \
constexpr inline void operator-(Flags::enum_type f1, int f2) noexcept = delete; \
QT_DECLARE_TYPESAFE_OPERATORS_FOR_FLAGS_ENUM(Flags)
QBitArray operator^(const QBitArray &a1, const QBitArray &a2)
constexpr timespec operator+(const timespec &t1, const timespec &t2)
constexpr timespec operator-(const timespec &t1, const timespec &t2)
constexpr QKeyCombination operator|(Qt::Modifier modifier, Qt::Key key) noexcept
static bool operator&(QSortFilterProxyModelPrivate::Direction a, QSortFilterProxyModelPrivate::Direction b)

Definition at line 194 of file qflags.h.

◆ QT_DECLARE_TYPESAFE_OPERATORS_FOR_FLAGS_ENUM

#define QT_DECLARE_TYPESAFE_OPERATORS_FOR_FLAGS_ENUM ( Flags)
Value:
[[maybe_unused]] \
constexpr inline QIncompatibleFlag operator|(Flags::enum_type f1, int f2) noexcept \
{ return QIncompatibleFlag(int(f1) | f2); }

Definition at line 188 of file qflags.h.

Function Documentation

◆ Q_DECLARE_TYPEINFO() [1/2]

Q_DECLARE_TYPEINFO ( QFlag ,
Q_PRIMITIVE_TYPE  )

◆ Q_DECLARE_TYPEINFO() [2/2]

Q_DECLARE_TYPEINFO ( QIncompatibleFlag ,
Q_PRIMITIVE_TYPE  )