在QT随带的example中:
QT\example\sql\cachedtable
这个example中
使用了sqlite数据库
=====================
static bool createConnection()
{
QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName(":memory:");
if (!db.open()) {
QMessageBox::critical(0, qApp->tr("Cannot open database"),
qApp->tr("Unable to establish a database connection.\n"
"This example needs SQLite support. Please read "
"the Qt SQL driver documentation for information how "
"to build it.\n\n"
"Click Cancel to exit."), QMessageBox::Cancel);
return false;
}
=========================
sqlite是文件型数据库,这里明明使用了memory 数据库。
但我在相关目录中,没有找到memory.db
难道我每次都要建表,建字段,那不是打开速度受影响了。
请指教,谢谢!