Deploy Sqlite db file on iOS and Winphone?

  • Code below it works on Android, but how to do same on iOS and Winphone?

    QFile dfile("assets:/db/database-last.db3");
    if (dfile.exists())
        QFile::setPermissions("./database-last.db3",QFile::WriteOwner |     QFile::ReadOwner);


    QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");


    in .pro file

    deployment.files += database-last.db3
    deployment.path = /assets/db
    INSTALLS += deployment

  • Moderators

    @AlekseyShi Here you try to write in current directory:


    This not going to work then that directory isn't writeable by your application (and the installation directory of an mobile app isn't writable!).
    You should use one of the standard directories from (QStandardPaths::AppDataLocation)

  • It works on Android by set permissions. My question is for iOS and Winphone concerning to pack dbfile into *.dmg.
    *But I'll try your advice too. :)

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.