Results 1 to 7 of 7

Thread: Not able to see plus/tree sign for tree item when build child items dynamically

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    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: Not able to see plus/tree sign for tree item when build child items dynamically

    Quote Originally Posted by d_stranz View Post
    QTreeView::setRootIsDecorated() might help. It is true by default. Did you set it to false somewhere?
    No where d_stranz.


    Added after 15 minutes:


    Quote Originally Posted by ChrisW67 View Post
    The visibility of the tree expansion decoration ⊞ is controlled by the number of children the item has. No children, no indicator. You do not create the children until the first time the data() function is called (on any item for any reason, almost certainly not right). If the view calls hasChildren() or rowCount() before it calls data() then you have no children hence no indicator.
    Your model is peculiar to say the least. If you want all the 5000 top level items to have default children then simply create them at construction time and return the vector count() for rowCount().
    hmm.. I have a problem with model default implementation (http://www.qtcentre.org/threads/6303...ems?highlight=).

    I have a lots of data (millions of rows, probably more than 70 million items which a view can not handle in single page).
    hence i have considerable amount of delay (rowCount() calls for all the top level items initially). So decided not to have any calculations rowCount().
    if I want to build tree with tree items which is taking considerable amount time as data is in billions.
    I can not go for lazy population because I will have problem with scroll bar size then(scroll size will be adjusted as we load data).


    So I am looking for a way where I can load data dynamically(with correct scroll bar size at first time only), Any suggestions ??
    With the above approach I felt some how I did it but not able to see plus sign even though I could see children with double click on parent.

    Thanks a lot.
    Last edited by prasad_N; 25th July 2015 at 07:22.
    Thanks :-)

Similar Threads

  1. Replies: 16
    Last Post: 12th May 2015, 21:46
  2. Adding a small tree to an existing tree in QTreeview.
    By salcin in forum Qt Programming
    Replies: 0
    Last Post: 25th September 2013, 17:27
  3. QStandardItemModel, parent / child to form tree structure
    By Nightfox in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2010, 17:01
  4. Replies: 1
    Last Post: 22nd October 2007, 14:47
  5. Replies: 14
    Last Post: 9th November 2006, 08:35

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
  •  
Qt is a trademark of The Qt Company.