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. Access files in UWP application
Forum Updated to NodeBB v4.3 + New Features

Access files in UWP application

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 816 Views
  • 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.
  • R Offline
    R Offline
    Rivka Cohen
    wrote on last edited by
    #1

    After efforts to create and write to a file in the qt UWP app, I was able to do so by using QStandardPaths
    But the path where the file was created is created when the app is installed and there until the app is uninstall..

    The code is

    auto path = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
    

    This is the path i got:
    C:\Users\xx\AppData\Local\Packages\6d33da94-6443-4688-99f9-247537f201af_gg7dtmt1ra0ap\LocalState

    I need access to the files in an existing location before the application was installed, and that the user can put files in a normal folder such as c:\

    Thanks

    jsulmJ 1 Reply Last reply
    0
    • R Rivka Cohen

      After efforts to create and write to a file in the qt UWP app, I was able to do so by using QStandardPaths
      But the path where the file was created is created when the app is installed and there until the app is uninstall..

      The code is

      auto path = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
      

      This is the path i got:
      C:\Users\xx\AppData\Local\Packages\6d33da94-6443-4688-99f9-247537f201af_gg7dtmt1ra0ap\LocalState

      I need access to the files in an existing location before the application was installed, and that the user can put files in a normal folder such as c:\

      Thanks

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

      @Rivka-Cohen Did you read the link I gave you in your other thread (https://docs.microsoft.com/en-us/windows/uwp/files/file-access-permissions)? This is nothing related to Qt, this is how UWP handles file access.
      In the link I gave you you will find:
      "Accessing additional locations

      In addition to the default locations, an app can access additional files and folders by declaring capabilities in the app manifest (see App capability declarations), or by calling a file picker to let the user pick files and folders for the app to access (see Open files and folders with a picker)."

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

      R 1 Reply Last reply
      3
      • jsulmJ jsulm

        @Rivka-Cohen Did you read the link I gave you in your other thread (https://docs.microsoft.com/en-us/windows/uwp/files/file-access-permissions)? This is nothing related to Qt, this is how UWP handles file access.
        In the link I gave you you will find:
        "Accessing additional locations

        In addition to the default locations, an app can access additional files and folders by declaring capabilities in the app manifest (see App capability declarations), or by calling a file picker to let the user pick files and folders for the app to access (see Open files and folders with a picker)."

        R Offline
        R Offline
        Rivka Cohen
        wrote on last edited by
        #3

        @jsulm
        Thanks
        You're directing me ...
        But I can not do it in QT
        I need a specific example of QT

        jsulmJ 1 Reply Last reply
        0
        • R Rivka Cohen

          @jsulm
          Thanks
          You're directing me ...
          But I can not do it in QT
          I need a specific example of QT

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

          @Rivka-Cohen I can't give you specific examples as I don't have any. You need to declare capabilities as explained in the link. How to do so should be described somewhere in Microsoft documentation. I think it is described here: https://docs.microsoft.com/de-de/windows/uwp/packaging/app-capability-declarations

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

          1 Reply Last reply
          2
          • R Offline
            R Offline
            Rivka Cohen
            wrote on last edited by
            #5

            Thanks for the help
            But it did not work for me :(
            It's probably part of the solution, but I think I'm missing something else

            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