PDA

View Full Version : Insert child in editabletreemodel example doesn't update QTreeView?



iraytrace
3rd October 2009, 03:49
There's a behavior problem with the example code "editabletreemodel" provided with 4.5 (see http://doc.trolltech.com/4.5/itemviews-editabletreemodel.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?

iraytrace
3rd October 2009, 04:20
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.