Logo Search packages:      
Sourcecode: qt4-x11 version File versions

QSqlRecord Class Reference

Inheritance diagram for QSqlRecord:

Q3SqlCursor QSqlIndex Q3SqlSelectCursor

List of all members.

Detailed Description

The QSqlRecord class encapsulates a database record.


The QSqlRecord class encapsulates the functionality and characteristics of a database record (usually a row in a table or view within the database). QSqlRecord supports adding and removing fields as well as setting and retrieving field values.

The values of a record's fields' can be set by name or position with setValue(); if you want to set a field to null use setNull(). To find the position of a field by name use indexOf(), and to find the name of a field at a particular position use fieldName(). Use field() to retrieve a QSqlField object for a given field. Use contains() to see if the record contains a particular field name.

When queries are generated to be executed on the database only those fields for which isGenerated() is true are included in the generated SQL.

A record can have fields added with append() or insert(), replaced with replace(), and removed with remove(). All the fields can be removed with clear(). The number of fields is given by count(); all their values can be cleared (to null) using clearValues().

See also:
QSqlField, QSqlQuery::record()

Definition at line 38 of file qsqlrecord.h.

Public Member Functions

void append (const QSqlField &field)
void clear ()
void clearValues ()
bool contains (const QString &name) const
int count () const
QSqlField field (const QString &name) const
QSqlField field (int i) const
QString fieldName (int i) const
int indexOf (const QString &name) const
void insert (int pos, const QSqlField &field)
bool isEmpty () const
bool isGenerated (const QString &name) const
bool isGenerated (int i) const
bool isNull (const QString &name) const
bool isNull (int i) const
bool operator!= (const QSqlRecord &other) const
QSqlRecordoperator= (const QSqlRecord &other)
bool operator== (const QSqlRecord &other) const
 QSqlRecord (const QSqlRecord &other)
 QSqlRecord ()
void remove (int pos)
void replace (int pos, const QSqlField &field)
void setGenerated (int i, bool generated)
void setGenerated (const QString &name, bool generated)
void setNull (const QString &name)
void setNull (int i)
void setValue (const QString &name, const QVariant &val)
void setValue (int i, const QVariant &val)
QVariant value (const QString &name) const
QVariant value (int i) const
 ~QSqlRecord ()

Private Member Functions

void detach ()

Private Attributes

QSqlRecordPrivate * d

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index