You may also want to consider using QMap<> since it gives you automatic sorting support, and has features like upperBound()/lowerBound() to "soft" search by index.