[Qt-interest] QAbstractItemModel::match and MatchFlags
Eric Clark
eclark at ara.com
Sat Jun 18 00:51:21 CEST 2011
Hello Everyone,
I have been looking at this for quite some time trying to figure why it is the way it is because the Qt guys are usually pretty darn good and usually have a very good reason for why they do things the way they do, but I cannot figure this one out. I am making a custom match function in my model and I am trying to handle all of the flags that can be passed into the function, but there are a few flags that are really throwing me off:
MatchFlag::MatchContains = 1
MatchFlag::MatchStartsWith = 2
MatchFlag::MatchEndsWIth = 3
The flag for MatchEndsWith has two bits flipped, and the two bits (position 0 and 1) match the bits for MatchContains and MatchStartsWith. In other words:
MatchEndsWith == MatchContains | MatchStartsWith;
This seems very wrong to me. To me, it seems like it should really be:
MatchFlag::MatchContains = 3
MatchFlag::MatchStartsWith = 2
MatchFlag::MatchEndsWIth = 1
MatchContains == MatchEndsWith | MatchStartsWith;
I do not see how setting the ends with flag should also be setting the starts with and contains flag. I hope I explained this right. Please can someone explain to me what I am seeing? Is this my imagination or this an actual error in the code?
Thank You,
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110617/1ecfaeca/attachment.html
More information about the Qt-interest-old
mailing list