Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Getting Started with Qt 5

You're reading from   Getting Started with Qt 5 Introduction to programming Qt 5 for cross-platform application development

Arrow left icon
Product type Paperback
Published in Feb 2019
Publisher Packt
ISBN-13 9781789956030
Length 136 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Benjamin Baka Benjamin Baka
Author Profile Icon Benjamin Baka
Benjamin Baka
Arrow right icon
View More author details
Toc

Using a data model for database access

There are two classes that can be used in accessing the database. These are the QSqlTableModel and QSqlQueryModel classes. The QSqlQueryModel class only provides a read-only model to the database. QSqlTableModel provides both read and write model access to the database.

In application development, you are confronted with the challenge of how to present data and to maintain a relationship between data and presentation (view) such that changes to the data are reflected in the view.

In the early days of the PHP language, data, presentation, and business logic were all jumbled up in one or more scripts. This made debugging and eventual code maintenance a nightmare. This same dilemma does crop up from time to time in language and framework design.

The Model-View-Controller (MVC) approach is an attempt to solve this problem. It recognizes that...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime