Results 1 to 10 of 10

Thread: Help with QAbstractProxyModel

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2008
    Posts
    39
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    12

    Default Re: Help with QAbstractProxyModel

    Wow, lol ok, so I see now.

    On your second example, what exactly is this doing:

    Qt Code:
    1. const QAbstractProxyModel *proxy = qobject_cast<const QAbstractProxyModel*>(index.model());
    2.  
    3. while(proxy!=0){
    4. index = proxy->mapToSource(index);
    5. proxy = qobject_cast<const QAbstractProxyModel*>(index.model());
    6. }
    To copy to clipboard, switch view to plain text mode 

    Is it to keep the proxy and index in sync? Thanks for being patient with me

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Help with QAbstractProxyModel

    I already explained it in post #2. It converts the index to the one belonging to a non-proxy model.

Similar Threads

  1. How to subclass QAbstractProxyModel
    By skycrestway in forum Qt Programming
    Replies: 2
    Last Post: 22nd October 2010, 23:35
  2. QAbstractProxyModel: adding a virtual column
    By ultim8 in forum Qt Programming
    Replies: 6
    Last Post: 28th August 2008, 17:10
  3. QAbstractProxyModel and QTreeView
    By niko in forum Qt Programming
    Replies: 5
    Last Post: 18th January 2008, 21:17
  4. QAbstractProxyModel and "virtual" columns
    By tranfuga25s in forum Qt Programming
    Replies: 3
    Last Post: 15th July 2007, 23:39
  5. Caching QAbstractProxyModel dilemma
    By Alessandro in forum Qt Programming
    Replies: 2
    Last Post: 11th April 2006, 19:51

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
  •  
Qt is a trademark of The Qt Company.