summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2017-11-18 18:21:13 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2017-11-24 18:23:34 +0000
commit3587a25238b5c0a53285f96383ed0af1c05b3153 (patch)
treee8c73401a9d64d9021f1498c571ba50cb4fbcfce /src/corelib/global
parent655cbb00a0a50588dcf527d2e7fdfeb172ba60ae (diff)
QFlags: support enum classes in setFlag()
Unary ~ is not defined for enum classes, so we need a cast. Change-Id: I79d495ebcc24ab960da8dae3be08eb307a9de448 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qflags.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h
index feeb488acd..72b0a689ff 100644
--- a/src/corelib/global/qflags.h
+++ b/src/corelib/global/qflags.h
@@ -150,7 +150,7 @@ public:
Q_DECL_CONSTEXPR inline bool testFlag(Enum f) const Q_DECL_NOTHROW { return (i & Int(f)) == Int(f) && (Int(f) != 0 || i == Int(f) ); }
Q_DECL_RELAXED_CONSTEXPR inline QFlags &setFlag(Enum f, bool on = true) Q_DECL_NOTHROW
{
- return on ? (*this |= f) : (*this &= ~f);
+ return on ? (*this |= f) : (*this &= ~Int(f));
}
private: