I am trying to modify the stock QFileDialog to better support the SNFS file-system. Currently it doesn't update after deleting files. So if a user deletes a file, the file is still shown in the Dialog.
So what I need is some way to get notified once the user has deleted a file from the dialog, or a way to remove the default shortcut so I can implement my own.
What I've tried so far:
Installing an eventFilter for the DEL key
The event seems to get stopped by QFileDialog before it gets to my filter.
Adding my own Shortcut
This results in :
QAction::eventFilter: Ambiguous shortcut overload: Del
Removing set Shortcuts
I call the following function on the dialog to recursively remove all set shortcuts and actions:
def to_children(self, parent):
for child in parent.children():
if hasattr(child, 'removeAction'):
for a in child.actions():
child.removeAction(a)
if hasattr(child, 'releaseShortcut'):
for i in range(100):
self.releaseShortcut(i)
self.to_children(child)
However the shortcut still works.