What I have:


What I want:
  • A single QLabel that displays a concatenation of some of the person's information formatted in a way that is different from the original model. For instance: "John Doe (1 yr, 4 mos; M; 3/31/07)"
  • When any of the information from the original model is updated, the QLabel should be updated immediately


To achieve this I think subclassing QAbstractProxyModel is the correct thing to do. I want the subclassed proxy model to have one extra column then the source model -- that extra column will be the concatenation of the person's information.

The problem is, I can't figure out how to do this....

so... How do I:
  • Create a proxymodel that has one extra vitual column?
  • The rest of the columns are a one to one match of the source models columns
  • If any of the columns are updated in the source model, they are immediately reflected in the proxy model (including the virtual column)


I know I can connect the source models dataChanged event to a function to manually update the QLabel... but I want to learn how to do it this way (because there are other parts in my program that this could be useful).

I've already looked at the below post, but unfortunatly I'm going to need a little more hand holding then that post provides.
http://www.qtcentre.org/forum/f-qt-p...ractProxyModel