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

Open selected folder in Qml

Scheduled Pinned Locked Moved Solved QML and Qt Quick
4 Posts 2 Posters 685 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
    sush123
    wrote on last edited by
    #1

    Hi All,

    Can any one help me to open default path on button click in QML

    i trying with
    property url defaultPath : "C:/Users//Documents/gui/Import"

    FileDialog{
    id:openFileDialog
    title: "Please choose a file"
    folder: defaultPath
    selectFolder: true
    onAccepted: {

    }
    

    MenuButton {
    label: qsTr("Import")
    buttonWidth: buttonSize
    buttonHeight: buttonSize
    imageSource: "qrc:/images/import.svg"
    onMenuButtonClicked: //Open file browser to choose file
    {
    openFileDialog.open();
    }
    }

    Which opens bin folder by default how can i make it to open import folder which i have created in my project .

    Thank you :)

    jsulmJ 1 Reply Last reply
    0
    • S sush123

      Hi All,

      Can any one help me to open default path on button click in QML

      i trying with
      property url defaultPath : "C:/Users//Documents/gui/Import"

      FileDialog{
      id:openFileDialog
      title: "Please choose a file"
      folder: defaultPath
      selectFolder: true
      onAccepted: {

      }
      

      MenuButton {
      label: qsTr("Import")
      buttonWidth: buttonSize
      buttonHeight: buttonSize
      imageSource: "qrc:/images/import.svg"
      onMenuButtonClicked: //Open file browser to choose file
      {
      openFileDialog.open();
      }
      }

      Which opens bin folder by default how can i make it to open import folder which i have created in my project .

      Thank you :)

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @sush123 What about https://doc.qt.io/qt-5/qml-qtquick-dialogs-filedialog.html#folder-prop ?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

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

        issue resolved by giving path as
        folder: "file:///C:/Users//Documents/gui/Import"

        thank you

        jsulmJ 1 Reply Last reply
        0
        • S sush123

          issue resolved by giving path as
          folder: "file:///C:/Users//Documents/gui/Import"

          thank you

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @sush123 Please mark as solved

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved