PDA

View Full Version : Sort QComboBox mapped to SqlRelationalTableModel with QDataWidgetMapper



Steven R. Staton
11th June 2010, 17:26
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:


1 unassigned
2 assigned
3 active
4 suspended
5 failed
6 finished

I want the mapped comboBox to display:


active
assigned
failed
finished
suspended
unassigned