[222_48] : fix macOS shortcut issue #2935
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses macOS-native QFileDialog keyboard shortcut handling by forcing Qt’s non-native file dialog implementation on macOS, improving copy/paste and other standard shortcut behavior in file chooser dialogs.
Changes:
- Force
QFileDialog::DontUseNativeDialogon macOS inqt_chooser_widget_rep::perform_dialog(). - Add a developer note (
devel/222_48.md) with problem statement and manual test steps for issue #2894.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Plugins/Qt/qt_chooser_widget.cpp | Disables the native macOS file dialog to restore standard keyboard shortcuts. |
| devel/222_48.md | Documents the issue context and provides macOS testing instructions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| #ifdef OS_MACOS | ||
| // Use Qt's custom dialog on macOS to fix keyboard shortcuts | ||
| // (Command+V, Command+C, etc.) | ||
| dialog->setOption (QFileDialog::DontUseNativeDialog, true); | ||
| #endif |
There was a problem hiding this comment.
The function header comment above this block says the chooser uses a native dialog on macOS/Windows, but this change explicitly forces a non-native QFileDialog on macOS. Please update that header comment (and consider rewording the inline comment from “custom dialog” to “non-native dialog”) so the documentation stays accurate for future maintenance.
| Fixed issue #2894: keyboard shortcuts (Command+V, Command+C, etc.) not working in the file chooser dialog on macOS. | ||
|
|
||
| ### Why | ||
| when Qt uses native file dialog on macOS, it has a keyboard shortcut issue that prevents users from using standard macOS shortcuts for copy/paste operations, negatively impacting user experience. |
There was a problem hiding this comment.
Sentence casing: start this sentence with a capital letter ("When") since it begins a new paragraph.
| when Qt uses native file dialog on macOS, it has a keyboard shortcut issue that prevents users from using standard macOS shortcuts for copy/paste operations, negatively impacting user experience. | |
| When Qt uses native file dialog on macOS, it has a keyboard shortcut issue that prevents users from using standard macOS shortcuts for copy/paste operations, negatively impacting user experience. |
fixes #2894
How to test
Fix macOS file chooser dialog keyboard shortcuts
What
Fixed issue #2894: keyboard shortcuts (Command+V, Command+C, etc.) not working in the file chooser dialog on macOS.
Why
when Qt uses native file dialog on macOS, it has a keyboard shortcut issue that prevents users from using standard macOS shortcuts for copy/paste operations, negatively impacting user experience.
SCreenshot