CopperSpice API  1.9.1
QSqlIndex Class Reference

The QSqlIndex class provides functions to manipulate and describe database indexes. More...

Inheritance diagram for QSqlIndex:
QSqlRecord

Public Methods

 QSqlIndex (const QSqlIndex &other)
 
 QSqlIndex (const QString &cursorName=QString (), const QString &name=QString ())
 
 ~QSqlIndex ()
 
void append (const QSqlField &field)
 
void append (const QSqlField &field, bool desc)
 
QString cursorName () const
 
bool isDescending (int i) const
 
QString name () const
 
QSqlIndex & operator= (const QSqlIndex &other)
 
void setCursorName (const QString &cursorName)
 
void setDescending (int i, bool desc)
 
void setName (const QString &name)
 
- Public Methods inherited from QSqlRecord
 QSqlRecord ()
 
 QSqlRecord (const QSqlRecord &other)
 
 ~QSqlRecord ()
 
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 index) const
 
QString fieldName (int index) 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 index) const
 
bool isNull (const QString &name) const
 
bool isNull (int index) const
 
bool operator!= (const QSqlRecord &other) const
 
QSqlRecord & operator= (const QSqlRecord &other)
 
bool operator== (const QSqlRecord &other) const
 
void remove (int pos)
 
void replace (int pos, const QSqlField &field)
 
void setGenerated (const QString &name, bool generated)
 
void setGenerated (int index, bool generated)
 
void setNull (const QString &name)
 
void setNull (int index)
 
void setValue (const QString &name, const QVariant &val)
 
void setValue (int index, const QVariant &val)
 
QVariant value (const QString &name) const
 
QVariant value (int index) const
 

Detailed Description

The QSqlIndex class provides functions to manipulate and describe database indexes. An index refers to a single table or view in a database. Information about the fields that comprise the index can be used to generate SQL statements.

See also
setCursorName()

Constructor & Destructor Documentation

QSqlIndex::QSqlIndex ( const QString cursorName = QString(),
const QString name = QString() 
)

Constructs an empty index using the cursor name of cursorname with an index of name.

QSqlIndex::QSqlIndex ( const QSqlIndex &  other)

Constructs a copy of other.

QSqlIndex::~QSqlIndex ( )

Destroys the object and frees any allocated resources.

Method Documentation

void QSqlIndex::append ( const QSqlField field)

Appends the field to the list of indexed fields. The field is appended with an ascending sort order.

void QSqlIndex::append ( const QSqlField field,
bool  desc 
)

Appends the field to the list of indexed fields. The field is appended with an ascending sort order, unless desc is true.

QString QSqlIndex::cursorName ( ) const
inline

Returns the name of the cursor which the index is associated with.

See also
setCursorName()
bool QSqlIndex::isDescending ( int  i) const

Returns true if field i in the index is sorted in descending order, otherwise returns false.

QString QSqlIndex::name ( ) const
inline

Returns the name of the index.

See also
setName()
QSqlIndex & QSqlIndex::operator= ( const QSqlIndex &  other)

Sets the index equal to other.

void QSqlIndex::setCursorName ( const QString cursorName)

Sets the name of the cursor that the index is associated with to cursorName.

See also
cursorName()
void QSqlIndex::setDescending ( int  i,
bool  desc 
)

If desc is true the field i is sorted in descending order. Otherwise, the field for i is sorted in ascending order. If the field does not exist, nothing happens.

See also
isDescending()
void QSqlIndex::setName ( const QString name)

Sets the name of the index to name.

See also
name()