Setting up a database
Qt supports several different types of SQL drivers in the form of plugins/add-ons, such as SQLite, ODBC, PostgreSQL, MySQL, and so on. However, it’s very easy to integrate these drivers into your Qt project. We will learn how to do this in the following example.
How to do it…
In this example, we will learn how to use Qt with SQLite. Let’s set up our SQLite editor before we dive into Qt:
- Download SQLiteStudio from https://sqlitestudio.pl and install it to administrate your SQLite databases:
Figure 12.1 – Install SQLiteStudio onto your computer
- Open SQLiteStudio and you should see something like this:
Figure 12.2 – SQLiteStudio is a handy program for managing SQLite databases
- We need to create a new database before we start; go to Database | Add a database. Select the SQLite 3 option for your database type, followed by selecting your file...