Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML FileDialog, selecting folder and file
Forum Updated to NodeBB v4.3 + New Features

QML FileDialog, selecting folder and file

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 2 Posters 1.5k Views
  • 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.
  • E Offline
    E Offline
    EmilieG
    wrote on 4 Sept 2020, 09:53 last edited by
    #1

    Hello,

    I'm trying to use FileDialog to select either a single file or a single folder (within the same dialog).
    My understanding from the documentation page is that it is possible.

    FileDialog provides a basic file chooser: it allows the user to select existing files and/or directories, or create new filenames.

    However when setting selectFolder to true I can only select folders. Not setting it true, the folders can only be opened not selected. I've also tried adding "Directories" to my nameFilters but it doesn't work..

    Is it possible to select either a folder or a file from the same FileDialog ?
    Thanks !

    J 1 Reply Last reply 4 Sept 2020, 11:59
    0
    • E EmilieG
      4 Sept 2020, 09:53

      Hello,

      I'm trying to use FileDialog to select either a single file or a single folder (within the same dialog).
      My understanding from the documentation page is that it is possible.

      FileDialog provides a basic file chooser: it allows the user to select existing files and/or directories, or create new filenames.

      However when setting selectFolder to true I can only select folders. Not setting it true, the folders can only be opened not selected. I've also tried adding "Directories" to my nameFilters but it doesn't work..

      Is it possible to select either a folder or a file from the same FileDialog ?
      Thanks !

      J Offline
      J Offline
      JonB
      wrote on 4 Sept 2020, 11:59 last edited by JonB 9 Apr 2020, 12:00
      #2

      @EmilieG
      I am not a QML user, but I don't think so (given what you have tried), despite the "files and/or directories" in the docs.
      Please read through all of https://stackoverflow.com/questions/33671350/how-to-select-multiple-files-and-directories-with-qml-filedialog (including all the comments) and see what you think!

      1 Reply Last reply
      0
      • E Offline
        E Offline
        EmilieG
        wrote on 7 Sept 2020, 08:37 last edited by
        #3

        Thanks for your answer but the solution exposed in this thread is not working properly..

        J 1 Reply Last reply 7 Sept 2020, 09:58
        0
        • E EmilieG
          7 Sept 2020, 08:37

          Thanks for your answer but the solution exposed in this thread is not working properly..

          J Offline
          J Offline
          JonB
          wrote on 7 Sept 2020, 09:58 last edited by
          #4

          @EmilieG
          What do you mean? There is no solution in that thread, the point is it is not doable, as I said/suggested....

          1 Reply Last reply
          0
          • E Offline
            E Offline
            EmilieG
            wrote on 7 Sept 2020, 13:29 last edited by
            #5

            There is a custom implementation in the comments. But it doesn't seem to work.

            1 Reply Last reply
            0

            2/5

            4 Sept 2020, 11:59

            • Login

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