diff --git a/devel/222_48.md b/devel/222_48.md new file mode 100644 index 0000000000..b6ae3f7dd3 --- /dev/null +++ b/devel/222_48.md @@ -0,0 +1,16 @@ +# Fix macOS keyboard shortcuts in file chooser dialog + +## How to test +1. Open Mogan on macOS +2. Open the file dialog (File > Save or similar actions) +3. The keyboard shortcuts should work properly: + - Command+V (paste) + - Command+C (copy) + - Other standard macOS shortcuts + +## 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. diff --git a/src/Plugins/Qt/qt_chooser_widget.cpp b/src/Plugins/Qt/qt_chooser_widget.cpp index 86b48e9276..6b1c94e9b5 100644 --- a/src/Plugins/Qt/qt_chooser_widget.cpp +++ b/src/Plugins/Qt/qt_chooser_widget.cpp @@ -286,6 +286,12 @@ qt_chooser_widget_rep::perform_dialog () { QFileDialog* dialog= new QFileDialog (this->as_qwidget (), caption, path); +#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 + dialog->setViewMode (QFileDialog::Detail); if (type == "directory") dialog->setFileMode (QFileDialog::Directory); else if (type == "image" && prompt == "")