I have a QTreeView
displaying data from a QStandardItemModel
. One of the columns of the tree is displayed with a delegate that lets the user edit a
I think from a design point of view the top window is a sort of global. You have already described a behaviour which is treating it in that way and (as ekhumoro has said) that pretty much requires you to provide access to that top window to the editor.
One very simple way to do that is to call parent.window()
in the createEditor
method. Maybe something like:
parent.window().boldTextAction.triggered.connect(editor.toggleBold)
That seems to work for me.