A small example to work with the database in QML Qt. This lesson brings together information on the use of
signals and slots in the Qt QML
, access to C++ classes from QML layer implementation of the application interface on QML, as well as the implementation of the
for the database tables.
The database contains a table with a list of people, which has four columns:
- a unique record number;
FirstName (VARCHAR (255))
- First Name;
SurName (VARCHAR (255))
- Last Name;
Nik (VARCHAR (255))
- Nik name.
The application must implement removing and adding records to the database through the application interface. To add records to the database three fields for data entry will be used and a button that initiates the addition of data to an SQL database. Adding entries to the table through a wrapper class designed for this application is present in metodom.Takzhe ListModel class that implements the model of data representation for the information display in the TableView in QML layer.