Quote Originally Posted by wysota View Post
Won't QAbstractItemModel::match() allow you to find the proper index?
Thanks, I have things working at the moment using functions to find next, prev etc with sql. But I'll have a look into the match method, seems much simpler and exactly what I was looking for.

Quote Originally Posted by wysota View Post
Anyway, wouldn't it be better if the lookup dialog returned a model index instead of the field value? If you operate on the same set of tables, it would be wise to stick with the model interface everywhere possible.
I did consider using the same model across all windows/dialogs. However, I decided against that given an example situation such as;

1. Main Client List window - user filters the records
2. Client Detail/Edit window - user creates a new record

Now, if the new record doesn't fit the filter, then from the users perspective their newly created record 'vanishes'.