Results 1 to 2 of 2

Thread: Insert child in editabletreemodel example doesn't update QTreeView?

  1. #1
    Join Date
    Oct 2009
    Location
    Maryland
    Posts
    16
    Thanks
    3
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Insert child in editabletreemodel example doesn't update QTreeView?

    There's a behavior problem with the example code "editabletreemodel" provided with 4.5 (see http://doc.trolltech.com/4.5/itemvie...treemodel.html). If you click on the leftmost column of an item (the "Title" column) and "insert child" it works as expected. If you click on the rightmost column of an item (the "Description" column) it appears to do nothing. If you collapse and expand the parent, you will find a blank item has in fact been inserted. Odd since the code seems to try to insert the "[No Data]" string.

    I suspect that there is some code missing that would cause the QTreeView to update appropriately after the child is inserted. Can anyone point out what is missing from the example code to make it work correctly?

  2. #2
    Join Date
    Oct 2009
    Location
    Maryland
    Posts
    16
    Thanks
    3
    Thanked 3 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Insert child in editabletreemodel example doesn't update QTreeView?

    Ok, the previous was under Snow Leopard. On Ubuntu I get proper tree updates *but* the inserted row is still blank, not filled in with the "[No Data]" strings.

Similar Threads

  1. How to update items in a QTreeView
    By laugusti in forum Qt Programming
    Replies: 5
    Last Post: 12th August 2009, 09:03
  2. How to insert QcheckBox into QTreeView
    By lengshuang in forum Qt Programming
    Replies: 2
    Last Post: 8th April 2009, 13:36
  3. QcomboBox update QTreeView
    By josiah47 in forum Newbie
    Replies: 2
    Last Post: 6th March 2009, 00:32
  4. QTreeView PARENT & CHILD
    By zeeb100 in forum Qt Programming
    Replies: 1
    Last Post: 10th February 2009, 15:53

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.