Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > ac91357d6caede925de099a02fced14e > files > 4654

qt4-doc-4.2.1-1.el5_7.1.x86_64.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /tmp/qt-4.2.1-harald-1161357942206/qt-x11-opensource-src-4.2.1/src/sql/kernel/qsqlindex.cpp -->
<head>
  <title>Qt 4.2: QSqlIndex Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">QSqlIndex Class Reference<br /><sup><sup>[<a href="qtsql.html">QtSql</a> module]</sup></sup></h1>
<p>The QSqlIndex class provides functions to manipulate and describe database indexes. <a href="#details">More...</a></p>
<pre> #include &lt;QSqlIndex&gt;</pre><p>Inherits <a href="qsqlrecord.html">QSqlRecord</a>.</p>
<ul>
<li><a href="qsqlindex-members.html">List of all members, including inherited members</a></li>
<li><a href="qsqlindex-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/><b><a href="qsqlindex.html#QSqlIndex">QSqlIndex</a></b> ( const QString &amp; <i>cursorname</i> = QString(), const QString &amp; <i>name</i> = QString() )</li>
<li><div class="fn"/><b><a href="qsqlindex.html#QSqlIndex-2">QSqlIndex</a></b> ( const QSqlIndex &amp; <i>other</i> )</li>
<li><div class="fn"/><b><a href="qsqlindex.html#dtor.QSqlIndex">~QSqlIndex</a></b> ()</li>
<li><div class="fn"/>void <b><a href="qsqlindex.html#append">append</a></b> ( const QSqlField &amp; <i>field</i> )</li>
<li><div class="fn"/>void <b><a href="qsqlindex.html#append-2">append</a></b> ( const QSqlField &amp; <i>field</i>, bool <i>desc</i> )</li>
<li><div class="fn"/>QString <b><a href="qsqlindex.html#cursorName">cursorName</a></b> () const</li>
<li><div class="fn"/>bool <b><a href="qsqlindex.html#isDescending">isDescending</a></b> ( int <i>i</i> ) const</li>
<li><div class="fn"/>QString <b><a href="qsqlindex.html#name">name</a></b> () const</li>
<li><div class="fn"/>void <b><a href="qsqlindex.html#setCursorName">setCursorName</a></b> ( const QString &amp; <i>cursorName</i> )</li>
<li><div class="fn"/>void <b><a href="qsqlindex.html#setDescending">setDescending</a></b> ( int <i>i</i>, bool <i>desc</i> )</li>
<li><div class="fn"/>void <b><a href="qsqlindex.html#setName">setName</a></b> ( const QString &amp; <i>name</i> )</li>
<li><div class="fn"/>QSqlIndex &amp; <b><a href="qsqlindex.html#operator-eq">operator=</a></b> ( const QSqlIndex &amp; <i>other</i> )</li>
</ul>
<ul>
<li><div class="fn"/>28 public functions inherited from <a href="qsqlrecord.html#public-functions">QSqlRecord</a></li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QSqlIndex class provides functions to manipulate and describe database indexes.</p>
<p>An <i>index</i> 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 <a href="porting4.html#qsqlcursor">QSqlCursor</a> object.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="QSqlIndex"></a>QSqlIndex::QSqlIndex ( const <a href="qstring.html">QString</a> &amp; <i>cursorname</i> = QString(), const <a href="qstring.html">QString</a> &amp; <i>name</i> = QString() )</h3>
<p>Constructs an empty index using the cursor name <i>cursorname</i> and index name <i>name</i>.</p>
<h3 class="fn"><a name="QSqlIndex-2"></a>QSqlIndex::QSqlIndex ( const QSqlIndex &amp; <i>other</i> )</h3>
<p>Constructs a copy of <i>other</i>.</p>
<h3 class="fn"><a name="dtor.QSqlIndex"></a>QSqlIndex::~QSqlIndex ()</h3>
<p>Destroys the object and frees any allocated resources.</p>
<h3 class="fn"><a name="append"></a>void QSqlIndex::append ( const <a href="qsqlfield.html">QSqlField</a> &amp; <i>field</i> )</h3>
<p>Appends the field <i>field</i> to the list of indexed fields. The field is appended with an ascending sort order.</p>
<h3 class="fn"><a name="append-2"></a>void QSqlIndex::append ( const <a href="qsqlfield.html">QSqlField</a> &amp; <i>field</i>, bool <i>desc</i> )</h3>
<p>This is an overloaded member function, provided for convenience.</p>
<p>Appends the field <i>field</i> to the list of indexed fields. The field is appended with an ascending sort order, unless <i>desc</i> is true.</p>
<h3 class="fn"><a name="cursorName"></a><a href="qstring.html">QString</a> QSqlIndex::cursorName () const</h3>
<p>Returns the name of the cursor which the index is associated with.</p>
<p>See also <a href="qsqlindex.html#setCursorName">setCursorName</a>().</p>
<h3 class="fn"><a name="isDescending"></a>bool QSqlIndex::isDescending ( int <i>i</i> ) const</h3>
<p>Returns true if field <i>i</i> in the index is sorted in descending order; otherwise returns false.</p>
<h3 class="fn"><a name="name"></a><a href="qstring.html">QString</a> QSqlIndex::name () const</h3>
<p>Returns the name of the index.</p>
<p>See also <a href="qsqlindex.html#setName">setName</a>().</p>
<h3 class="fn"><a name="setCursorName"></a>void QSqlIndex::setCursorName ( const <a href="qstring.html">QString</a> &amp; <i>cursorName</i> )</h3>
<p>Sets the name of the cursor that the index is associated with to <i>cursorName</i>.</p>
<p>See also <a href="qsqlindex.html#cursorName">cursorName</a>().</p>
<h3 class="fn"><a name="setDescending"></a>void QSqlIndex::setDescending ( int <i>i</i>, bool <i>desc</i> )</h3>
<p>If <i>desc</i> is true, field <i>i</i> is sorted in descending order. Otherwise, field <i>i</i> is sorted in ascending order (the default). If the field does not exist, nothing happens.</p>
<p>See also <a href="qsqlindex.html#isDescending">isDescending</a>().</p>
<h3 class="fn"><a name="setName"></a>void QSqlIndex::setName ( const <a href="qstring.html">QString</a> &amp; <i>name</i> )</h3>
<p>Sets the name of the index to <i>name</i>.</p>
<p>See also <a href="qsqlindex.html#name">name</a>().</p>
<h3 class="fn"><a name="operator-eq"></a>QSqlIndex &amp; QSqlIndex::operator= ( const QSqlIndex &amp; <i>other</i> )</h3>
<p>Sets the index equal to <i>other</i>.</p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="toString"></a><a href="qstring.html">QString</a> QSqlIndex::toString ( const <a href="qstring.html">QString</a> &amp; <i>prefix</i> = QString(), const <a href="qstring.html">QString</a> &amp; <i>sep</i> = QLatin1String( &quot;,&quot; ), bool <i>verbose</i> = true ) const</h3>
<p>Returns a comma-separated list of all the index's field names as a string. This string is suitable, for example, for generating a SQL SELECT statement. Only generated fields are included in the list (see <a href="qsqlrecord.html#isGenerated">isGenerated</a>()). If a <i>prefix</i> is specified, e.g. a table name, it is prepended before all field names in the form:</p>
<p>&quot;<i>prefix</i>.&lt;fieldname&gt;&quot;</p>
<p>If <i>sep</i> is specified, each field is separated by <i>sep</i>. If <i>verbose</i> is true (the default), each field contains a suffix indicating an ASCending or DESCending sort order.</p>
<h3 class="fn"><a name="toStringList"></a><a href="qstringlist.html">QStringList</a> QSqlIndex::toStringList ( const <a href="qstring.html">QString</a> &amp; <i>prefix</i> = QString(), bool <i>verbose</i> = true ) const</h3>
<p>Returns a list of all the index's field names. Only generated fields are included in the list (see <a href="qsqlrecord.html#isGenerated">isGenerated</a>()). If a <i>prefix</i> is specified, e.g. a table name, all fields are prefixed in the form:</p>
<p>&quot;<i>prefix</i>.&lt;fieldname&gt;&quot;</p>
<p>If <i>verbose</i> is true (the default), each field contains a suffix indicating an ASCending or DESCending sort order.</p>
<p>Note that if you want to iterate over the list, you should iterate over a copy, e.g.</p>
<pre> QStringList list = myIndex.toStringList();
 QStringList::Iterator it = list.begin();
 while(it != list.end()) {
     myProcessing(*it);
     ++it;
 }</pre>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2006 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.2.1</div></td>
</tr></table></div></address></body>
</html>