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] Open folder explorer with pre-selected file
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Open folder explorer with pre-selected file

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 9.8k 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.
  • M Offline
    M Offline
    mikeborgo
    wrote on last edited by
    #1

    Hello,

    I'm developing a desktop application that incudes a QWebView component that will be used to display some web pages from my website.
    Once the use left-clicks on a link that points to a .pdf, .zip or whatever, the desktop application dowloads the file via QNetworkAccessManager and then, promt the user to choose the location where he wants to save the document.

    After the file is saved, I currently open a window exploer instance, to the path where the file is, using the command "QDesktopServices::openUrl(<path>)".
    I'd like to pre-select the new file so that the user can easily find it, witout having to scroll or make anything else.
    Like what happens from the download manager built in Firefox or Chrome.

    I'd like this to be cross-platform.

    Is there any way to do that?

    Thank you
    Michele

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      There is no way to do that cross platform. There is no (common) API for file managers that I'm aware of, and certainly no Qt support for any such API.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        marsupial
        wrote on last edited by
        #3

        Although this might not be very convenient since there are tons of different file managers in use (especially on linux), you could build in support for the most common file managers.

        For Windows Explorer for example, have a look at the \select parameter http://support.microsoft.com/kb/152457

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Of course :-) Good link on how to do this with windows explorer!

          I'm sure there is similar API for mac, KDE and Gnome. The latter two you can probably do through DBus, if they don't have a command line parameter for it.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mikeborgo
            wrote on last edited by
            #5

            [quote author="marsupial" date="1341909697"]Although this might not be very convenient since there are tons of different file managers in use (especially on linux), you could build in support for the most common file managers.

            For Windows Explorer for example, have a look at the \select parameter http://support.microsoft.com/kb/152457[/quote]

            Thank you for your help.
            This pointed me to the right solution, thak you very much!
            At least on Windows it's perfect.

            Michele

            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