Results 1 to 3 of 3

Thread: Adding a child of model

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    520
    Thanks
    13
    Thanked 77 Times in 75 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Adding a child of model

    Hi, probably the row that you use in the setData calls does not change.

    Ginsengelf

  2. #2
    Join Date
    Jul 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Adding a child of model

    tried to change the way
    but it did not work
    Qt Code:
    1. int row = rowCount(); // number of folders already in the model
    2. insertRow(row); // add a new row
    3. QModelIndex ind = index(row, 0); // index of the newly created item
    4. insertColumn(0, ind); // add a column for future children of the item
    To copy to clipboard, switch view to plain text mode 
    by some algorithm to change ???
    Last edited by _exp_; 6th August 2010 at 14:32.

Similar Threads

  1. Adding a child of treeView
    By _exp_ in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2010, 11:11
  2. Adding signal to own model class
    By michciu in forum Qt Programming
    Replies: 2
    Last Post: 24th April 2010, 04:00
  3. Replies: 5
    Last Post: 18th April 2010, 23:31
  4. Replies: 5
    Last Post: 17th February 2009, 04:35
  5. Limitation when adding more than 256 items to a model
    By darkadept in forum Qt Programming
    Replies: 5
    Last Post: 25th May 2006, 15:26

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.