Skip to content

Commit 890ac59

Browse files
authored
[222_48] : fix macOS shortcut issue (#2935)
1 parent 6784da7 commit 890ac59

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

devel/222_48.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Fix macOS keyboard shortcuts in file chooser dialog
2+
3+
## How to test
4+
1. Open Mogan on macOS
5+
2. Open the file dialog (File > Save or similar actions)
6+
3. The keyboard shortcuts should work properly:
7+
- Command+V (paste)
8+
- Command+C (copy)
9+
- Other standard macOS shortcuts
10+
11+
## Fix macOS file chooser dialog keyboard shortcuts
12+
### What
13+
Fixed issue #2894: keyboard shortcuts (Command+V, Command+C, etc.) not working in the file chooser dialog on macOS.
14+
15+
### Why
16+
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.

src/Plugins/Qt/qt_chooser_widget.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,12 @@ qt_chooser_widget_rep::perform_dialog () {
286286

287287
QFileDialog* dialog= new QFileDialog (this->as_qwidget (), caption, path);
288288

289+
#ifdef OS_MACOS
290+
// Use Qt's custom dialog on macOS to fix keyboard shortcuts
291+
// (Command+V, Command+C, etc.)
292+
dialog->setOption (QFileDialog::DontUseNativeDialog, true);
293+
#endif
294+
289295
dialog->setViewMode (QFileDialog::Detail);
290296
if (type == "directory") dialog->setFileMode (QFileDialog::Directory);
291297
else if (type == "image" && prompt == "")

0 commit comments

Comments
 (0)