I'm using the standard pattern to decorate a comboBox's list items with the values from a mapped column (mapping foreign key -> text column), but I cannot find a pattern that also allows one to use the QSortFilterProxyModel class to sort the secondary (mapped) column values (text, ascending order) in the comboBox.

Given a table like:

Qt Code:
  1. 1 unassigned
  2. 2 assigned
  3. 3 active
  4. 4 suspended
  5. 5 failed
  6. 6 finished
To copy to clipboard, switch view to plain text mode 

I want the mapped comboBox to display:

Qt Code:
  1. active
  2. assigned
  3. failed
  4. finished
  5. suspended
  6. unassigned
To copy to clipboard, switch view to plain text mode