Results 1 to 7 of 7

Thread: catch Left most down element in QTreeView

Threaded View

Previous Post Previous Post   Next Post Next Post
  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 catch Left most down element in QTreeView

    Hi, My previous post related to this question is here, , I reported bug also : http://www.qtcentre.org/threads/6391...ted?highlight= & Bug Report: https://bugreports.qt.io/browse/QTBUG-48725

    Again : I wanted to load data with lazy population for my tree view, But lazy population (canFetchMore() & fetchMore()) doesn't works as expected, this functions are not getting called during scroll down for non root Items. (For non root items this functions are getting called only when collapse & expand not during scroll down). So some how I am finding a way to load data incrementally for non root items also.

    So during a scroll I wanted to find left most last (down) tree item, with which i will find whether it has more children or not & then based this I wanted to add children (If it expanded because lazy population works for root item & top level items gets added on fly).

    But I really don't have an idea How to find last element while scroll, I tried connecting to scrollBar move signal & them in a slot I tried to find last element something like
    Qt Code:
    1. ItemAt(viewPort()->rect()->bottomLeft())
    To copy to clipboard, switch view to plain text mode 
    , But with this approach Items are getting skipped (Not able to find last items If scroll little fast).

    Then I tried doing same thing in data() function (I found this is the place where no items get skipped even If I scroll fast), here I am checking each Item (Not exactly, checking only left most items) how many children It has & based on that I am Loading few more children (Lazy population for child items). (But some how I felt this is not a good way, doing some calculations adding children in data() function).

    Can somebody help me how to find out the leftmost down element when I am scrolling in view port with what ever the speed. OR any other idea how to do lazy population for children also.

    Thanks a lot for reading long post :-)
    Last edited by prasad_N; 12th November 2015 at 19:20. Reason: added more info
    Thanks :-)

Similar Threads

  1. Not Able to put breakpoint inside catch() of try,catch block
    By vinothrajendran in forum Qt Programming
    Replies: 0
    Last Post: 15th July 2015, 08:22
  2. Always show QTreeview branches in the far left column
    By Nightfox in forum Qt Programming
    Replies: 15
    Last Post: 10th September 2010, 00:15
  3. How to catch QTreeView column moved by user?
    By liversedge in forum Qt Programming
    Replies: 1
    Last Post: 26th July 2010, 21:07
  4. QTreeView/QHeaderView : resize handle on the left
    By Jeremy in forum Qt Programming
    Replies: 3
    Last Post: 14th May 2009, 22:43
  5. how to catch Shift + Left arrow? [Soved]
    By thomaspu in forum Qt Programming
    Replies: 2
    Last Post: 28th December 2007, 23:16

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.