Important: Please read the Qt Code of Conduct -

Treeview + edit item (and drag and drop)

  • Hi,

    I'm trying to implement a tree where i can edit the label of each item. I started from the example in the Qt dir (editabletreemodel) and converted it to Qml. I've added the roleNames and the tree is showing just fine (expanding, collapsing, selection all works fine). Though, when I double click on the item, i cannot edit it (basically, nothing is happening). Should I do something special for enabling the editing of items? (The same for drag and drop: when i add the flag Qt::ItemIsDragEnabled and Qt::ItemIsDropEnabled, nothing happens when I start dragging an item). Anybody who can point me in the right direction?


Log in to reply