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. QML Controls FileDialog "folder" property not working in Windows to set startup path
Forum Updated to NodeBB v4.3 + New Features

QML Controls FileDialog "folder" property not working in Windows to set startup path

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 6.0k 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.
  • N Offline
    N Offline
    Nosf
    wrote on last edited by
    #1

    Hey,

    Setting the "FileDialog.folder":http://qt-project.org/doc/qt-5.1/qtquickdialogs/qml-qtquick-dialogs1-filedialog.html#folder-prop property in QML before calling FileDialog.open() does not seem to set the startup path correctly.

    Qt: 5.1
    OS: Win-8

    Documentation states:

    bq. Setting this property before invoking open() will cause the file browser to be initially positioned on the specified folder.

    ^^ does not mention anything about only working for OSX/Linux. Currently that seems to be the case tho. Setting "folder" property works for Linux / Mac but not in Windows.

    The Dialogs examples coming with Qt 5.1 has "FileDialogs.qml" with the following:
    @
    // TODO: QTBUG-29814 This isn't portable, but we don't expose QDir::tempPath to QML yet.
    onClicked: fileDialog.folder = "/tmp" // file:///tmp would also be OK
    @

    I think that bug is only about temp path missing and not the actual property itself not working.

    Also the "folder" property works when you make a selection as in once a selection is made, it gives the correct new path url however it's just the Startup that seems to have a problem.

    Things I've tried:

    @fileDialog.folder = "file:///C:/Users/"@

    -> QWindowsNativeFileDialogBase::shellItem: SHCreateItemFromParsingName(/C:/Users/)) failed (An attempt was made to reference a token that does not exist.)

    @fileDialog.folder = "file://C:/Users/"@

    -> QWindowsNativeFileDialogBase::shellItem: SHCreateItemFromParsingName(/Users/)) failed (An attempt was made to reference a token that does not exist.)

    @fileDialog.folder = "C:/Users/"@

    -> QWindowsNativeFileDialogBase::shellItem: SHCreateItemFromParsingName(/Users/)) failed (An attempt was made to reference a token that does not exist.)

    @fileDialog.folder = "C:/Users"@

    -> QWindowsNativeFileDialogBase::shellItem: SHCreateItemFromParsingName(/Users/)) failed (An attempt was made to reference a token that does not exist.)

    @fileDialog.folder = "/C:/Users"@

    -> QWindowsNativeFileDialogBase::shellItem: SHCreateItemFromParsingName(/C:/Users/)) failed (An attempt was made to reference a token that does not exist.)

    Is this a bug I should report or am I missing something here?

    1 Reply Last reply
    0
    • E Offline
      E Offline
      ecloud
      wrote on last edited by
      #2

      https://bugreports.qt-project.org/browse/QTBUG-34100

      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