Results 1 to 3 of 3

Thread: A problem about Model/view programming

  1. #1
    Join Date
    Aug 2008
    Location
    Nanjing, China
    Posts
    66
    Thanks
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default A problem about Model/view programming

    Hi all!
    Firstly, I should say thank you to Model/View arcitecture in Qt for the time it has saved.

    Then I have a problem disturb me long time. The tableview in my program has a model which is QSortFilterProxyModel. It serves to sort and filter the data supplied by the source model. The source model hold the data which would change from time to time.
    The requirement is : only demonstrate the first 3 rows of the sorted and filtered data!

    Please give me a clue! I just donnot know where to start!
    Jerry

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: A problem about Model/view programming

    Quote Originally Posted by calmspeaker View Post
    ... filtered data!

    Please give me a clue! I just donnot know where to start!
    How do you filter the data. You could there easily implement a 3 "item" limit.

    If not you have to use QTableView::hideRow(), which is not very elegant.

  3. #3
    Join Date
    Aug 2008
    Location
    Nanjing, China
    Posts
    66
    Thanks
    12
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: A problem about Model/view programming

    Quote Originally Posted by Lykurg View Post
    How do you filter the data. You could there easily implement a 3 "item" limit.
    The 3 items is the first 3 items of the sorted and filtered data! Could it be implemented in the proxymodel?I cannot figure it out!
    If not you have to use QTableView::hideRow(), which is not very elegant.
    In Qt source code, QTableView::hideRow() actually use
    QHeaderView::resizeSection().The efficient is low for the large data.So it is not going.
    Jerry

Similar Threads

  1. A question about Model/View programming
    By awhite1159 in forum Qt Programming
    Replies: 5
    Last Post: 15th June 2008, 16:38
  2. quick question on model/view programming
    By locus in forum Qt Programming
    Replies: 1
    Last Post: 2nd February 2007, 11:04
  3. about model/view programming
    By Pang in forum Qt Programming
    Replies: 3
    Last Post: 13th December 2006, 09:42
  4. Replies: 16
    Last Post: 7th March 2006, 16:57
  5. Replies: 2
    Last Post: 16th February 2006, 20:09

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.