QAbstractItemDelegate::paint() : custom Delegate, how to alter the value displayed in cell - Solved
hello all,
there is probably an easy way to do this: the thing is that in the DB the values of a ‘mytype’ column are from 1 to 5. these
values represent constants in the program, so, here is what I have:
- switch(value){
- case MyTypes::Type_A:
- //change displayed value to "type A"
- break;
- //.... and so on
- };
- }
is there a way to do this?
thx,
G
3 replies
I think it would be better to put an QAbstractProxyModel subclass inbetween (or maybe a QSortFilterProxyModel subclass, you’ll have to check which one fits best).
For Qt 4.7, use a QSortFilterProxyModel as your base, for 4.8, a QIdentityProxyModel. You don’t want to implement the item mapping yourself, I think.
You must log in to post a reply. Not a member yet? Register here!


