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:36:45 (GMT)
commitcc24c46c117248ecb98200416e7f25375e6bb476 (patch)
tree5b15f68fbe18db5274e9ed48f0f38476bb3af336 /src
parent0aca5cf05288dc4d2175d1c4a78bf62a5ea96b21 (diff)
downloadQt-cc24c46c117248ecb98200416e7f25375e6bb476.zip
Qt-cc24c46c117248ecb98200416e7f25375e6bb476.tar.gz
Qt-cc24c46c117248ecb98200416e7f25375e6bb476.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
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 a139a55..d6c708c 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -2062,7 +2062,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)\