Qt and finding partial matches in a QList

Posted by ExpatEgghead on Stack Overflow See other posts from Stack Overflow or by ExpatEgghead
Published on 2010-06-07T13:51:59Z Indexed on 2010/06/07 14:12 UTC
Read the original article Hit count: 206

Filed under:
|

I have a struct viz:

struct NameKey
{
    std::string      fullName;
    std::string      probeName;
    std::string      format;
    std::string      source;
}

which are held in a QList:

QList<NameKey> keyList;

what I need to do is find an occurence in keyList of a partial match where the search is for a NameKey that only has two members filled. All the keyList entries are full NameKey's.

My current implementation is , well, boring in the extreme with too many if's and conditions.

So, If I have a DataKey with a fullName and a format I need to find all the occurences in keyList which match. Any useful Qt/boost things available?

© Stack Overflow or respective owner

Related posts about c++

Related posts about qt