C
Qul::Flags Class
template <typename Enum> class Qul::FlagsHeader: | #include <Flags> |
Since: | Qt Quick Ultralite 2.12 |
Public Types
Public Functions
Flags() | |
Flags(Enum value) | |
Flags(Enum value1, Enum value2, ...) | |
bool | testFlag(Enum flag) const |
Qul::Flags<Enum>::UnderlyingType | toUnderlyingType() const |
bool | operator bool() const |
bool | operator!() const |
Qul::Flags<Enum> | operator&(Enum rhs) const |
Qul::Flags<Enum> | operator&(Qul::Flags<Enum> rhs) const |
Qul::Flags<Enum> & | operator&=(Enum rhs) |
Qul::Flags<Enum> & | operator&=(Qul::Flags<Enum> rhs) |
Qul::Flags<Enum> | operator|(Enum rhs) const |
Qul::Flags<Enum> | operator|(Qul::Flags<Enum> rhs) const |
Qul::Flags<Enum> & | operator|=(Enum rhs) |
Qul::Flags<Enum> & | operator|=(Qul::Flags<Enum> rhs) |
Detailed Description
The Flags class provides a type-safe way to store OR and AND combinations of enum values.
Member Type Documentation
[alias]
Flags::UnderlyingType
The underlying type used to represent the combined flags.
This is a convenience typedef for std::underlying_type<Enum>::type.
Member Function Documentation
[constexpr]
Flags::Flags()
Initializes a flag object with no flags set.
[explicit constexpr default]
Flags::Flags(Enum value)
Initializes a flag object with the given Enum value set.
[explicit constexpr default]
Flags::Flags(Enum value1, Enum value2, ...)
Initializes a flag object with the given Enum values set.
[constexpr]
bool Flags::testFlag(Enum flag) const
Returns true
if the flag flag is set, otherwise returns false
.
[constexpr]
Qul::Flags<Enum>::UnderlyingType Flags::toUnderlyingType() const
Returns the underlying representation of the combined flags.
[constexpr]
bool Flags::operator bool() const
Returns true
if any flag is set (that is, if the value stored by the Flags object is not 0); otherwise returns false
.
[constexpr]
bool Flags::operator!() const
Returns true
if no flag is set (that is, if the value stored by the Flags object is 0); otherwise returns false
.
[constexpr]
Qul::Flags<Enum> Flags::operator&(Enum rhs) const
Returns a Flags object representing the logical AND combination of the currently set flags and rhs flag.
[constexpr]
Qul::Flags<Enum> Flags::operator&(Qul::Flags<Enum> rhs) const
Returns a Flags object representing the logical AND combination of the currently set flags and the flags set in rhs.
Qul::Flags<Enum> &Flags::operator&=(Enum rhs)
Sets the flags to be the logical AND combination of the currently set flags and the rhs flag.
Qul::Flags<Enum> &Flags::operator&=(Qul::Flags<Enum> rhs)
Sets the flags to be the logical AND combination of the currently set flags and the flags set in rhs.
[constexpr]
Qul::Flags<Enum> Flags::operator|(Enum rhs) const
Returns a Flags object representing the logical OR combination of the currently set flags and the rhs flag.
[constexpr]
Qul::Flags<Enum> Flags::operator|(Qul::Flags<Enum> rhs) const
Returns a Flags object representing the logical OR combination of the currently set flags and the flags set in rhs.
Qul::Flags<Enum> &Flags::operator|=(Enum rhs)
Sets the flags to be the logical OR combination of the currently set flags and the rhs flag.
Qul::Flags<Enum> &Flags::operator|=(Qul::Flags<Enum> rhs)
Sets the flags to be the logical OR combination of the currently set flags and the flags set in rhs.
Available under certain Qt licenses.
Find out more.