[Split] Sqlite database deploying



  • Hi

    Thanks for the advice in this post, I have bound a sqlLite database using c++ to my qml app

    One question I have that remains how could I include a pre populated database file with the application package, so that it could be referenced something like

    db.setDatabaseName(QCoreApplication::applicationDirPath()+"/qml/firstdatabase.db");

    I assume I am being a n00b and this is fairly trivial packaging!

    Thanks in advance



  • I've moved this to another thread from "this one":http://developer.qt.nokia.com/forums/viewthread/4583/
    Don't use old threads for new not really related questions, please.

    About your question. If you need read-only database, then you can add it to qrc (not good solution, really).
    Also you can simply copy it with your executable and other files (as I udnerstood you also have qmls there).
    The best way that I see is to populate it on first start. It is not hard. All you need is to check if there is file at needed plave and if not, create it and populate with sql queries.


Log in to reply
 

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