sigh, to create a database you need to specify a database name using QSqlDatabase::setDatabaseName, a database file will be created in current directory and its name will be equal to database name.
PS. take a look into QTDIR/examples/sql/connection.h, if you change
db.setDatabaseName(":memory:");
db.setDatabaseName(":memory:");
To copy to clipboard, switch view to plain text mode
to
db.setDatabaseName("mydatabase");
db.setDatabaseName("mydatabase");
To copy to clipboard, switch view to plain text mode
then all data will be kept in a file insted of RAM.
Bookmarks