Skip to content

EditorFileDialog: On macOS call setfocus() to avoid crash

The EditorFileDialog is a custom Qt control used for processing UAT_FILENAME_CB_DEF entries. The control includes a QWidgetLineControl for holding a path name and a QPushButton (file_dialog_button_) with a label of UTF8_HORIZONTAL_ELLIPSIS. The button label with '...' implies that clicking on it will open a dialog.

In this case clicking on the '...' button will open a QFileDialog (by way of WiresharkFileDialog) which allows one to choose a path name instead of manually adding one.

A crash will occur on macOS systems if the file_dialog_button_ does not have focus when the QFileDialog is opened.

To avoid crashing explicitly set focus to the file_dialog_button_ on macOS systems when the applyFilename() method is invoked.

Closes #17789 (closed), Closes #17819 (closed).

Merge request reports