In this recipe, we will learn how to display multiple sets of data obtained from our SQL database on a model view in our program.
Displaying information from a database on a model view
How to do it...
Follow these steps to display information from a database on a model view widget:
- We will be using the database table called employee, which we used in the previous example, Creating a login screen with Qt. This time, we need a lot more data in the employee table. Open up your web browser and log into your phpMyAdmin control panel.
Add data for a few more employees so that we can display it later in our program:
- Open Qt Creator, create a new Qt Widgets Application project, and then add the SQL module to your project.
- Open...