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

nameFilters not working in FileDialog in iOS

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Reported
    • Priority: Not Evaluated
    • Resolution: Unresolved
    • Affects Version/s: 5.15
    • Fix Version/s: None
    • Component/s: Quick: Dialogs
    • Environment:

      XCode 12, iOS 14

    • Platform/s:
      iOS/tvOS/watchOS

      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

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

          Activity

            People

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            nagrohn Nahomi Gröhn
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes