Sometimes, data files aren't just stored on disk to be freely used, but are managed by a database runtime system. Fortunately, Qt provides us with the possibility to talk to SQL databases by using its QtSql module. We will take a cursory look at this, but general database performance is a big and deep field and lies outside of the scope of this book.
Connecting databases
Basic example using SQLite
For this example, we will use the SQLite lightweight, in-memory database, because it is exceptionally simple to use.
To work with SQLite databases, you first have to install the SQLite tools, as the SQLite driver that's needed by Qt is already included in its installation. Go to https://www.sqlite.org/download.html, download...