Hi, I am writing an app in which I am wanting to display my data in a number of different ways. (Currently QT4.8 on linux, but will also run it on windows, if this is relevant!)
As an example what I have is a set of tuples with two field, say Name and Hours I have this working with table view and am able to access and edit the data. What I want is a not editable view of the data which shows the total of all the Hours for each Name. I have used the QAbstractProxyModel class to do this. My problem is I do not know how to implement the mapTosource and mapFromSource functions as there is not a direct 1 to 1 correlation between indexes in the proxy model and indexes in the source model. The function definitions appear to assume that this is the case. I have done a basic implementation of these functions which returns a default QModelIndex. The part I have found which is not working is that that the summary or total view does not update when I change values in the other view. I have changed the emit in the setData function to cover the whole model. The summary view does update when it gets focus. Can someone please tell me if there is something better than the QAbstractProxyModel for me to use for this purpose and How is the mapFromSource function suppose to work when there is not a 1:1 mapping between the abstract model and the source model? Are there any samples of QAbstractProxyMode available? With thanks, Hugh _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest