Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. App's path for external storage in Qt ?
Forum Updated to NodeBB v4.3 + New Features

App's path for external storage in Qt ?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 3 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.
  • Z Offline
    Z Offline
    ZINE
    wrote on last edited by
    #1

    Hi,

    I am trying to make a file browser for android using Qt 5.12.3 and QFileSystemModel class. I read that getExternalStorageDirectory() give the path of the external storage of directory in JAVA. Is there an equivalent for this function in C++ Qt ?

    jsulmJ 1 Reply Last reply
    0
    • Z ZINE

      Hi,

      I am trying to make a file browser for android using Qt 5.12.3 and QFileSystemModel class. I read that getExternalStorageDirectory() give the path of the external storage of directory in JAVA. Is there an equivalent for this function in C++ Qt ?

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

      @ZINE Take a look at https://doc.qt.io/qt-5/qtandroidextras-index.html

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

      1 Reply Last reply
      1
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        Im not sure what the JAVA versions gives you but Qt has
        https://doc.qt.io/qt-5/qstandardpaths.html
        Which might be able to give you the folder you are looking for.

        Z 1 Reply Last reply
        0
        • mrjjM mrjj

          Hi
          Im not sure what the JAVA versions gives you but Qt has
          https://doc.qt.io/qt-5/qstandardpaths.html
          Which might be able to give you the folder you are looking for.

          Z Offline
          Z Offline
          ZINE
          wrote on last edited by
          #4

          @mrjj I already used the following code :

          dir_model=new QFileSystemModel(this);
          dir_liste=new QTreeView(this);
          dir_model->setRootPath(QDir::rootPath());
          dir_liste->setModel(dir_model);

          I add permission "android.permission.READ_EXTERNAL_STORAGE" and "android.permission.WRITE_EXTERNAL_STORAGE" to the AndroidManifest.xml file. Also i add manual permission : Settings-> apps -> permissions -> storage, for my android app.

          When i run my app i get an empty :/ directory, with the output message :
          E libFileDialog.so: inotify_add_watch(/) failed: (Permission denied)

          How i can use QStandardpaths in my previous code ?

          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