Hi
I am building some app which uses sqlite database. When I create database, put it in my project folder, put DEPLOYMENT in .pro file (and write function for open database, of course) and build app for mobile phone - installer copies my database file on !:/data/app_name, but app won't connect to database...
when I create database in memory of phone, I can normally run sql queries, but, when I close app - all changes are gone...
Does anyone have idea how to connect to database file?
here are some code snippets:
Code:from my_app.pro QT += sql gui core data.sources = dat/*.dat data.path = !:/Data/my_app/ DEPLOYMENT = dataerror strings are just for debugging, final application will have "normal" stringsCode:from my_app.cpp bool MainWindow::openDB() { //find sqslite driver db = QSqlDatabase::addDatabase("QSQLITE"); db.setDatabaseName(QDir::rootPath() + "/my_app/data.dat"); if (!db.open()){ QMessageBox::critical(0, QString::fromUtf8("error!"), QString::fromUtf8("error")); return false; }else{ QMessageBox::information(0, "Q'apla!", QString::fromUtf8("sucess")); return true;} }
I call openDB() in main function, just before app.exec()




