QList compatible with STL. Therefore, you can use it with the STL algorithm:
struct NameKeyMatch { NameKeyMatch(const std::string & s1, const std::string & s2, const std::string & s3, const std::string & s4) : fullName(s1), probeName(s2), format(s3), source(s4) {} bool operator()(const NameKey & x) const { return fullName.size() && x.fullName == fullName && probeName.size && x.probeName == probeName && format.size && x.format == format && source.size && x.source == source; } std::string fullName; std::string probeName; std::string format; std::string source; }; QList<int>::iterator i = std::find_if(keyList.begin(), keyList.end(), NameKeyMatch("Full Name", "", "Format", ""));
I do not know if Qt will actively support STL compatibility.
Stephen chu
source share