Results 1 to 2 of 2

Thread: Model and Proxy

  1. #1
    Join Date
    Jun 2006
    Location
    San Jose, CA
    Posts
    53
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Model and Proxy

    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

  2. #2
    Join Date
    Jun 2006
    Location
    San Jose, CA
    Posts
    53
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Model and Proxy

    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()'

Similar Threads

  1. Sharing Selections between Model and ProxyModel
    By mentat in forum Qt Programming
    Replies: 14
    Last Post: 27th January 2010, 17:31
  2. data, model and tree view
    By larry104 in forum Qt Programming
    Replies: 17
    Last Post: 3rd July 2006, 14:43
  3. Filter Proxy Model to Autoupdate View
    By Big Duck in forum Qt Programming
    Replies: 1
    Last Post: 1st June 2006, 20:32
  4. how to use QTreeView with Database model
    By mikro in forum Newbie
    Replies: 3
    Last Post: 13th April 2006, 16:12
  5. setIndexWidget and proxy interaction
    By Derf in forum Qt Programming
    Replies: 3
    Last Post: 25th March 2006, 18:15

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.