Results 1 to 4 of 4

Thread: [SOLVED] Incomplete QTreeView

  1. #1
    Join Date
    Dec 2009
    Posts
    41
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default [SOLVED] Incomplete QTreeView

    Hi !

    I am trying to visualize a databse thanks to a QTreeView. I am using a QSqlQueryModel to extract my data and present it to the widget. But my query returns about 8000 values. So when the qtreeview appears, not all the results are available yet. If i pick the slider on the right and get it to the bottom, once I release it, it gets a little jump and I have to go down more if I want to see the rest of the list.

    This problem is annoying because I want to filter my tree with QSortFilterModel. And if I type data that is at bottom of the list the filter won't show anything while i haven't gone to see the bottom of the list with the slider.


    So, is it possible to set the size of what QTreeView displays at firt launch or something like this ?

    Thanks
    Last edited by Guilo; 29th December 2009 at 22:32.

  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: Incomplete QTreeView

    Try
    Qt Code:
    1. while(model->canFetchMore())
    2. model->fetchMore();
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to Lykurg for this useful post:

    Guilo (30th December 2009)

  4. #3
    Join Date
    Dec 2009
    Posts
    41
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Incomplete QTreeView

    Thank you that solved the problem.

  5. #4
    Join Date
    Dec 2009
    Posts
    41
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Incomplete QTreeView

    I have a last question : Now all work great, filtering is a bit slow : when i type the first letter, it will took about 1 second during which I can't do anything before filtering. I know that I have a big model but I have compiled the exact same code on the same machine for linux. And it is much faster. Why such a difference ? Is it fixable under Windows ?

    Thanks

Similar Threads

  1. Need help Updating QTreeView model (QAbstractItemModel)
    By iraytrace in forum Qt Programming
    Replies: 1
    Last Post: 26th October 2009, 22:49
  2. One Model, Two Views (QTreeView and QTableView)
    By dgarrett97 in forum Newbie
    Replies: 2
    Last Post: 14th September 2009, 18:10
  3. QDirModel and QTreeView cut and paste
    By Micawber in forum Qt Programming
    Replies: 4
    Last Post: 28th May 2008, 20:16
  4. QTreeView help
    By bepaald in forum Qt Programming
    Replies: 1
    Last Post: 15th August 2007, 21:22
  5. QTreeView: Holding a line on screen
    By gri in forum Qt Programming
    Replies: 1
    Last Post: 7th August 2007, 11:42

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.