[PyQt] Qt.MatchFlags AND comparison

2010-09-05 Thread Demetrius Cassidy

Having a hard time figuring something that should be simple.

If I do Qt.MatchWildcard  Qt.MatchContains, it returns 1, but if I do
Qt.MatchContains  anything else (other than Qt.MatchContains itself) it
returns 0 as expected. What am I doing wrong, and how am I supposed to
compare my flags to a specific flag other than doing bitwise AND against the
other flag?
-- 
View this message in context: 
http://old.nabble.com/Qt.MatchFlags-AND-comparison-tp29627864p29627864.html
Sent from the PyQt mailing list archive at Nabble.com.

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Qt.MatchFlags AND comparison

2010-09-05 Thread Phil Thompson
On Sun, 5 Sep 2010 09:37:19 -0700 (PDT), Demetrius Cassidy
dcassid...@mass.rr.com wrote:
 Having a hard time figuring something that should be simple.
 
 If I do Qt.MatchWildcard  Qt.MatchContains, it returns 1, but if I do
 Qt.MatchContains  anything else (other than Qt.MatchContains itself) it
 returns 0 as expected. What am I doing wrong, and how am I supposed to
 compare my flags to a specific flag other than doing bitwise AND against
 the
 other flag?

You need to read the docs more closely - particularly related to the
actual numerical value. It's a badly designed type - the lower 3 bits
behave like an enum (ie. mutually exclusive), the remaining bits behave
like flags. It should really be split into a MatchType enum and a
MatchModifier set of flags.

Phil
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt