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"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { 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 Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main 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 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
|
---|
35 | describe QSqlCursor and QSqlDatabase indexes.
|
---|
36 | <a href="#details">More...</a>
|
---|
37 | <p><tt>#include <<a href="qsqlindex-h.html">qsqlindex.h</a>></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 QString & cursorname = QString::null, const QString & name = QString::null )</li>
|
---|
43 | <li class=fn><a href="#QSqlIndex-2"><b>QSqlIndex</b></a> ( const QSqlIndex & other )</li>
|
---|
44 | <li class=fn><a href="#~QSqlIndex"><b>~QSqlIndex</b></a> ()</li>
|
---|
45 | <li class=fn>QSqlIndex & <a href="#operator-eq"><b>operator=</b></a> ( const QSqlIndex & other )</li>
|
---|
46 | <li class=fn>virtual void <a href="#setCursorName"><b>setCursorName</b></a> ( const QString & 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 QString & 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 QSqlField & field )</li>
|
---|
51 | <li class=fn>virtual void <a href="#append-2"><b>append</b></a> ( const QSqlField & field, bool desc )</li>
|
---|
52 | <li class=fn>bool <a href="#isDescending"><b>isDescending</b></a> ( int i ) const</li>
|
---|
53 | <li class=fn>virtual void <a href="#setDescending"><b>setDescending</b></a> ( int i, bool 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 QStringList & l, const QSqlCursor * cursor )</li>
|
---|
58 | </ul>
|
---|
59 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
60 |
|
---|
61 |
|
---|
62 | The QSqlIndex class provides functions to manipulate and
|
---|
63 | describe <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
|
---|
67 | QSqlDatabase indexes. An index refers to a single table or view
|
---|
68 | in a database. Information about the fields that comprise the
|
---|
69 | index can be used to generate SQL statements, or to affect the
|
---|
70 | behavior of a <a href="qsqlcursor.html">QSqlCursor</a> object.
|
---|
71 | <p> Normally, QSqlIndex objects are created by <a href="qsqldatabase.html">QSqlDatabase</a> or
|
---|
72 | QSqlCursor.
|
---|
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 <a href="qstring.html">QString</a> & cursorname = QString::null, const <a href="qstring.html">QString</a> & name = QString::null )
|
---|
77 | </h3>
|
---|
78 | Constructs an empty index using the cursor name <em>cursorname</em> and
|
---|
79 | index name <em>name</em>.
|
---|
80 |
|
---|
81 | <h3 class=fn><a name="QSqlIndex-2"></a>QSqlIndex::QSqlIndex ( const <a href="qsqlindex.html">QSqlIndex</a> & other )
|
---|
82 | </h3>
|
---|
83 | Constructs a copy of <em>other</em>.
|
---|
84 |
|
---|
85 | <h3 class=fn><a name="~QSqlIndex"></a>QSqlIndex::~QSqlIndex ()
|
---|
86 | </h3>
|
---|
87 | Destroys the object and frees any allocated resources.
|
---|
88 |
|
---|
89 | <h3 class=fn>void <a name="append"></a>QSqlIndex::append ( const <a href="qsqlfield.html">QSqlField</a> & field )<tt> [virtual]</tt>
|
---|
90 | </h3>
|
---|
91 | Appends the field <em>field</em> to the list of indexed fields. The
|
---|
92 | field 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 <a href="qsqlfield.html">QSqlField</a> & field, bool desc )<tt> [virtual]</tt>
|
---|
96 | </h3>
|
---|
97 | This 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
|
---|
99 | field is appended with an ascending sort order, unless <em>desc</em> is
|
---|
100 | TRUE.
|
---|
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 <a href="qstringlist.html">QStringList</a> & l, const <a href="qsqlcursor.html">QSqlCursor</a> * cursor )<tt> [static]</tt>
|
---|
108 | </h3>
|
---|
109 | Returns an index based on the field descriptions in <em>l</em> and the
|
---|
110 | cursor <em>cursor</em>. The field descriptions should be in the same
|
---|
111 | format that <a href="qsqlrecord.html#toStringList">toStringList</a>() produces, for example, a surname field
|
---|
112 | in 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 i ) const
|
---|
117 | </h3>
|
---|
118 | Returns TRUE if field <em>i</em> in the index is sorted in descending
|
---|
119 | order; 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> & <a name="operator-eq"></a>QSqlIndex::operator= ( const <a href="qsqlindex.html">QSqlIndex</a> & other )
|
---|
127 | </h3>
|
---|
128 | Sets the index equal to <em>other</em>.
|
---|
129 |
|
---|
130 | <h3 class=fn>void <a name="setCursorName"></a>QSqlIndex::setCursorName ( const <a href="qstring.html">QString</a> & cursorName )<tt> [virtual]</tt>
|
---|
131 | </h3>
|
---|
132 | Sets 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 i, bool desc )<tt> [virtual]</tt>
|
---|
136 | </h3>
|
---|
137 | If <em>desc</em> is TRUE, field <em>i</em> is sorted in descending order.
|
---|
138 | Otherwise, field <em>i</em> is sorted in ascending order (the default).
|
---|
139 | If the field does not exist, nothing happens.
|
---|
140 |
|
---|
141 | <h3 class=fn>void <a name="setName"></a>QSqlIndex::setName ( const <a href="qstring.html">QString</a> & name )<tt> [virtual]</tt>
|
---|
142 | </h3>
|
---|
143 | Sets the name of the index to <em>name</em>.
|
---|
144 |
|
---|
145 | <!-- eof -->
|
---|
146 | <hr><p>
|
---|
147 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
148 | Copyright © 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 © 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>
|
---|