Results 1 to 4 of 4

Thread: Is there a way to capture each & every element in tree/table view like model::data()

  1. #1
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Is there a way to capture each & every element in tree/table view like model::data()

    Is there a way to capure each & every element in tree/table view which are currently shown.

    i have requirement like if my tree item meets certain requirement ex: if item data = 0000 expand It.

    So like in model where in data function we can capture all the elements which are currently in view, similarly I need a way in view also so that i can Expand my item..

    My use case: i am doing lazy population of tree. When i do this I am loading & showing only top 100 items in view & now if user expands some items in top 100 & he now scroll to end of the tree (or by press on end key he scroll to end of the tree) now i am re populating tree with last 100 items &now user press home & now i get top 100 items & repopulating a tree but here i am loosing expanded items.. now if I have model::data() like function i can expand few the items by storing expanded items unique values in my case they are database indexes.


    Thanks in advance.
    Thanks :-)

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Is there a way to capture each & every element in tree/table view like model::dat

    Maybe keep a list of expanded items?

    Cheers,
    _

  3. #3
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Is there a way to capture each & every element in tree/table view like model::dat

    Quote Originally Posted by anda_skoa View Post
    Maybe keep a list of expanded items?

    Cheers,
    _
    Of course but I need this feature for other purposes Also
    For ex: there is a bug in Qt, i.e canFetchMore() & fetchMore() will get called only for top level items they will not get called for non top level items (level 2,3,4......) during scroll.

    So in this case also If I would be able to recognise each & every element I can load children's dynamically. So basically I am looking for this unique feature rather than doing some workarounds each time I run into this kind of situation..

    Any suggestions for doing this or better place/function in view.. I tried connecting scroll bar moved signal to some slot & get leftmost bottom element but it did not workout.
    Thanks :-)

  4. #4
    Join Date
    Jun 2015
    Location
    India
    Posts
    185
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Is there a way to capture each & every element in tree/table view like model::dat

    I am still looking for this, Any hint or idea to implement this ???
    Thanks :-)

Similar Threads

  1. Replies: 1
    Last Post: 3rd April 2010, 16:47
  2. Replies: 33
    Last Post: 7th December 2009, 11:11
  3. How to map tree model data to list view
    By msopanen in forum Qt Programming
    Replies: 0
    Last Post: 10th November 2009, 20:56
  4. Table view->model->set data
    By tulsi in forum Qt Programming
    Replies: 3
    Last Post: 21st April 2009, 09:36
  5. data, model and tree view
    By larry104 in forum Qt Programming
    Replies: 17
    Last Post: 3rd July 2006, 15:43

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.