diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h index 82fcbdd54dc..c6ecb1ea47f 100644 --- a/src/corelib/global/qflags.h +++ b/src/corelib/global/qflags.h @@ -145,7 +145,7 @@ class QFlags constexpr inline bool operator!() const noexcept { return !i; } - constexpr inline bool testFlag(Enum flag) const noexcept { return (i & Int(flag)) == Int(flag) && (Int(flag) != 0 || i == Int(flag) ); } + constexpr inline bool testFlag(Enum flag) const noexcept { return (i & Int(flag)) == Int(flag) && (Int(flag) != 0 || i == Int(0) ); } constexpr inline QFlags &setFlag(Enum flag, bool on = true) noexcept { return on ? (*this |= flag) : (*this &= ~QFlags(flag));