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

WASM version of QFileDialog::getOpenFileContent not honoring nameFilter

    XMLWordPrintable

Details

    • WebAssembly
    • 315a5e3257 (qt/qtbase/6.4) 315a5e3257 (qt/tqtc-qtbase/6.4) 315a5e3257 (qt/tqtc-qtbase/6.4.1) 315a5e3257 (qt/tqtc-qtbase/tqtc/qtinsight-6.4)

    Description

      In WASM builds, passing "Images (*.png *.xpm *.jpg)" as the nameFilter argument to QFileDialog::getOpenFileContent (which is the example value from the documentation) has no effect and the resulting dialog does not have a filter. The issue here is almost certainly this code:

      auto qtFilterStringToWebAcceptString = [](const QString &qtString) {
          // The Qt and Web name filter string formats are similar, but
          // not identical.
          return qtString.toStdString(); // ### TODO
      };
      

      I think that the "Web name filter string format" that the comment mentions is the format described at https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept, so that lambda expression presumably should convert "Images (*.png *.xpm *.jpg)" into something like ".png,.xpm,.jpg".

      Attachments

        Issue Links

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

          Activity

            People

              mikolaj.boc MikoĊ‚aj Boc (Inactive)
              kevkeating Kevin Keating
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes