summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrans Englich <frans.englich@nokia.com>2009-07-13 11:02:20 (GMT)
committerFrans Englich <frans.englich@nokia.com>2009-07-13 11:41:56 (GMT)
commit9b6eacab99673d7d9848b341c4cf36a7c35f07c0 (patch)
tree28ffe6a4e49da251658b2042486a5c884aeab5dd /src
parent425f9035d6309111cdc8f30e1fdb4995e96c38a6 (diff)
downloadQt-9b6eacab99673d7d9848b341c4cf36a7c35f07c0.zip
Qt-9b6eacab99673d7d9848b341c4cf36a7c35f07c0.tar.gz
Qt-9b6eacab99673d7d9848b341c4cf36a7c35f07c0.tar.bz2
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')
-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 63f6c31..f650bd2 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)\