Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Unsolved Forbid to select certain folder with FileDialog

    QML and Qt Quick
    2
    3
    438
    Loading More Posts
    • 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.
    • deleted34
      deleted34 last edited by

      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_ 1 Reply Last reply Reply Quote 0
      • the_
        the_ @deleted34 last edited by

        @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 --

        deleted34 1 Reply Last reply Reply Quote 0
        • deleted34
          deleted34 @the_ last edited by

          @the_ said:

          QSortFilterProxyModel

          Thank you, I'll have a look.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post