Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Classes principales  ·  Annotées  ·  Classes groupées  ·  Fonctions  · 

QSqlIndex Class Reference
[sql module]

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

#include <qsqlindex.h>

Inherits QSqlRecord.

List of all member functions.

Public Members

  • QSqlIndex ( const QString & cursorname = QString::null, const QString & name = QString::null )
  • QSqlIndex ( const QSqlIndex & other )
  • QSqlIndex & operator= ( const QSqlIndex & other )
  • virtual void setCursorName ( const QString & cursorName )
  • QString cursorName () const
  • virtual void setName ( const QString & name )
  • QString name () const
  • virtual void append ( const QSqlField & field )
  • virtual void append ( const QSqlField & field, bool desc )
  • bool isDescending ( int i ) const
  • virtual void setDescending ( int i, bool desc )

Static Public Members

  • QSqlIndex fromStringList ( const QStringList & l, const QSqlCursor * cursor )

Detailed Description

The QSqlIndex class provides functions to manipulate and describe QSqlCursor and QSqlDatabase indexes.

This class is used to describe and manipulate QSqlCursor and QSqlDatabase 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, or to affect the behavior of a QSqlCursor object.

Normally, QSqlIndex objects are created by QSqlDatabase or QSqlCursor.

See also Database Classes.


Member Function Documentation

QSqlIndex::QSqlIndex ( const QString & cursorname = QString::null, const QString & name = QString::null )

Constructs an empty index using the cursor name cursorname and index name name.

QSqlIndex::QSqlIndex ( const QSqlIndex & other )

Constructs a copy of other.

QSqlIndex::~QSqlIndex ()

Destroys the object and frees any allocated resources.

void QSqlIndex::append ( const QSqlField & field ) [virtual]

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

Reimplemented from QSqlRecord.

void QSqlIndex::append ( const QSqlField & field, bool desc ) [virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

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

QString QSqlIndex::cursorName () const

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

QSqlIndex QSqlIndex::fromStringList ( const QStringList & l, const QSqlCursor * cursor ) [static]

Returns an index based on the field descriptions in l and the cursor cursor. The field descriptions should be in the same format that toStringList() produces, for example, a surname field in the people table might be in one of these forms: "surname", "surname DESC" or "people.surname ASC".

See also toStringList().

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

Returns the name of the index.

QSqlIndex & QSqlIndex::operator= ( const QSqlIndex & other )

Sets the index equal to other.

void QSqlIndex::setCursorName ( const QString & cursorName ) [virtual]

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

void QSqlIndex::setDescending ( int i, bool desc ) [virtual]

If desc is TRUE, field i is sorted in descending order. Otherwise, field i is sorted in ascending order (the default). If the field does not exist, nothing happens.

void QSqlIndex::setName ( const QString & name ) [virtual]

Sets the name of the index to name.

This file is part of the Qt toolkit. Copyright © 1995-2002 Trolltech. All Rights Reserved.

Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. Qt 3.0
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD.
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP !
 
 
 
 
Partenaires

Hébergement Web