Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-115087

getOpenFileContent does not open the dialog

    XMLWordPrintable

Details

    • WebAssembly
    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            piwierci Piotr Wierciński
            farmovit Farmo Vit
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes