Results 1 to 4 of 4

Thread: How to use proxy model?

  1. #1
    Join Date
    Feb 2015
    Posts
    2
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Question How to use proxy model?

    Hi,

    Suppose i have a model which is having some (data) rows.
    Now i want to display that data in two different views in different form like one view will display all data as it is in the model.
    another view will display data in consolidated form for example
    two or more than two rows belongs to same id or category, so need to display in single row.

    Let say three rows have 101, view1 will be having three rows and view 2 will be only one consolidated row.

    How i can achieve this.

    I want underlying data should be same (don't want to duplicate for different views).

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

    Default Re: How to use proxy model?

    Implement a proxy model that will do the aggregation and apply it to one of the views while connecting the other view directly to the original model.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Feb 2015
    Posts
    2
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Question Re: How to use proxy model?

    Hi,

    Thanks for your reply.

    One thing more, i just want to confirm that if proxy model is not duplicating underlying (source model) data?
    ...
    Gurmeet Singh

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

    Default Re: How to use proxy model?

    Unless you make it duplicate some data, it operates directly on the underlying model.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    gurmeet (18th March 2015)

Similar Threads

  1. Replies: 24
    Last Post: 18th September 2013, 06:35
  2. Replies: 1
    Last Post: 29th August 2013, 05:41
  3. Source Model Ad Proxy Model
    By sajis997 in forum Qt Programming
    Replies: 1
    Last Post: 19th July 2011, 05:13
  4. Custom Model and Proxy Model
    By frank100 in forum Qt Programming
    Replies: 1
    Last Post: 20th December 2010, 14:30
  5. Model and Proxy
    By larry104 in forum Qt Programming
    Replies: 1
    Last Post: 4th August 2006, 21:05

Tags for this Thread

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.