PDA

View Full Version : Database programming using Qt



SWEngineer
6th June 2011, 12:35
What resources do you recommend for getting up and running with database programming using Qt?

Thanks.

wysota
6th June 2011, 12:47
Qt Reference Manual.

DanH
6th June 2011, 13:27
If you're going to use SQLite then the SQLite web site (http://www.sqlite.org/docs.html) is a good resource.

helloworld
6th June 2011, 14:56
List of database-related classes in Qt from the docs:


QSql (http://doc.qt.nokia.com/latest/qsql.html)
Contains miscellaneous identifiers used throughout the Qt SQL library
QSqlDatabase (http://doc.qt.nokia.com/latest/qsqldatabase.html)
Represents a connection to a database
QSqlDriver (http://doc.qt.nokia.com/latest/qsqldriver.html)
Abstract base class for accessing specific SQL databases
QSqlDriverCreator (http://doc.qt.nokia.com/latest/qsqldrivercreator.html)
Template class that provides a SQL driver factory for a specific driver type
QSqlDriverCreatorBase (http://doc.qt.nokia.com/latest/qsqldrivercreatorbase.html)
The base class for SQL driver factories
QSqlError (http://doc.qt.nokia.com/latest/qsqlerror.html)
SQL database error information
QSqlField (http://doc.qt.nokia.com/latest/qsqlfield.html)
Manipulates the fields in SQL database tables and views
QSqlIndex (http://doc.qt.nokia.com/latest/qsqlindex.html)
Functions to manipulate and describe database indexes
QSqlQuery (http://doc.qt.nokia.com/latest/qsqlquery.html)
Means of executing and manipulating SQL statements
QSqlQueryModel (http://doc.qt.nokia.com/latest/qsqlquerymodel.html)
Read-only data model for SQL result sets
QSqlRecord (http://doc.qt.nokia.com/latest/qsqlrecord.html)
Encapsulates a database record
QSqlRelationalTableModel (http://doc.qt.nokia.com/latest/qsqlrelationaltablemodel.html)
Editable data model for a single database table, with foreign key support
QSqlResult (http://doc.qt.nokia.com/latest/qsqlresult.html)
Abstract interface for accessing data from specific SQL databases
QSqlTableModel (http://doc.qt.nokia.com/latest/qsqltablemodel.html)
Editable data model for a single database table


There is a bunch of examples as well, they are all available from the welcome screen in the IDE:

http://doc.trolltech.com/4.5/sql-cachedtable.html
http://doc.trolltech.com/4.5/sql-drilldown.html
http://doc.trolltech.com/4.5/sql-querymodel.html
http://doc.trolltech.com/4.5/sql-relationaltablemodel.html
http://doc.trolltech.com/4.5/sql-tablemodel.html
http://doc.trolltech.com/4.5/sql-sqlwidgetmapper.html

szisziszilvi
7th June 2011, 09:01
I startedwith http://doc.trolltech.com/4.5/sql-cachedtable.html that hellowold already suggested, but afterwards I guess it depends on what sort of database you are goung to use.