Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.5.1, 6.5.2
-
None
-
Ubuntu 22.04, Chrome 114.0.5735.198
-
-
62caae957 (dev), 8240f9437 (6.6), b6c6d3cc5 (6.5)
Description
When trying to use getOpenFileDialog in WebAssembly, the native dialog for picking files does not work. It worked in Qt 6.4 without any issues, but in Qt 6.5 it does not work anymore. It also works on Desktop platforms.
Both wasm_singlethread and wasm_multithread have this problem.
Update.
After a day of testing and debugging, I found out the true cause of why the dialog does not get opened. This is because of the `nameFilter` parameter.
This code from Qt documentation does not work:
auto fileContentReady = [](const QString& filePath, const QByteArray& fileContent) { }; QFileDialog::getOpenFileContent("Images (*.png *.xpm *.jpg)", fileContentReady);
ONLY this code DOES WORK:
auto fileContentReady = [](const QString& filePath, const QByteArray& fileContent) { }; QFileDialog::getOpenFileContent("*", fileContentReady);
So, it looks like somehow any `nameFilter` prevent the dialog from being opened. And in Qt 6.4 there was no such problem.