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. Customizing QFileDialog
Forum Updated to NodeBB v4.3 + New Features

Customizing QFileDialog

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 4.3k Views 1 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.
  • B Offline
    B Offline
    bday1223
    wrote on last edited by
    #1

    Hi, I'm developing a desktop application, and I'd like to customize the QFileDialog to add some columns (for example, the amount of disk space used within a directory, and perhaps some indicator regarding the presence of a file in the directory indicating that some type of processing has been performed on the data in the directory...).

    I haven't been able to find much about this on this or other forums. Is this possible without completely rolling my own dialog? Any examples or code snippets would be greatly appreciated.

    Thanks,
    Brian

    JonBJ 1 Reply Last reply
    0
    • Pablo J. RoginaP Offline
      Pablo J. RoginaP Offline
      Pablo J. Rogina
      wrote on last edited by Pablo J. Rogina
      #2

      @bday1223 you may want to take a look at this blog post.

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      JonBJ 1 Reply Last reply
      2
      • B bday1223

        Hi, I'm developing a desktop application, and I'd like to customize the QFileDialog to add some columns (for example, the amount of disk space used within a directory, and perhaps some indicator regarding the presence of a file in the directory indicating that some type of processing has been performed on the data in the directory...).

        I haven't been able to find much about this on this or other forums. Is this possible without completely rolling my own dialog? Any examples or code snippets would be greatly appreciated.

        Thanks,
        Brian

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

        @bday1223
        I could be wrong (it has been known to happen!), but I do not think you can do this (without writing your own).

        QFileDialog has two implementations you can choose from: "native" or "Qt". "Native" means it uses the Windows/Linux/MacOS OS's own dialog, and that does whatever it does. "Qt"/non-native means it uses a shared Qt implementation, common across all OSes, and that has been designed to do what it does to cover similar-ish features to the native one, and that's that.

        1 Reply Last reply
        0
        • Pablo J. RoginaP Pablo J. Rogina

          @bday1223 you may want to take a look at this blog post.

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

          @Pablo-J.-Rogina
          Your blog post link just takes me back to this current page?

          1 Reply Last reply
          0
          • Pablo J. RoginaP Offline
            Pablo J. RoginaP Offline
            Pablo J. Rogina
            wrote on last edited by
            #5

            @JonB good catch, link edited now. And it looks you're wrong here :-) (as you predicted) since the QFileDialog class can be customized by means of a proxy model.

            Upvote the answer(s) that helped you solve the issue
            Use "Topic Tools" button to mark your post as Solved
            Add screenshots via postimage.org
            Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

            JonBJ 1 Reply Last reply
            0
            • Pablo J. RoginaP Pablo J. Rogina

              @JonB good catch, link edited now. And it looks you're wrong here :-) (as you predicted) since the QFileDialog class can be customized by means of a proxy model.

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

              @Pablo-J.-Rogina
              Hmm, fair enough! The customization is only for the Qt dialog, not the native one, so you have to be prepared to use that. The post code also ends with:

              I cannot choose a file anymore. I can select a file, but no file is displayed in the "File Name" QLineEdit and the "OK" Button is disabled.

              So I hope that was settled via:

              Maybe also needs to implement mapFromSource/mapToSource?

              1 Reply Last reply
              0

              • Login

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