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. Using QFileDialog::getExistingDirectory() to list files too !
Qt 6.11 is out! See what's new in the release blog

Using QFileDialog::getExistingDirectory() to list files too !

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.7k 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.
  • adaitabeheraA Offline
    adaitabeheraA Offline
    adaitabehera
    wrote on last edited by
    #1

    Is there a way that QFileDialog::getExistingDirectory() would also display the files but allow selecting only a directory.
    I need this feature in my application. I need to save multiple files to a folder selected by user and user can know (if he/she wants) if any of the file(s) is(are) present in that folder.

    Thanks.

    C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg. -- Bjarne Stroustrup

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Change the Options parameter from "getExistingDirectory":http://qt-project.org/doc/qt-4.8/qfiledialog.html#getExistingDirectory to 0, you should have what you need

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • adaitabeheraA Offline
        adaitabeheraA Offline
        adaitabehera
        wrote on last edited by
        #3

        Setting the Options parameter to 0 didn't work.

        C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg. -- Bjarne Stroustrup

        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