Results 1 to 6 of 6

Thread: what parameters to be passes to beginInsertRows() when implementing tree

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2013
    Location
    Bangalore
    Posts
    49
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default what parameters to be passes to beginInsertRows() when implementing tree

    I have a doubt with canFetch() and fetchMore() functions. i am implementing tree structure, when i scroll till the end canfetch() will be call and if returns true fetchMore() will be called where we have to fetch the data and insert items into tree.

    Qt Code:
    1. void model::fetchMore(const QModelIndex& f_parent)
    2. {
    3. //fetch the data needed and create items
    4. beginInsertRows(f_parent, row, lastRow);
    5. endInsertRows();
    6. }
    To copy to clipboard, switch view to plain text mode 

    Please let me know In beginInsertRows, what parameters exactly we need to specify, It is confusing me..

    I have fetched some data now, where I have 5 child's (previous data has remaining 5 child's) and followed by 10 parents and each parent has 10 child's. (f_parent parent has 5 childs already)

    Now I need to insert 5 more children followed by 10 parents.

    please let me know, what parameters I need to specify in beginInsertRows() exactly.

    beginInsertRows(f_parent,5,f_parent.row()+10); ?
    beginInsertRows(f_parent,f_parent.row(),f_parent.r ow()+10); ?
    beginInsertRows(f_parent,5,10); ?

    Documentation explained more in terms of list only(per this particular function) rather than tree.
    Last edited by DURGAPRASAD NEELAM; 23rd April 2015 at 18:34.

Similar Threads

  1. beginInsertRows() beginRemoveRows()
    By RolandHughes in forum Qt Programming
    Replies: 3
    Last Post: 23rd October 2014, 22:07
  2. Replies: 0
    Last Post: 2nd April 2014, 16:02
  3. Signal with pointer passes only the first value
    By Basti300 in forum Qt Programming
    Replies: 2
    Last Post: 14th September 2010, 13:37
  4. Replies: 0
    Last Post: 1st July 2010, 21:55
  5. beginInsertRows was not declared ???
    By travlr in forum Qt Programming
    Replies: 2
    Last Post: 6th June 2009, 21:22

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.