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. Forbid to select certain folder with FileDialog

Forbid to select certain folder with FileDialog

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 2 Posters 780 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.
  • deleted34D Offline
    deleted34D Offline
    deleted34
    wrote on last edited by
    #1

    I have a preferences page which allows to select a handful of different locations for files (music, pictures, videos) via a FileDialog. I'd like to forbid selecting the same folder that is already select for another item. For exmaple when the music location is set to /users/bob/music, this folder should not be selectable when setting a folder for the video location. Is that possible and if so, how?

    the_T 1 Reply Last reply
    0
    • deleted34D deleted34

      I have a preferences page which allows to select a handful of different locations for files (music, pictures, videos) via a FileDialog. I'd like to forbid selecting the same folder that is already select for another item. For exmaple when the music location is set to /users/bob/music, this folder should not be selectable when setting a folder for the video location. Is that possible and if so, how?

      the_T Offline
      the_T Offline
      the_
      wrote on last edited by
      #2

      @DenverCoder22

      You could store the already selected folders in a QStringList and use a customized Filter proxy derived from QSortFilterProxyModel to allow or deny access to folders.

      -- No support in PM --

      deleted34D 1 Reply Last reply
      0
      • the_T the_

        @DenverCoder22

        You could store the already selected folders in a QStringList and use a customized Filter proxy derived from QSortFilterProxyModel to allow or deny access to folders.

        deleted34D Offline
        deleted34D Offline
        deleted34
        wrote on last edited by
        #3

        @the_ said:

        QSortFilterProxyModel

        Thank you, I'll have a look.

        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