jeudi 3 décembre 2015

Qt: What is the best place to save SQLite database?

Currently, I am hard coding the path of my SQLite database for development and debugging reasons as follow:

QString path = "/Users/user/Documents/workspace/application/";
db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName(path+"dbFile");
db.open()

But, for future "release" version, I need the application to create, save and access the database in user's machine. So, what is the best location to save the database of a Qt-creator application? and how can I do that ?!

Aucun commentaire:

Enregistrer un commentaire