PDA

View Full Version : Model and Proxy



larry104
4th August 2006, 19:37
Hi,

I implemented a big table using a model/view. Now, I like to have several proxies display just parts of the big table. The problem I face is that the proxy has only access to sourceModel->rowCount, ... so I'm not able to tell the proxy the correct mapping which will constantly change. The only one who knows the correct mapping for all the proxies is the model itself. Any idea how to implement that?

Here an Example:

Table:
r1/c1 .... c1000
r2
r3
..
r1000

Proxy1:
display r10/c10 to c100/c100

Proxy2:
display r101/c101 to c200/c200

larry104
4th August 2006, 21:05
I should add if I provide a function in the model which could give the proxies all what they would need I get an error:
mapToSource(const QModelIndex&) const':
proxy1.cpp:24: no matching function for call to `QAbstractItemModel::
getMapping()'