QDjango
|
The first step is to open the database using QSqlDatabase::addDatabase(), for instance for an in-memory SQLite database:
You should now tell QDjango to use the database you just opened:
Once you have set the database and declared all your models (see Database models), you can ask QDjango to create the database tables for all models:
Conversely, you can ask QDjango to drop the database tables for all models:
Internally, QDjango calls the QDjango::database() method whenever it needs a handle to the database. This method will clone the database connection as needed if it is invoked from a different thread.