[solved] qtreeview edit last inserted item
I have a QTreeView.
In this view there are groups with some items in it.
When I create a new group, I'd like to "select" (highlight) this last inserted item.
What is the modelindex of this item?
How can I solve this?
[This is similar in Windows when you create a new folder]
What I exactly want:
create new item (last inserted item...) with a predefined arbitrary name ("group 001")
select it (programatically)
call a delegate's createeditor() method on this item ("simulate" F2 edit key)
If i understand you correctly
can be helpful for you. Add current lines in insertRow() method:
@QModelIndex child = model->index(index.row()+1, 0, index.parent());
This was EXACTLY the solution :)
I am glad to hear it :)