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. Config file with the package
Qt 6.11 is out! See what's new in the release blog

Config file with the package

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 2 Posters 1.2k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Guys,

    I want to create a cross-platform application on mobile devices, both tablets and smartphones. The problem I could not solve is that I want to deliver my program with a json file holding some configuration data. I need to figure out:

    1. How to deploy an app with a custom file?
    2. How to read the deployed file?

    The solution must be independent from the platform. Therefore, it should not be a specific path when reading.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Sounds like something for Qt's "resource":http://qt-project.org/doc/qt-5/resources.html system.

      For common paths on various platforms you have "QStandardPaths":http://qt-project.org/doc/qt-5/qstandardpaths.html

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        About the standard paths, I tried the following on an android device and get an empty string:

        @

        QString path(QStandardPaths::locate(
        QStandardPaths::DocumentsLocation,
        QString(),
        QStandardPaths::LocateDirectory));

        qDebug() << path;
        @

        Output:

        D/Qt (26137): ..\MobileMenu\mainwidget.cpp:15 (MainWidget::MainWidget(QWidget*)): ""

        Secondly, I have reviwed the documatation of it and I could not find any info for the IOS mobile devices. There are win, OSX, android, blackberry and linux only. Is it assumed that IOS and OSX are the same? "Link":http://qt-project.org/doc/qt-5/qstandardpaths.html

        UPDATE:
        I have succeeded in writing/reading by changing the "DocumentsLocation" to "DataLocation" :) However, I am still wondering if it will be working on IOS devices because of the reason I mentioned in the answers.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          The documentation is being updated for iOS

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          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