Hi
I have a lot of menu options that can be activated by using keys on the keyboard. When I open a saveFileDialog to save a file, these actions is triggered when the user tries to write the wanted name to save the file as. Is there some convenient way to block all keyboard shortcuts until the saveFileDialog is closed?
I've tried to useBlockSignals and it does not solve the problem. The FileDialog is opened from a QMainWindow and the shortcuts is placed in the main menu and other menus.
thanks
pir


Reply With Quote

You could remove the shortcuts not using any modifier keys and reimplement keyPressEvent for a particular widget instead triggering appropriate actions. You could then enable/disable those "shortcuts" on the fly. Furthermore the shortcuts will only be active when the widget has keyboard focus, which is probably what you want.

Bookmarks