Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QFileDialog name filter on Linux

QFileDialog name filter on Linux

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 626 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • PerdrixP Offline
    PerdrixP Offline
    Perdrix
    wrote on last edited by Perdrix
    #1

    If I set a name filter for QFileDialog that looks like:

    "RAW Files (*.cr2 *.cr3 *.crw *.nef *.mrw *.orf *.raf *.pef *.x3f *.dcr *.kdc *.srf *.arw *.raw *.dng *.ia *.rw2)"
    

    on Windows and macOS I am shown (e.g.) files with extensions of .cr2 and .CR2

    On Linux Ubuntu 24.04.3 (Noble Numbat) and Linux Mint (which uses Thunar) I am only shown files with extensions .cr2.
    On Lubuntu (which uses PCmanFM-Qt file manager) I am shown files with both .cr2 and .CR2 extensions.

    Should I expect this level on inconsistency between the different Linux systems?

    Do I really need to specify (e.g. for .raf files) .raf, .RAF, .Raf, .rAf, .raF, etc. etc.)

    Thanks, David

    JonBJ 1 Reply Last reply
    0
    • PerdrixP Perdrix

      If I set a name filter for QFileDialog that looks like:

      "RAW Files (*.cr2 *.cr3 *.crw *.nef *.mrw *.orf *.raf *.pef *.x3f *.dcr *.kdc *.srf *.arw *.raw *.dng *.ia *.rw2)"
      

      on Windows and macOS I am shown (e.g.) files with extensions of .cr2 and .CR2

      On Linux Ubuntu 24.04.3 (Noble Numbat) and Linux Mint (which uses Thunar) I am only shown files with extensions .cr2.
      On Lubuntu (which uses PCmanFM-Qt file manager) I am shown files with both .cr2 and .CR2 extensions.

      Should I expect this level on inconsistency between the different Linux systems?

      Do I really need to specify (e.g. for .raf files) .raf, .RAF, .Raf, .rAf, .raF, etc. etc.)

      Thanks, David

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Perdrix
      Since Linux filing systems are case sensitive I would expect only to be shown files matching the case of the filter. I do not know about MacOS or Lubuntu. More to the point under Linux a, say, .tar file should always be spelt as such, so how/why would you start with a .Tar or a .TAR file in the first place? I would be surprised at that.

      You do not say whether you are using the native file dialog or the Qt one. I believe the filtering is handled internally in native dialogs so this is vital to behaviour. If it is and you are using native then it has nothing to do with Qt and you should be able to examine/replicate the behaviour in any program.

      If you ensure you are using the Qt file dialog do you get consistent behaviour?

      I 1 Reply Last reply
      2
      • JonBJ JonB

        @Perdrix
        Since Linux filing systems are case sensitive I would expect only to be shown files matching the case of the filter. I do not know about MacOS or Lubuntu. More to the point under Linux a, say, .tar file should always be spelt as such, so how/why would you start with a .Tar or a .TAR file in the first place? I would be surprised at that.

        You do not say whether you are using the native file dialog or the Qt one. I believe the filtering is handled internally in native dialogs so this is vital to behaviour. If it is and you are using native then it has nothing to do with Qt and you should be able to examine/replicate the behaviour in any program.

        If you ensure you are using the Qt file dialog do you get consistent behaviour?

        I Online
        I Online
        IgKh
        wrote on last edited by
        #3

        @JonB said in QFileDialog name filter on Linux:

        I do not know about MacOS or Lubuntu

        macOS is also case insensitive (well, technically you can format APFS partitions as case sensitive if you really want to, but then all kind of things break).

        Lubuntu is a Linux distribution running LXQt as the desktop environment (a minor lightweight DE written in Qt). The difference from Ubuntu/Mint is that the latter two automatically use the gtk3 platform theme plugin shipped with Qt, and therefore you get the Gtk file picker dialogs. In Lubuntu, it is possible that you'll get the different native file picker (if there is an alternative theme plugin configured), or the non-native one built-in. Whether non case sensitive filter matching is to be expected or not depends on that.

        1 Reply Last reply
        1
        • PerdrixP Offline
          PerdrixP Offline
          Perdrix
          wrote on last edited by Perdrix
          #4

          Except! Running on Noble Numbat.

          DeepSkyStacker 6.1.0 which uses Qt 6.9.2 displays both .cr2 and .CR2 files with that name filter:
          image.png
          whereas Qt 6.1.1 Beta 2 which uses 6.10.0 only displays .cr2 files with that name filter:
          image.png

          So for me, that's a breaking change.

          I also see that the displayed file dialogue is completely different which is quite surprising.

          David

          1 Reply Last reply
          0
          • Christian EhrlicherC Offline
            Christian EhrlicherC Offline
            Christian Ehrlicher
            Lifetime Qt Champion
            wrote on last edited by Christian Ehrlicher
            #5

            The first one is from Qt, the second from your platform aka the native (gtk) one.

            Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
            Visit the Qt Academy at https://academy.qt.io/catalog

            1 Reply Last reply
            2
            • PerdrixP Offline
              PerdrixP Offline
              Perdrix
              wrote on last edited by
              #6

              Odd I don't request the Qt internal FileDialog explicitly. I thought that Qt always used the native one unless asked.

              I'll change the code to always ask for the Qt version.

              1 Reply Last reply
              0
              • Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #7

                When the platform plugin provides a native file dialog then it is used, otherwise the Qt one is shown.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                1 Reply Last reply
                2

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved