summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorFrans Englich <frans.englich@nokia.com>2009-07-13 13:02:20 +0200
committerFrans Englich <frans.englich@nokia.com>2009-07-13 13:41:56 +0200
commit9b6eacab99673d7d9848b341c4cf36a7c35f07c0 (patch)
tree28ffe6a4e49da251658b2042486a5c884aeab5dd /src/corelib
parent425f9035d6309111cdc8f30e1fdb4995e96c38a6 (diff)
QFlags::testFlag(): handle the zero case appropriately.
Brought up by Andy. See perforce change 314809, 17b07e3ab6192b31f77fd2f126705b9ab53b3937. Related to task 221708. Reviewed-By: Andy Shaw (cherry picked from commit cc24c46c117248ecb98200416e7f25375e6bb476)
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qglobal.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 63f6c31232..f650bd25f8 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -2017,7 +2017,7 @@ public:
inline bool operator!() const { return !i; }
- inline bool testFlag(Enum f) const { return (i & f) == f; }
+ inline bool testFlag(Enum f) const { return (i & f) == f && (f != 0 || i == f ); }
};
#define Q_DECLARE_FLAGS(Flags, Enum)\