Important: Please read the Qt Code of Conduct -

How do I deploy an existing sqlite database with my qt application on Symbian device?

  • I have one SQLite database, I want to deploy it with my App on symbina device.
    But I don't know how to do?
    Help me!

  • Try this in the .pro file:
    @sqfiles.sources = file with sqlite
    DEPLOYMENT += sqfiles@

  • An SQLite database is just one single file that needs to be installed on the device. If you are using QMake, use the DEPLOYMENT variable to do that.

  • Alexander beat me there while I was typing :-)

  • kalle :)

  • Hello,

    This solution works as long as you deploy to C:\ drive on Symbian.
    But when deploying on E:\ (aka mass storage), this won't work :

    @sqldeployment.sources = db.sqlite
    sqldeployment.path = .
    DEPLOYMENT += sqldeployment@

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

    The file db.sqlite exists in E:\Private\appID\ folder but do not get loaded by QSqlDatabase
    With C:\Private\appID\ it works fine.

    Any clue ?

  • Ok I found a solution :

    QString apppath = QApplication::applicationDirPath();
    QString dbpath(apppath);
    dbpath = QDir::toNativeSeparators(dbpath);

    This way it works both with C:\ and E:\ deployment.
    I can't see why the other way did not work however.

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

    for windows users use on main.cpp for define a librarypath :
    #ifdef Q_OS_WIN32
    QString env = getenv("SYSTEMROOT");

Log in to reply