Displaying information from a database in model view
Follow these steps to display information from a database on a model view widget:
How to do it…
In this recipe, we will learn how to display multiple sets of data obtained from our SQL database in a model view in our program:
- We will be using the database table called
employee
, which we used in the previous example in Creating a login screen with Qt. This time, we need a lot more data in the employee table. Open up your SQLiteStudio control panel. Add data for a few more employees so that we can display it later in our program:
Figure 12.20 – Add more dummy data to the employee table