After reading through the docs I found
closeEditor ( QWidget * editor, QAbstractItemDelegate::EndEditHint hint )
but it appears I would need a custom model in order to implement this call to close the editor on the tree item in edit mode.
My problem is when I add a new item to a subclassed QTreeWidget I call
to allow an edit of the item that was just inserted.Qt Code:
To copy to clipboard, switch view to plain text mode
Now if I use a context menu to add another item the mouse click will cause a close editor event and the next new item will be selected and put into edit mode and all is fine. The problem arises when you use a toolbar, or menu action to add the item it will not close the first item's edit mode and the newly added item will not produce the desired behavior.
My questions is there anyway to force a close editor event so the newly entered item will be able to call edit? Or is there another way to produce the desired results?
Bookmarks