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 mainwindow.ui and add a table widget (not a table view) from Item Widget (Item-Based) under the Widget ...