source: trunk/doc/html/qsqlindex.html

Last change on this file was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 8.0 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/sql/qsqlindex.cpp:43 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QSqlIndex Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QSqlIndex Class Reference<br><small>[<a href="sql.html">sql module</a>]</small></h1>
33
34<p>The QSqlIndex class provides functions to manipulate and
35describe QSqlCursor and QSqlDatabase indexes.
36<a href="#details">More...</a>
37<p><tt>#include &lt;<a href="qsqlindex-h.html">qsqlindex.h</a>&gt;</tt>
38<p>Inherits <a href="qsqlrecord.html">QSqlRecord</a>.
39<p><a href="qsqlindex-members.html">List of all member functions.</a>
40<h2>Public Members</h2>
41<ul>
42<li class=fn><a href="#QSqlIndex"><b>QSqlIndex</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;cursorname = QString::null, const&nbsp;QString&nbsp;&amp;&nbsp;name = QString::null )</li>
43<li class=fn><a href="#QSqlIndex-2"><b>QSqlIndex</b></a> ( const&nbsp;QSqlIndex&nbsp;&amp;&nbsp;other )</li>
44<li class=fn><a href="#~QSqlIndex"><b>~QSqlIndex</b></a> ()</li>
45<li class=fn>QSqlIndex &amp; <a href="#operator-eq"><b>operator=</b></a> ( const&nbsp;QSqlIndex&nbsp;&amp;&nbsp;other )</li>
46<li class=fn>virtual void <a href="#setCursorName"><b>setCursorName</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;cursorName )</li>
47<li class=fn>QString <a href="#cursorName"><b>cursorName</b></a> () const</li>
48<li class=fn>virtual void <a href="#setName"><b>setName</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;name )</li>
49<li class=fn>QString <a href="#name"><b>name</b></a> () const</li>
50<li class=fn>virtual void <a href="#append"><b>append</b></a> ( const&nbsp;QSqlField&nbsp;&amp;&nbsp;field )</li>
51<li class=fn>virtual void <a href="#append-2"><b>append</b></a> ( const&nbsp;QSqlField&nbsp;&amp;&nbsp;field, bool&nbsp;desc )</li>
52<li class=fn>bool <a href="#isDescending"><b>isDescending</b></a> ( int&nbsp;i ) const</li>
53<li class=fn>virtual void <a href="#setDescending"><b>setDescending</b></a> ( int&nbsp;i, bool&nbsp;desc )</li>
54</ul>
55<h2>Static Public Members</h2>
56<ul>
57<li class=fn>QSqlIndex <a href="#fromStringList"><b>fromStringList</b></a> ( const&nbsp;QStringList&nbsp;&amp;&nbsp;l, const&nbsp;QSqlCursor&nbsp;*&nbsp;cursor )</li>
58</ul>
59<hr><a name="details"></a><h2>Detailed Description</h2>
60
61
62The QSqlIndex class provides functions to manipulate and
63describe <a href="qsqlcursor.html">QSqlCursor</a> and <a href="qsqldatabase.html">QSqlDatabase</a> indexes.
64<p>
65
66<p> This class is used to describe and manipulate QSqlCursor and
67QSqlDatabase indexes. An index refers to a single table or view
68in a database. Information about the fields that comprise the
69index can be used to generate SQL statements, or to affect the
70behavior of a <a href="qsqlcursor.html">QSqlCursor</a> object.
71<p> Normally, QSqlIndex objects are created by <a href="qsqldatabase.html">QSqlDatabase</a> or
72QSqlCursor.
73<p>See also <a href="database.html">Database Classes</a>.
74
75<hr><h2>Member Function Documentation</h2>
76<h3 class=fn><a name="QSqlIndex"></a>QSqlIndex::QSqlIndex ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;cursorname = QString::null, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name = QString::null )
77</h3>
78Constructs an empty index using the cursor name <em>cursorname</em> and
79index name <em>name</em>.
80
81<h3 class=fn><a name="QSqlIndex-2"></a>QSqlIndex::QSqlIndex ( const&nbsp;<a href="qsqlindex.html">QSqlIndex</a>&nbsp;&amp;&nbsp;other )
82</h3>
83Constructs a copy of <em>other</em>.
84
85<h3 class=fn><a name="~QSqlIndex"></a>QSqlIndex::~QSqlIndex ()
86</h3>
87Destroys the object and frees any allocated resources.
88
89<h3 class=fn>void <a name="append"></a>QSqlIndex::append ( const&nbsp;<a href="qsqlfield.html">QSqlField</a>&nbsp;&amp;&nbsp;field )<tt> [virtual]</tt>
90</h3>
91Appends the field <em>field</em> to the list of indexed fields. The
92field is appended with an ascending sort order.
93
94<p>Reimplemented from <a href="qsqlrecord.html#append">QSqlRecord</a>.
95<h3 class=fn>void <a name="append-2"></a>QSqlIndex::append ( const&nbsp;<a href="qsqlfield.html">QSqlField</a>&nbsp;&amp;&nbsp;field, bool&nbsp;desc )<tt> [virtual]</tt>
96</h3>
97This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
98<p> Appends the field <em>field</em> to the list of indexed fields. The
99field is appended with an ascending sort order, unless <em>desc</em> is
100TRUE.
101
102<h3 class=fn><a href="qstring.html">QString</a> <a name="cursorName"></a>QSqlIndex::cursorName () const
103</h3>
104
105<p> Returns the name of the cursor which the index is associated with.
106
107<h3 class=fn><a href="qsqlindex.html">QSqlIndex</a> <a name="fromStringList"></a>QSqlIndex::fromStringList ( const&nbsp;<a href="qstringlist.html">QStringList</a>&nbsp;&amp;&nbsp;l, const&nbsp;<a href="qsqlcursor.html">QSqlCursor</a>&nbsp;*&nbsp;cursor )<tt> [static]</tt>
108</h3>
109Returns an index based on the field descriptions in <em>l</em> and the
110cursor <em>cursor</em>. The field descriptions should be in the same
111format that <a href="qsqlrecord.html#toStringList">toStringList</a>() produces, for example, a surname field
112in the people table might be in one of these forms: "surname",
113"surname DESC" or "people.surname ASC".
114<p> <p>See also <a href="qsqlrecord.html#toStringList">toStringList</a>().
115
116<h3 class=fn>bool <a name="isDescending"></a>QSqlIndex::isDescending ( int&nbsp;i ) const
117</h3>
118Returns TRUE if field <em>i</em> in the index is sorted in descending
119order; otherwise returns FALSE.
120
121<h3 class=fn><a href="qstring.html">QString</a> <a name="name"></a>QSqlIndex::name () const
122</h3>
123
124<p> Returns the name of the index.
125
126<h3 class=fn><a href="qsqlindex.html">QSqlIndex</a>&nbsp;&amp; <a name="operator-eq"></a>QSqlIndex::operator= ( const&nbsp;<a href="qsqlindex.html">QSqlIndex</a>&nbsp;&amp;&nbsp;other )
127</h3>
128Sets the index equal to <em>other</em>.
129
130<h3 class=fn>void <a name="setCursorName"></a>QSqlIndex::setCursorName ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;cursorName )<tt> [virtual]</tt>
131</h3>
132Sets the name of the cursor that the index is associated with to
133<em>cursorName</em>.
134
135<h3 class=fn>void <a name="setDescending"></a>QSqlIndex::setDescending ( int&nbsp;i, bool&nbsp;desc )<tt> [virtual]</tt>
136</h3>
137If <em>desc</em> is TRUE, field <em>i</em> is sorted in descending order.
138Otherwise, field <em>i</em> is sorted in ascending order (the default).
139If the field does not exist, nothing happens.
140
141<h3 class=fn>void <a name="setName"></a>QSqlIndex::setName ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;name )<tt> [virtual]</tt>
142</h3>
143Sets the name of the index to <em>name</em>.
144
145<!-- eof -->
146<hr><p>
147This file is part of the <a href="index.html">Qt toolkit</a>.
148Copyright &copy; 1995-2007
149<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
150<table width=100% cellspacing=0 border=0><tr>
151<td>Copyright &copy; 2007
152<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
153<td align=right><div align=right>Qt 3.3.8</div>
154</table></div></address></body>
155</html>
Note: See TracBrowser for help on using the repository browser.