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. QML FileDialog set folder.
Qt 6.11 is out! See what's new in the release blog

QML FileDialog set folder.

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.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!

    I am trying to preset the folder path for my FileDialog.
    I got from the documentation that I need to specify a Url for it to work (folder : url).

    So I tried this:

    @
    onClicked: {
    getFilePath.folder = masterResource.testPath; // Doesnt work. tried this approach where the testPath is a QUrl.
    getFilePath.folder = "file:///" + masterResource.pathWork //tried this approach, where pathWork is a QString. This works. But I suspect that the "file:///" comes automatically. Cause when I even write "file:" instead of "file:///" the output is still "file:///". So it works in some cases.

    }
    @

    Even though there written beside each other now I tried them separately. It seems no matter what I write in front of my path it just removes it and puts "file:///" instead. Which is not good, cause sometimes I need it to be only "file://" (notice only two "/".)

    Do anyone know the solution to this problem?

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

      Get this error all the time....:

      @shellItem: SHCreateItemFromParsingName(/mypath)) failed (An attempt was made to reference a token that does not exist.)@

      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