下面的代码适用于Android,但如何在iOS和Winphone上执行相同操作?
QFile dfile("assets:/db/database-last.db3");
if (dfile.exists())
{
dfile.copy("./database-last.db3");
QFile::setPermissions("./database-last.db3",QFile::WriteOwner | QFile::ReadOwner);
}
...
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName("./database-last.db3");
db.open();
...
<。>文件中的
deployment.files += database-last.db3
deployment.path = /assets/db
INSTALLS += deployment