CloseEditor from QAbstractItemView
-
We can invoke the editor of the Delegate using QAbstractItemView::edit(QModelIndex)
Im having a case where I track the mouseMove and LeaveEvent of a view to invoke/close the editor of the delegate using the above function.
I now need to close the editor before invoking edit() on a new item or the function fails.
I do not have the pointer to the editor object generated by createEditor in the view.
is there any way to get this pointer so i can call closeEditor in the view.
Ofc i can emit the widget pointer when i create it in createEditor and hold that in the view, not sure if this is the right approach tho.
-
Why are you not use "openPersistentEditor":http://doc-snapshot.qt-project.org/4.8/qabstractitemview.html#openPersistentEditor / "closePersistentEditor":http://doc-snapshot.qt-project.org/4.8/qabstractitemview.html#closePersistentEditor?
-
Valid point. I've been an idiot and missed it out. Was looking just into edit.
Cheers. Will give that a go and see if it solves the issue.