Important: Please read the Qt Code of Conduct -

Config file with the package

  • 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.

  • Lifetime Qt Champion


    Sounds like something for Qt's "resource": system.

    For common paths on various platforms you have "QStandardPaths":

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


    QString path(QStandardPaths::locate(

    qDebug() << path;


    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":

    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.

  • Lifetime Qt Champion

    The documentation is being updated for iOS

Log in to reply