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. [Solved] QML Simple File Browser
Forum Updated to NodeBB v4.3 + New Features

[Solved] QML Simple File Browser

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 2.1k 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.
  • S Offline
    S Offline
    skammers
    wrote on last edited by
    #1

    Hey!

    Up to now I've been using the FileDialog for all file handling. But now I want to open a file browser option where you cant choose files. Only see them and browse through them etc. Now I am using file dialog, and the problem is that if someone were to double click on one of the files when browsing. The file dialog would think the user chose that file and close.

    You see, I made some zip files and I need to open a browse window where the user can explore these. What happens now is that when the user double click on one of the zip files. The dialog closes.

    Any suggestion?

    Thanks in advance.

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      The best option i see here is to create your own explorer based on C++ model

      157

      1 Reply Last reply
      0
      • S Offline
        S Offline
        skammers
        wrote on last edited by
        #3

        But is it possible to make the filedialog open zip files?

        1 Reply Last reply
        0
        • p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          What you can do is first extract the ZIP file to a temporary location using QuaZip or any other and then from the C++ model you can parse that directory and fill the model.

          157

          1 Reply Last reply
          0
          • S Offline
            S Offline
            skammers
            wrote on last edited by
            #5

            Found a much simpler solution!
            Used QDesktopServices and openUrl:

            @void MasterResource::openFolder(QString path)
            {
            if(path.contains("//") && !path.contains("///")){
            path = "file:" + path;
            }
            QUrl url(path);
            QDesktopServices::openUrl(url);
            }@

            1 Reply Last reply
            0
            • p3c0P Offline
              p3c0P Offline
              p3c0
              Moderators
              wrote on last edited by
              #6

              Oh yes, that's a good idea.

              157

              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