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

nameFilters not working in FileDialog in iOS

    XMLWordPrintable

Details

    • iOS/tvOS/watchOS
    • ce20b8107 (dev), 9d4bd2c6d (6.5)

    Description

      nameFilters is not working in native FileDialog on iOS.

          FileDialog {
                 id: fileDialog
                 visible: false
                 title: "Select a Image"
                 nameFilters: [ "Image files (*.jpg)" ]
             }
      

      By lookin at Qt source code, Cocoa's UIDocumentPickerViewController is used for opening files. Initializing this controller with initWithDocumentTypes gives the possibility for filtering files by a list of "Uniform Type Identifier“.
      Qt adds deprecated global identifiers to open any file type.
      At least some specific type identifiers for jpg, txt etc. should be supported
      ("public.jpeg", "public.text") by converting the extension filter "*.jpg" to the UTI "public.jpeg".
      An even better solution would be to just forward the nameFilters as UTI's, so
      it could filter a custom file types with something like:
      nameFilters: ["com.mycompany.myapp.myspecialextension", "public.jpeg"]
      rather than nameFilters: [ "(.myspecialextension)", "(.jpeg)"]

      Attachments

        For Gerrit Dashboard: QTBUG-93624
        # Subject Branch Project Status CR V

        Activity

          People

            dorisverria Doris Verria
            nagrohn Nahomi Gröhn (Inactive)
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes