Details
-
Suggestion
-
Resolution: Fixed
-
P3: Somewhat important
-
6.2.7
-
7c5cf8cae (dev), 253957b94 (6.7)
Description
The #else path (that is, the non-WASM fallback) of QFileDialog::getOpenFileContent creates a QDialog without a parent:
https://github.com/qt/qtbase/blob/ba1eec62a864428e4486b1e15f41ff06fc8f60d4/src/widgets/dialogs/qfiledialog.cpp#L2326-L2342
We are running into the issue where, if we make this call in a non-WASM context inside another application, a QDialog created from getOpenFileContent will lack parenting to the main window embedding our widget, thus preventing interaction.
One proposal would be to add an additional `QWidget *parent = nullptr` parameter to QFileDialog::getOpenFileContent which would be used only in the fallback mechanism creating a QDialog.
Fundamentally, there is a question of whether QFileDialog::getOpenFileContent should be used in non-WASM contexts where other windows are present and you'd expect window modality. Or if QFileDialog::getOpenFileContent should work as similarly as possible between WASM builds and non-WASM builds, forcing application modality in all cases.
Attachments
For Gerrit Dashboard: QTBUG-118396 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
521630,26 | Add parent arg to QFileDialog::getOpenFileContent and saveFileContent | dev | qt/qtbase | Status: MERGED | +2 | 0 |
527841,2 | Add parent arg to QFileDialog::getOpenFileContent and saveFileContent | 6.7 | qt/qtbase | Status: MERGED | +2 | 0 |
527848,2 | Add parent arg to QFileDialog::getOpenFileContent and saveFileContent | 6.6 | qt/qtbase | Status: ABANDONED | -2 | 0 |