source: trunk/doc/html/qdatabrowser.html@ 203

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

reference documentation added

File size: 45.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/qdatabrowser.cpp:56 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QDataBrowser 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>QDataBrowser Class Reference<br><small>[<a href="sql.html">sql module</a>]</small></h1>
33
34<p>The QDataBrowser class provides data manipulation and
35navigation for data entry forms.
36<a href="#details">More...</a>
37<p><tt>#include &lt;<a href="qdatabrowser-h.html">qdatabrowser.h</a>&gt;</tt>
38<p>Inherits <a href="qwidget.html">QWidget</a>.
39<p><a href="qdatabrowser-members.html">List of all member functions.</a>
40<h2>Public Members</h2>
41<ul>
42<li class=fn><a href="#QDataBrowser"><b>QDataBrowser</b></a> ( QWidget&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, WFlags&nbsp;fl = 0 )</li>
43<li class=fn><a href="#~QDataBrowser"><b>~QDataBrowser</b></a> ()</li>
44<li class=fn>enum <a href="#Boundary-enum"><b>Boundary</b></a> { Unknown, None, BeforeBeginning, Beginning, End, AfterEnd }</li>
45<li class=fn>Boundary <a href="#boundary"><b>boundary</b></a> ()</li>
46<li class=fn>void <a href="#setBoundaryChecking"><b>setBoundaryChecking</b></a> ( bool&nbsp;active )</li>
47<li class=fn>bool <a href="#boundaryChecking"><b>boundaryChecking</b></a> () const</li>
48<li class=fn>void <a href="#setSort-2"><b>setSort</b></a> ( const&nbsp;QSqlIndex&nbsp;&amp;&nbsp;sort )</li>
49<li class=fn>void <a href="#setSort"><b>setSort</b></a> ( const&nbsp;QStringList&nbsp;&amp;&nbsp;sort )</li>
50<li class=fn>QStringList <a href="#sort"><b>sort</b></a> () const</li>
51<li class=fn>void <a href="#setFilter"><b>setFilter</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;filter )</li>
52<li class=fn>QString <a href="#filter"><b>filter</b></a> () const</li>
53<li class=fn>virtual void <a href="#setSqlCursor"><b>setSqlCursor</b></a> ( QSqlCursor&nbsp;*&nbsp;cursor, bool&nbsp;autoDelete = FALSE )</li>
54<li class=fn>QSqlCursor * <a href="#sqlCursor"><b>sqlCursor</b></a> () const</li>
55<li class=fn>virtual void <a href="#setForm"><b>setForm</b></a> ( QSqlForm&nbsp;*&nbsp;form )</li>
56<li class=fn>QSqlForm * <a href="#form"><b>form</b></a> ()</li>
57<li class=fn>virtual void <a href="#setConfirmEdits"><b>setConfirmEdits</b></a> ( bool&nbsp;confirm )</li>
58<li class=fn>virtual void <a href="#setConfirmInsert"><b>setConfirmInsert</b></a> ( bool&nbsp;confirm )</li>
59<li class=fn>virtual void <a href="#setConfirmUpdate"><b>setConfirmUpdate</b></a> ( bool&nbsp;confirm )</li>
60<li class=fn>virtual void <a href="#setConfirmDelete"><b>setConfirmDelete</b></a> ( bool&nbsp;confirm )</li>
61<li class=fn>virtual void <a href="#setConfirmCancels"><b>setConfirmCancels</b></a> ( bool&nbsp;confirm )</li>
62<li class=fn>bool <a href="#confirmEdits"><b>confirmEdits</b></a> () const</li>
63<li class=fn>bool <a href="#confirmInsert"><b>confirmInsert</b></a> () const</li>
64<li class=fn>bool <a href="#confirmUpdate"><b>confirmUpdate</b></a> () const</li>
65<li class=fn>bool <a href="#confirmDelete"><b>confirmDelete</b></a> () const</li>
66<li class=fn>bool <a href="#confirmCancels"><b>confirmCancels</b></a> () const</li>
67<li class=fn>virtual void <a href="#setReadOnly"><b>setReadOnly</b></a> ( bool&nbsp;active )</li>
68<li class=fn>bool <a href="#isReadOnly"><b>isReadOnly</b></a> () const</li>
69<li class=fn>virtual void <a href="#setAutoEdit"><b>setAutoEdit</b></a> ( bool&nbsp;autoEdit )</li>
70<li class=fn>bool <a href="#autoEdit"><b>autoEdit</b></a> () const</li>
71<li class=fn>virtual bool <a href="#seek"><b>seek</b></a> ( int&nbsp;i, bool&nbsp;relative = FALSE )</li>
72</ul>
73<h2>Public Slots</h2>
74<ul>
75<li class=fn>virtual void <a href="#refresh"><b>refresh</b></a> ()</li>
76<li class=fn>virtual void <a href="#insert"><b>insert</b></a> ()</li>
77<li class=fn>virtual void <a href="#update"><b>update</b></a> ()</li>
78<li class=fn>virtual void <a href="#del"><b>del</b></a> ()</li>
79<li class=fn>virtual void <a href="#first"><b>first</b></a> ()</li>
80<li class=fn>virtual void <a href="#last"><b>last</b></a> ()</li>
81<li class=fn>virtual void <a href="#next"><b>next</b></a> ()</li>
82<li class=fn>virtual void <a href="#prev"><b>prev</b></a> ()</li>
83<li class=fn>virtual void <a href="#readFields"><b>readFields</b></a> ()</li>
84<li class=fn>virtual void <a href="#writeFields"><b>writeFields</b></a> ()</li>
85<li class=fn>virtual void <a href="#clearValues"><b>clearValues</b></a> ()</li>
86<li class=fn>void <a href="#updateBoundary"><b>updateBoundary</b></a> ()</li>
87</ul>
88<h2>Signals</h2>
89<ul>
90<li class=fn>void <a href="#firstRecordAvailable"><b>firstRecordAvailable</b></a> ( bool&nbsp;available )</li>
91<li class=fn>void <a href="#lastRecordAvailable"><b>lastRecordAvailable</b></a> ( bool&nbsp;available )</li>
92<li class=fn>void <a href="#nextRecordAvailable"><b>nextRecordAvailable</b></a> ( bool&nbsp;available )</li>
93<li class=fn>void <a href="#prevRecordAvailable"><b>prevRecordAvailable</b></a> ( bool&nbsp;available )</li>
94<li class=fn>void <a href="#currentChanged"><b>currentChanged</b></a> ( const&nbsp;QSqlRecord&nbsp;*&nbsp;record )</li>
95<li class=fn>void <a href="#primeInsert"><b>primeInsert</b></a> ( QSqlRecord&nbsp;*&nbsp;buf )</li>
96<li class=fn>void <a href="#primeUpdate"><b>primeUpdate</b></a> ( QSqlRecord&nbsp;*&nbsp;buf )</li>
97<li class=fn>void <a href="#primeDelete"><b>primeDelete</b></a> ( QSqlRecord&nbsp;*&nbsp;buf )</li>
98<li class=fn>void <a href="#beforeInsert"><b>beforeInsert</b></a> ( QSqlRecord&nbsp;*&nbsp;buf )</li>
99<li class=fn>void <a href="#beforeUpdate"><b>beforeUpdate</b></a> ( QSqlRecord&nbsp;*&nbsp;buf )</li>
100<li class=fn>void <a href="#beforeDelete"><b>beforeDelete</b></a> ( QSqlRecord&nbsp;*&nbsp;buf )</li>
101<li class=fn>void <a href="#cursorChanged"><b>cursorChanged</b></a> ( QSqlCursor::Mode&nbsp;mode )</li>
102</ul>
103<h2>Properties</h2>
104<ul>
105<li class=fn>bool <a href="#autoEdit-prop"><b>autoEdit</b></a>&nbsp;- whether the browser automatically applies edits</li>
106<li class=fn>bool <a href="#boundaryChecking-prop"><b>boundaryChecking</b></a>&nbsp;- whether boundary checking is active</li>
107<li class=fn>bool <a href="#confirmCancels-prop"><b>confirmCancels</b></a>&nbsp;- whether the browser confirms cancel operations</li>
108<li class=fn>bool <a href="#confirmDelete-prop"><b>confirmDelete</b></a>&nbsp;- whether the browser confirms deletions</li>
109<li class=fn>bool <a href="#confirmEdits-prop"><b>confirmEdits</b></a>&nbsp;- whether the browser confirms edits</li>
110<li class=fn>bool <a href="#confirmInsert-prop"><b>confirmInsert</b></a>&nbsp;- whether the data browser confirms insertions</li>
111<li class=fn>bool <a href="#confirmUpdate-prop"><b>confirmUpdate</b></a>&nbsp;- whether the browser confirms updates</li>
112<li class=fn>QString <a href="#filter-prop"><b>filter</b></a>&nbsp;- the data browser's filter</li>
113<li class=fn>bool <a href="#readOnly-prop"><b>readOnly</b></a>&nbsp;- whether the browser is read-only</li>
114<li class=fn>QStringList <a href="#sort-prop"><b>sort</b></a>&nbsp;- the data browser's sort</li>
115</ul>
116<h2>Protected Members</h2>
117<ul>
118<li class=fn>virtual bool <a href="#insertCurrent"><b>insertCurrent</b></a> ()</li>
119<li class=fn>virtual bool <a href="#updateCurrent"><b>updateCurrent</b></a> ()</li>
120<li class=fn>virtual bool <a href="#deleteCurrent"><b>deleteCurrent</b></a> ()</li>
121<li class=fn>virtual bool <a href="#currentEdited"><b>currentEdited</b></a> ()</li>
122<li class=fn>virtual QSql::Confirm <a href="#confirmEdit"><b>confirmEdit</b></a> ( QSql::Op&nbsp;m )</li>
123<li class=fn>virtual QSql::Confirm <a href="#confirmCancel"><b>confirmCancel</b></a> ( QSql::Op&nbsp;m )</li>
124<li class=fn>virtual void <a href="#handleError"><b>handleError</b></a> ( const&nbsp;QSqlError&nbsp;&amp;&nbsp;error )</li>
125</ul>
126<hr><a name="details"></a><h2>Detailed Description</h2>
127
128
129The QDataBrowser class provides data manipulation and
130navigation for data entry forms.
131<p>
132
133
134<p> A high-level API is provided for navigating through data records
135in a cursor, for inserting, updating and deleting records, and for
136refreshing data in the display.
137<p> If you want a read-only form to present database data use
138<a href="qdataview.html">QDataView</a>; if you want a table-based presentation of your data use
139<a href="qdatatable.html">QDataTable</a>.
140<p> A QDataBrowser is used to associate a dataset with a form in much
141the same way as a QDataTable associates a dataset with a table.
142Once the data browser has been constructed it can be associated
143with a dataset with <a href="#setSqlCursor">setSqlCursor</a>(), and with a form with
144<a href="#setForm">setForm</a>(). Boundary checking, sorting and filtering can be set
145with <a href="#setBoundaryChecking">setBoundaryChecking</a>(), <a href="#setSort">setSort</a>() and <a href="#setFilter">setFilter</a>(),
146respectively.
147<p> The <a href="#insertCurrent">insertCurrent</a>() function reads the fields from the default
148form into the default cursor and performs the insert. The
149<a href="#updateCurrent">updateCurrent</a>() and <a href="#deleteCurrent">deleteCurrent</a>() functions perform similarly to
150update and delete the current record respectively.
151<p> The user can be asked to confirm all edits with <a href="#setConfirmEdits">setConfirmEdits</a>().
152For more precise control use <a href="#setConfirmInsert">setConfirmInsert</a>(),
153<a href="#setConfirmUpdate">setConfirmUpdate</a>(), <a href="#setConfirmDelete">setConfirmDelete</a>() and <a href="#setConfirmCancels">setConfirmCancels</a>().
154Use <a href="#setAutoEdit">setAutoEdit</a>() to control the behaviour of the form when the
155user edits a record and then navigates.
156<p> The record set is navigated using <a href="#first">first</a>(), <a href="#next">next</a>(), <a href="#prev">prev</a>(), <a href="#last">last</a>()
157and <a href="#seek">seek</a>(). The form's display is updated with <a href="#refresh">refresh</a>(). When
158navigation takes place the <a href="#firstRecordAvailable">firstRecordAvailable</a>(),
159<a href="#lastRecordAvailable">lastRecordAvailable</a>(), <a href="#nextRecordAvailable">nextRecordAvailable</a>() and
160<a href="#prevRecordAvailable">prevRecordAvailable</a>() signals are emitted. When the cursor record
161is changed due to navigation the <a href="#cursorChanged">cursorChanged</a>() signal is
162emitted.
163<p> If you want finer control of the insert, update and delete
164processes then you can use the lower level functions to perform
165these operations as described below.
166<p> The form is populated with data from the database with
167<a href="#readFields">readFields</a>(). If the user is allowed to edit, (see <a href="#setReadOnly">setReadOnly</a>()),
168write the form's data back to the cursor's edit buffer with
169<a href="#writeFields">writeFields</a>(). You can clear the values in the form with
170<a href="#clearValues">clearValues</a>(). Editing is performed as follows:
171<ul>
172<li> <em>insert</em> When the data browser enters insertion mode it emits the
173<a href="#primeInsert">primeInsert</a>() signal which you can connect to, for example to
174pre-populate fields. Call writeFields() to write the user's edits to
175the cursor's edit buffer then call <a href="#insert">insert</a>() to insert the record
176into the database. The <a href="#beforeInsert">beforeInsert</a>() signal is emitted just before
177the cursor's edit buffer is inserted into the database; connect to
178this for example, to populate fields such as an auto-generated
179primary key.
180<li> <em>update</em> For updates the <a href="#primeUpdate">primeUpdate</a>() signal is emitted when
181the data browser enters update mode. After calling writeFields()
182call <a href="#update">update</a>() to update the record and connect to the <a href="#beforeUpdate">beforeUpdate</a>()
183signal to manipulate the user's data before the update takes place.
184<li> <em>delete</em> For deletion the <a href="#primeDelete">primeDelete</a>() signal is emitted when
185the data browser enters deletion mode. After calling <a href="#writeFields">writeFields</a>()
186call <a href="#del">del</a>() to delete the record and connect to the <a href="#beforeDelete">beforeDelete</a>()
187signal, for example to record an audit of the deleted record.
188</ul>
189<p> <p>See also <a href="database.html">Database Classes</a>.
190
191<hr><h2>Member Type Documentation</h2>
192<h3 class=fn><a name="Boundary-enum"></a>QDataBrowser::Boundary</h3>
193
194<p> This enum describes where the data browser is positioned.
195<ul>
196<li><tt>QDataBrowser::Unknown</tt> - the boundary cannot be determined (usually because
197there is no default cursor, or the default cursor is not active).
198<li><tt>QDataBrowser::None</tt> - the browser is not positioned on a boundary, but it is
199positioned on a record somewhere in the middle.
200<li><tt>QDataBrowser::BeforeBeginning</tt> - the browser is positioned before the
201first available record.
202<li><tt>QDataBrowser::Beginning</tt> - the browser is positioned at the first record.
203<li><tt>QDataBrowser::End</tt> - the browser is positioned at the last
204record.
205<li><tt>QDataBrowser::AfterEnd</tt> - the browser is positioned after the last
206available record.
207</ul>
208<hr><h2>Member Function Documentation</h2>
209<h3 class=fn><a name="QDataBrowser"></a>QDataBrowser::QDataBrowser ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, WFlags&nbsp;fl = 0 )
210</h3>
211Constructs a data browser which is a child of <em>parent</em>, with the
212name <em>name</em> and widget flags set to <em>fl</em>.
213
214<h3 class=fn><a name="~QDataBrowser"></a>QDataBrowser::~QDataBrowser ()
215</h3>
216Destroys the object and frees any allocated resources.
217
218<h3 class=fn>bool <a name="autoEdit"></a>QDataBrowser::autoEdit () const
219</h3><p>Returns TRUE if the browser automatically applies edits; otherwise returns FALSE.
220See the <a href="qdatabrowser.html#autoEdit-prop">"autoEdit"</a> property for details.
221<h3 class=fn>void <a name="beforeDelete"></a>QDataBrowser::beforeDelete ( <a href="qsqlrecord.html">QSqlRecord</a>&nbsp;*&nbsp;buf )<tt> [signal]</tt>
222</h3>
223
224<p> This signal is emitted just before the cursor's edit buffer is
225deleted from the database. The <em>buf</em> parameter points to the edit
226buffer being deleted. You might connect to this signal to capture
227some auditing information about the deletion.
228
229<h3 class=fn>void <a name="beforeInsert"></a>QDataBrowser::beforeInsert ( <a href="qsqlrecord.html">QSqlRecord</a>&nbsp;*&nbsp;buf )<tt> [signal]</tt>
230</h3>
231
232<p> This signal is emitted just before the cursor's edit buffer is
233inserted into the database. The <em>buf</em> parameter points to the
234edit buffer being inserted. You might connect to this signal to
235populate a generated primary key for example.
236
237<h3 class=fn>void <a name="beforeUpdate"></a>QDataBrowser::beforeUpdate ( <a href="qsqlrecord.html">QSqlRecord</a>&nbsp;*&nbsp;buf )<tt> [signal]</tt>
238</h3>
239
240<p> This signal is emitted just before the cursor's edit buffer is
241updated in the database. The <em>buf</em> parameter points to the edit
242buffer being updated. You might connect to this signal to capture
243some auditing information about the update.
244
245<h3 class=fn><a href="qdatabrowser.html#Boundary-enum">Boundary</a> <a name="boundary"></a>QDataBrowser::boundary ()
246</h3>
247Returns an enum indicating the boundary status of the browser.
248<p> This is achieved by moving the default cursor and checking the
249position, however the current default form values will not be
250altered. After checking for the boundary, the cursor is moved back
251to its former position. See <a href="#Boundary-enum">QDataBrowser::Boundary</a>.
252<p> <p>See also <a href="#Boundary-enum">Boundary</a>.
253
254<h3 class=fn>bool <a name="boundaryChecking"></a>QDataBrowser::boundaryChecking () const
255</h3><p>Returns TRUE if boundary checking is active; otherwise returns FALSE.
256See the <a href="qdatabrowser.html#boundaryChecking-prop">"boundaryChecking"</a> property for details.
257<h3 class=fn>void <a name="clearValues"></a>QDataBrowser::clearValues ()<tt> [virtual slot]</tt>
258</h3>
259Clears all the values in the form.
260<p> All the edit buffer field values are set to their 'zero state',
261e.g. 0 for numeric fields and "" for string fields. Then the
262widgets are updated using the property map. For example, a
263combobox that is property-mapped to integers would scroll to the
264first item. See the <a href="qsqlpropertymap.html">QSqlPropertyMap</a> constructor for the default
265mappings of widgets to properties.
266
267<h3 class=fn><a href="qsql.html#Confirm-enum">QSql::Confirm</a> <a name="confirmCancel"></a>QDataBrowser::confirmCancel ( <a href="qsql.html#Op-enum">QSql::Op</a>&nbsp;m )<tt> [virtual protected]</tt>
268</h3>
269Protected virtual function which returns a confirmation for
270cancelling an edit mode <em>m</em>. Derived classes can reimplement this
271function and provide their own confirmation dialog. The default
272implementation uses a message box which prompts the user to
273confirm the edit action.
274
275<h3 class=fn>bool <a name="confirmCancels"></a>QDataBrowser::confirmCancels () const
276</h3><p>Returns TRUE if the browser confirms cancel operations; otherwise returns FALSE.
277See the <a href="qdatabrowser.html#confirmCancels-prop">"confirmCancels"</a> property for details.
278<h3 class=fn>bool <a name="confirmDelete"></a>QDataBrowser::confirmDelete () const
279</h3><p>Returns TRUE if the browser confirms deletions; otherwise returns FALSE.
280See the <a href="qdatabrowser.html#confirmDelete-prop">"confirmDelete"</a> property for details.
281<h3 class=fn><a href="qsql.html#Confirm-enum">QSql::Confirm</a> <a name="confirmEdit"></a>QDataBrowser::confirmEdit ( <a href="qsql.html#Op-enum">QSql::Op</a>&nbsp;m )<tt> [virtual protected]</tt>
282</h3>
283Protected virtual function which returns a confirmation for an
284edit of mode <em>m</em>. Derived classes can reimplement this function
285and provide their own confirmation dialog. The default
286implementation uses a message box which prompts the user to
287confirm the edit action.
288
289<h3 class=fn>bool <a name="confirmEdits"></a>QDataBrowser::confirmEdits () const
290</h3><p>Returns TRUE if the browser confirms edits; otherwise returns FALSE.
291See the <a href="qdatabrowser.html#confirmEdits-prop">"confirmEdits"</a> property for details.
292<h3 class=fn>bool <a name="confirmInsert"></a>QDataBrowser::confirmInsert () const
293</h3><p>Returns TRUE if the data browser confirms insertions; otherwise returns FALSE.
294See the <a href="qdatabrowser.html#confirmInsert-prop">"confirmInsert"</a> property for details.
295<h3 class=fn>bool <a name="confirmUpdate"></a>QDataBrowser::confirmUpdate () const
296</h3><p>Returns TRUE if the browser confirms updates; otherwise returns FALSE.
297See the <a href="qdatabrowser.html#confirmUpdate-prop">"confirmUpdate"</a> property for details.
298<h3 class=fn>void <a name="currentChanged"></a>QDataBrowser::currentChanged ( const&nbsp;<a href="qsqlrecord.html">QSqlRecord</a>&nbsp;*&nbsp;record )<tt> [signal]</tt>
299</h3>
300
301<p> This signal is emitted whenever the current cursor position
302changes. The <em>record</em> parameter points to the contents of the
303current cursor's record.
304
305<h3 class=fn>bool <a name="currentEdited"></a>QDataBrowser::currentEdited ()<tt> [virtual protected]</tt>
306</h3>
307Returns TRUE if the form's edit buffer differs from the current
308cursor buffer; otherwise returns FALSE.
309
310<h3 class=fn>void <a name="cursorChanged"></a>QDataBrowser::cursorChanged ( <a href="qsqlcursor.html#Mode-enum">QSqlCursor::Mode</a>&nbsp;mode )<tt> [signal]</tt>
311</h3>
312
313<p> This signal is emitted whenever the cursor record was changed due
314to navigation. The <em>mode</em> parameter is the edit that just took
315place, e.g. Insert, Update or Delete. See <a href="qsqlcursor.html#Mode-enum">QSqlCursor::Mode</a>.
316
317<h3 class=fn>void <a name="del"></a>QDataBrowser::del ()<tt> [virtual slot]</tt>
318</h3>
319Performs a delete operation on the data browser's cursor. If there
320is no default cursor or no default form, nothing happens.
321<p> Otherwise, the following happens:
322<p> The current form's record is deleted from the database, providing
323that the data browser is not in insert mode. If the data browser
324is actively inserting a record (see <a href="#insert">insert</a>()), the insert action
325is canceled, and the browser navigates to the last valid record
326that was current. If there is an error, <a href="#handleError">handleError</a>() is called.
327
328<h3 class=fn>bool <a name="deleteCurrent"></a>QDataBrowser::deleteCurrent ()<tt> [virtual protected]</tt>
329</h3>
330Performs a delete on the default cursor using the values from the
331default form and updates the default form. If there is no default
332form or no default cursor, nothing happens. If the deletion was
333successful, the cursor is repositioned to the nearest record and
334TRUE is returned. The nearest record is the next record if there
335is one otherwise the previous record if there is one. If an error
336occurred during the deletion from the database, <a href="#handleError">handleError</a>() is
337called and FALSE is returned.
338<p> <p>See also <a href="qwidget.html#cursor-prop">cursor</a>, <a href="#form">form</a>(), and <a href="#handleError">handleError</a>().
339
340<h3 class=fn><a href="qstring.html">QString</a> <a name="filter"></a>QDataBrowser::filter () const
341</h3><p>Returns the data browser's filter.
342See the <a href="qdatabrowser.html#filter-prop">"filter"</a> property for details.
343<h3 class=fn>void <a name="first"></a>QDataBrowser::first ()<tt> [virtual slot]</tt>
344</h3>
345Moves the default cursor to the first record and refreshes the
346default form to display this record. If there is no default form
347or no default cursor, nothing happens. If the data browser
348successfully navigated to the first record, the default cursor is
349primed for update and the <a href="#primeUpdate">primeUpdate</a>() signal is emitted.
350<p> If the browser is already positioned on the first record nothing
351happens.
352<p>
353<h3 class=fn>void <a name="firstRecordAvailable"></a>QDataBrowser::firstRecordAvailable ( bool&nbsp;available )<tt> [signal]</tt>
354</h3>
355
356<p> This signal is emitted whenever the position of the cursor
357changes. The <em>available</em> parameter indicates whether or not the
358first record in the default cursor is available.
359
360<h3 class=fn><a href="qsqlform.html">QSqlForm</a>&nbsp;* <a name="form"></a>QDataBrowser::form ()
361</h3>
362Returns the data browser's default form or 0 if no form has been
363set.
364
365<h3 class=fn>void <a name="handleError"></a>QDataBrowser::handleError ( const&nbsp;<a href="qsqlerror.html">QSqlError</a>&nbsp;&amp;&nbsp;error )<tt> [virtual protected]</tt>
366</h3>
367Virtual function which handles the error <em>error</em>. The default
368implementation warns the user with a message box.
369
370<h3 class=fn>void <a name="insert"></a>QDataBrowser::insert ()<tt> [virtual slot]</tt>
371</h3>
372Performs an insert operation on the data browser's cursor. If
373there is no default cursor or no default form, nothing happens.
374<p> If auto-editing is on (see <a href="#setAutoEdit">setAutoEdit</a>()), the following happens:
375<p> <ul>
376<li> If the browser is already actively inserting a record,
377the current form's data is inserted into the database.
378<li> If the browser is not inserting a record, but the current record
379was changed by the user, the record is updated in the database with
380the current form's data (i.e. with the changes).
381</ul>
382<p> If there is an error handling any of the above auto-edit actions,
383<a href="#handleError">handleError</a>() is called and no insert or update is performed.
384<p> If no error occurred, or auto-editing is not enabled, the data browser
385begins actively inserting a record into the database by performing the
386following actions:
387<p> <ul>
388<li> The default cursor is primed for insert using <a href="qsqlcursor.html#primeInsert">QSqlCursor::primeInsert</a>().
389<li> The <a href="#primeInsert">primeInsert</a>() signal is emitted.
390<li> The form is updated with the values in the default cursor's.
391edit buffer so that the user can fill in the values to be inserted.
392</ul>
393<p>
394<h3 class=fn>bool <a name="insertCurrent"></a>QDataBrowser::insertCurrent ()<tt> [virtual protected]</tt>
395</h3>
396Reads the fields from the default form into the default cursor and
397performs an insert on the default cursor. If there is no default
398form or no default cursor, nothing happens. If an error occurred
399during the insert into the database, <a href="#handleError">handleError</a>() is called and
400FALSE is returned. If the insert was successfull, the cursor is
401refreshed and relocated to the newly inserted record, the
402<a href="#cursorChanged">cursorChanged</a>() signal is emitted, and TRUE is returned.
403<p> <p>See also <a href="#cursorChanged">cursorChanged</a>(), <a href="#sqlCursor">sqlCursor</a>(), <a href="#form">form</a>(), and <a href="#handleError">handleError</a>().
404
405<h3 class=fn>bool <a name="isReadOnly"></a>QDataBrowser::isReadOnly () const
406</h3><p>Returns TRUE if the browser is read-only; otherwise returns FALSE.
407See the <a href="qdatabrowser.html#readOnly-prop">"readOnly"</a> property for details.
408<h3 class=fn>void <a name="last"></a>QDataBrowser::last ()<tt> [virtual slot]</tt>
409</h3>
410Moves the default cursor to the last record and refreshes the
411default form to display this record. If there is no default form
412or no default cursor, nothing happens. If the data browser
413successfully navigated to the last record, the default cursor is
414primed for update and the <a href="#primeUpdate">primeUpdate</a>() signal is emitted.
415<p> If the browser is already positioned on the last record nothing
416happens.
417
418<h3 class=fn>void <a name="lastRecordAvailable"></a>QDataBrowser::lastRecordAvailable ( bool&nbsp;available )<tt> [signal]</tt>
419</h3>
420
421<p> This signal is emitted whenever the position of the cursor
422changes. The <em>available</em> parameter indicates whether or not the
423last record in the default cursor is available.
424
425<h3 class=fn>void <a name="next"></a>QDataBrowser::next ()<tt> [virtual slot]</tt>
426</h3>
427Moves the default cursor to the next record and refreshes the
428default form to display this record. If there is no default form
429or no default cursor, nothing happens. If the data browser
430successfully navigated to the next record, the default cursor is
431primed for update and the <a href="#primeUpdate">primeUpdate</a>() signal is emitted.
432<p> If the browser is positioned on the last record nothing happens.
433
434<h3 class=fn>void <a name="nextRecordAvailable"></a>QDataBrowser::nextRecordAvailable ( bool&nbsp;available )<tt> [signal]</tt>
435</h3>
436
437<p> This signal is emitted whenever the position of the cursor
438changes. The <em>available</em> parameter indicates whether or not the
439next record in the default cursor is available.
440
441<h3 class=fn>void <a name="prev"></a>QDataBrowser::prev ()<tt> [virtual slot]</tt>
442</h3>
443Moves the default cursor to the previous record and refreshes the
444default form to display this record. If there is no default form
445or no default cursor, nothing happens. If the data browser
446successfully navigated to the previous record, the default cursor
447is primed for update and the <a href="#primeUpdate">primeUpdate</a>() signal is emitted.
448<p> If the browser is positioned on the first record nothing happens.
449
450<h3 class=fn>void <a name="prevRecordAvailable"></a>QDataBrowser::prevRecordAvailable ( bool&nbsp;available )<tt> [signal]</tt>
451</h3>
452
453<p> This signal is emitted whenever the position of the cursor
454changes. The <em>available</em> parameter indicates whether or not the
455previous record in the default cursor is available.
456
457<h3 class=fn>void <a name="primeDelete"></a>QDataBrowser::primeDelete ( <a href="qsqlrecord.html">QSqlRecord</a>&nbsp;*&nbsp;buf )<tt> [signal]</tt>
458</h3>
459
460<p> This signal is emitted when the data browser enters deletion mode.
461The <em>buf</em> parameter points to the record buffer being deleted.
462(Note that <a href="qsqlcursor.html#primeDelete">QSqlCursor::primeDelete</a>() is <em>not</em> called on the
463default cursor, as this would corrupt values in the form.)
464Connect to this signal in order to, for example, save a copy of
465the deleted record for auditing purposes.
466<p> <p>See also <a href="#del">del</a>().
467
468<h3 class=fn>void <a name="primeInsert"></a>QDataBrowser::primeInsert ( <a href="qsqlrecord.html">QSqlRecord</a>&nbsp;*&nbsp;buf )<tt> [signal]</tt>
469</h3>
470
471<p> This signal is emitted when the data browser enters insertion
472mode. The <em>buf</em> parameter points to the record buffer that is to
473be inserted. Connect to this signal to, for example, <a href="primes.html#prime">prime</a> the
474record buffer with default data values, auto-numbered fields etc.
475(Note that <a href="qsqlcursor.html#primeInsert">QSqlCursor::primeInsert</a>() is <em>not</em> called on the
476default cursor, as this would corrupt values in the form.)
477<p> <p>See also <a href="#insert">insert</a>().
478
479<h3 class=fn>void <a name="primeUpdate"></a>QDataBrowser::primeUpdate ( <a href="qsqlrecord.html">QSqlRecord</a>&nbsp;*&nbsp;buf )<tt> [signal]</tt>
480</h3>
481
482<p> This signal is emitted when the data browser enters update mode.
483Note that during navigation (<a href="#first">first</a>(), <a href="#last">last</a>(), <a href="#next">next</a>(), <a href="#prev">prev</a>()),
484each record that is shown in the default form is primed for
485update. The <em>buf</em> parameter points to the record buffer being
486updated. (Note that <a href="qsqlcursor.html#primeUpdate">QSqlCursor::primeUpdate</a>() is <em>not</em> called on
487the default cursor, as this would corrupt values in the form.)
488Connect to this signal in order to, for example, keep track of
489which records have been updated, perhaps for auditing purposes.
490<p> <p>See also <a href="#update">update</a>().
491
492<h3 class=fn>void <a name="readFields"></a>QDataBrowser::readFields ()<tt> [virtual slot]</tt>
493</h3>
494Reads the fields from the default cursor's edit buffer and
495displays them in the form. If there is no default cursor or no
496default form, nothing happens.
497
498<h3 class=fn>void <a name="refresh"></a>QDataBrowser::refresh ()<tt> [virtual slot]</tt>
499</h3>
500Refreshes the data browser's data using the default cursor. The
501browser's current filter and sort are applied if they have been
502set.
503<p> <p>See also <a href="#filter-prop">filter</a> and <a href="#sort-prop">sort</a>.
504
505<h3 class=fn>bool <a name="seek"></a>QDataBrowser::seek ( int&nbsp;i, bool&nbsp;relative = FALSE )<tt> [virtual]</tt>
506</h3>
507Moves the default cursor to the record specified by the index <em>i</em>
508and refreshes the default form to display this record. If there is
509no default form or no default cursor, nothing happens. If <em>relative</em> is TRUE (the default is FALSE), the cursor is moved
510relative to its current position. If the data browser successfully
511navigated to the desired record, the default cursor is primed for
512update and the <a href="#primeUpdate">primeUpdate</a>() signal is emitted.
513<p> If the browser is already positioned on the desired record nothing
514happens.
515
516<h3 class=fn>void <a name="setAutoEdit"></a>QDataBrowser::setAutoEdit ( bool&nbsp;autoEdit )<tt> [virtual]</tt>
517</h3><p>Sets whether the browser automatically applies edits to <em>autoEdit</em>.
518See the <a href="qdatabrowser.html#autoEdit-prop">"autoEdit"</a> property for details.
519<h3 class=fn>void <a name="setBoundaryChecking"></a>QDataBrowser::setBoundaryChecking ( bool&nbsp;active )
520</h3><p>Sets whether boundary checking is active to <em>active</em>.
521See the <a href="qdatabrowser.html#boundaryChecking-prop">"boundaryChecking"</a> property for details.
522<h3 class=fn>void <a name="setConfirmCancels"></a>QDataBrowser::setConfirmCancels ( bool&nbsp;confirm )<tt> [virtual]</tt>
523</h3><p>Sets whether the browser confirms cancel operations to <em>confirm</em>.
524See the <a href="qdatabrowser.html#confirmCancels-prop">"confirmCancels"</a> property for details.
525<h3 class=fn>void <a name="setConfirmDelete"></a>QDataBrowser::setConfirmDelete ( bool&nbsp;confirm )<tt> [virtual]</tt>
526</h3><p>Sets whether the browser confirms deletions to <em>confirm</em>.
527See the <a href="qdatabrowser.html#confirmDelete-prop">"confirmDelete"</a> property for details.
528<h3 class=fn>void <a name="setConfirmEdits"></a>QDataBrowser::setConfirmEdits ( bool&nbsp;confirm )<tt> [virtual]</tt>
529</h3><p>Sets whether the browser confirms edits to <em>confirm</em>.
530See the <a href="qdatabrowser.html#confirmEdits-prop">"confirmEdits"</a> property for details.
531<h3 class=fn>void <a name="setConfirmInsert"></a>QDataBrowser::setConfirmInsert ( bool&nbsp;confirm )<tt> [virtual]</tt>
532</h3><p>Sets whether the data browser confirms insertions to <em>confirm</em>.
533See the <a href="qdatabrowser.html#confirmInsert-prop">"confirmInsert"</a> property for details.
534<h3 class=fn>void <a name="setConfirmUpdate"></a>QDataBrowser::setConfirmUpdate ( bool&nbsp;confirm )<tt> [virtual]</tt>
535</h3><p>Sets whether the browser confirms updates to <em>confirm</em>.
536See the <a href="qdatabrowser.html#confirmUpdate-prop">"confirmUpdate"</a> property for details.
537<h3 class=fn>void <a name="setFilter"></a>QDataBrowser::setFilter ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;filter )
538</h3><p>Sets the data browser's filter to <em>filter</em>.
539See the <a href="qdatabrowser.html#filter-prop">"filter"</a> property for details.
540<h3 class=fn>void <a name="setForm"></a>QDataBrowser::setForm ( <a href="qsqlform.html">QSqlForm</a>&nbsp;*&nbsp;form )<tt> [virtual]</tt>
541</h3>
542Sets the browser's default form to <em>form</em>. The cursor and all
543navigation and data manipulation functions that the browser
544provides become available to the <em>form</em>.
545
546<h3 class=fn>void <a name="setReadOnly"></a>QDataBrowser::setReadOnly ( bool&nbsp;active )<tt> [virtual]</tt>
547</h3><p>Sets whether the browser is read-only to <em>active</em>.
548See the <a href="qdatabrowser.html#readOnly-prop">"readOnly"</a> property for details.
549<h3 class=fn>void <a name="setSort"></a>QDataBrowser::setSort ( const&nbsp;<a href="qstringlist.html">QStringList</a>&nbsp;&amp;&nbsp;sort )
550</h3><p>Sets the data browser's sort to <em>sort</em>.
551See the <a href="qdatabrowser.html#sort-prop">"sort"</a> property for details.
552<h3 class=fn>void <a name="setSort-2"></a>QDataBrowser::setSort ( const&nbsp;<a href="qsqlindex.html">QSqlIndex</a>&nbsp;&amp;&nbsp;sort )
553</h3>
554This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
555<p> Sets the data browser's sort to the <a href="qsqlindex.html">QSqlIndex</a> <em>sort</em>. To apply
556the new sort, use <a href="#refresh">refresh</a>().
557<p>
558<h3 class=fn>void <a name="setSqlCursor"></a>QDataBrowser::setSqlCursor ( <a href="qsqlcursor.html">QSqlCursor</a>&nbsp;*&nbsp;cursor, bool&nbsp;autoDelete = FALSE )<tt> [virtual]</tt>
559</h3>
560Sets the default cursor used by the data browser to <em>cursor</em>. If
561<em>autoDelete</em> is TRUE (the default is FALSE), the data browser
562takes ownership of the <em>cursor</em> pointer, which will be deleted
563when the browser is destroyed, or when <a href="#setSqlCursor">setSqlCursor</a>() is called
564again. To activate the <em>cursor</em> use <a href="#refresh">refresh</a>(). The cursor's edit
565buffer is used in the default form to browse and edit records.
566<p> <p>See also <a href="#sqlCursor">sqlCursor</a>(), <a href="#form">form</a>(), and <a href="#setForm">setForm</a>().
567
568<h3 class=fn><a href="qstringlist.html">QStringList</a> <a name="sort"></a>QDataBrowser::sort () const
569</h3><p>Returns the data browser's sort.
570See the <a href="qdatabrowser.html#sort-prop">"sort"</a> property for details.
571<h3 class=fn><a href="qsqlcursor.html">QSqlCursor</a>&nbsp;* <a name="sqlCursor"></a>QDataBrowser::sqlCursor () const
572</h3>
573Returns the default cursor used for navigation, or 0 if there is
574no default cursor.
575<p> <p>See also <a href="#setSqlCursor">setSqlCursor</a>().
576
577<h3 class=fn>void <a name="update"></a>QDataBrowser::update ()<tt> [virtual slot]</tt>
578</h3>
579Performs an update operation on the data browser's cursor.
580<p> If there is no default cursor or no default form, nothing happens.
581Otherwise, the following happens:
582<p> If the data browser is actively inserting a record (see <a href="#insert">insert</a>()),
583that record is inserted into the database using <a href="#insertCurrent">insertCurrent</a>().
584Otherwise, the database is updated with the current form's data
585using <a href="#updateCurrent">updateCurrent</a>(). If there is an error handling either
586action, <a href="#handleError">handleError</a>() is called.
587
588<h3 class=fn>void <a name="updateBoundary"></a>QDataBrowser::updateBoundary ()<tt> [slot]</tt>
589</h3>
590If <a href="#boundaryChecking">boundaryChecking</a>() is TRUE, checks the boundary of the current
591default cursor and emits signals which indicate the position of
592the cursor.
593
594<h3 class=fn>bool <a name="updateCurrent"></a>QDataBrowser::updateCurrent ()<tt> [virtual protected]</tt>
595</h3>
596Reads the fields from the default form into the default cursor and
597performs an update on the default cursor. If there is no default
598form or no default cursor, nothing happens. If an error occurred
599during the update on the database, <a href="#handleError">handleError</a>() is called and
600FALSE is returned. If the update was successfull, the cursor is
601refreshed and relocated to the updated record, the <a href="#cursorChanged">cursorChanged</a>()
602signal is emitted, and TRUE is returned.
603<p> <p>See also <a href="qwidget.html#cursor-prop">cursor</a>, <a href="#form">form</a>(), and <a href="#handleError">handleError</a>().
604
605<h3 class=fn>void <a name="writeFields"></a>QDataBrowser::writeFields ()<tt> [virtual slot]</tt>
606</h3>
607Writes the form's data to the default cursor's edit buffer. If
608there is no default cursor or no default form, nothing happens.
609
610<hr><h2>Property Documentation</h2>
611<h3 class=fn>bool <a name="autoEdit-prop"></a>autoEdit</h3>
612<p>This property holds whether the browser automatically applies edits.
613<p>The default value for this property is TRUE. When the user begins
614an insertion or an update on a form there are two possible
615outcomes when they navigate to another record:
616<p> <ul>
617<li> the insert or update is is performed -- this occurs if autoEdit is TRUE
618<li> the insert or update is discarded -- this occurs if autoEdit is FALSE
619</ul>
620
621<p>Set this property's value with <a href="#setAutoEdit">setAutoEdit</a>() and get this property's value with <a href="#autoEdit">autoEdit</a>().
622<h3 class=fn>bool <a name="boundaryChecking-prop"></a>boundaryChecking</h3>
623<p>This property holds whether boundary checking is active.
624<p>When boundary checking is active (the default), signals are
625emitted indicating the current position of the default cursor.
626<p> <p>See also <a href="#boundary">boundary</a>().
627
628<p>Set this property's value with <a href="#setBoundaryChecking">setBoundaryChecking</a>() and get this property's value with <a href="#boundaryChecking">boundaryChecking</a>().
629<h3 class=fn>bool <a name="confirmCancels-prop"></a>confirmCancels</h3>
630<p>This property holds whether the browser confirms cancel operations.
631<p>If this property is TRUE, all cancels must be confirmed by the
632user through a message box (this behavior can be changed by
633overriding the <a href="#confirmCancel">confirmCancel</a>() function), otherwise all cancels
634occur immediately. The default is FALSE.
635<p> <p>See also <a href="#confirmEdits-prop">confirmEdits</a> and <a href="#confirmCancel">confirmCancel</a>().
636
637<p>Set this property's value with <a href="#setConfirmCancels">setConfirmCancels</a>() and get this property's value with <a href="#confirmCancels">confirmCancels</a>().
638<h3 class=fn>bool <a name="confirmDelete-prop"></a>confirmDelete</h3>
639<p>This property holds whether the browser confirms deletions.
640<p>If this property is TRUE, the browser confirms deletions,
641otherwise deletions happen immediately.
642<p> <p>See also <a href="#confirmCancels-prop">confirmCancels</a>, <a href="#confirmEdits-prop">confirmEdits</a>, <a href="#confirmUpdate-prop">confirmUpdate</a>, <a href="#confirmInsert-prop">confirmInsert</a>, and <a href="#confirmEdit">confirmEdit</a>().
643
644<p>Set this property's value with <a href="#setConfirmDelete">setConfirmDelete</a>() and get this property's value with <a href="#confirmDelete">confirmDelete</a>().
645<h3 class=fn>bool <a name="confirmEdits-prop"></a>confirmEdits</h3>
646<p>This property holds whether the browser confirms edits.
647<p>If this property is TRUE, the browser confirms all edit operations
648(insertions, updates and deletions), otherwise all edit operations
649happen immediately. Confirmation is achieved by presenting the
650user with a message box -- this behavior can be changed by
651reimplementing the <a href="#confirmEdit">confirmEdit</a>() function,
652<p> <p>See also <a href="#confirmEdit">confirmEdit</a>(), <a href="#confirmCancels-prop">confirmCancels</a>, <a href="#confirmInsert-prop">confirmInsert</a>, <a href="#confirmUpdate-prop">confirmUpdate</a>, and <a href="#confirmDelete-prop">confirmDelete</a>.
653
654<p>Set this property's value with <a href="#setConfirmEdits">setConfirmEdits</a>() and get this property's value with <a href="#confirmEdits">confirmEdits</a>().
655<h3 class=fn>bool <a name="confirmInsert-prop"></a>confirmInsert</h3>
656<p>This property holds whether the data browser confirms insertions.
657<p>If this property is TRUE, the browser confirms insertions,
658otherwise insertions happen immediately.
659<p> <p>See also <a href="#confirmCancels-prop">confirmCancels</a>, <a href="#confirmEdits-prop">confirmEdits</a>, <a href="#confirmUpdate-prop">confirmUpdate</a>, <a href="#confirmDelete-prop">confirmDelete</a>, and <a href="#confirmEdit">confirmEdit</a>().
660
661<p>Set this property's value with <a href="#setConfirmInsert">setConfirmInsert</a>() and get this property's value with <a href="#confirmInsert">confirmInsert</a>().
662<h3 class=fn>bool <a name="confirmUpdate-prop"></a>confirmUpdate</h3>
663<p>This property holds whether the browser confirms updates.
664<p>If this property is TRUE, the browser confirms updates, otherwise
665updates happen immediately.
666<p> <p>See also <a href="#confirmCancels-prop">confirmCancels</a>, <a href="#confirmEdits-prop">confirmEdits</a>, <a href="#confirmInsert-prop">confirmInsert</a>, <a href="#confirmDelete-prop">confirmDelete</a>, and <a href="#confirmEdit">confirmEdit</a>().
667
668<p>Set this property's value with <a href="#setConfirmUpdate">setConfirmUpdate</a>() and get this property's value with <a href="#confirmUpdate">confirmUpdate</a>().
669<h3 class=fn><a href="qstring.html">QString</a> <a name="filter-prop"></a>filter</h3>
670<p>This property holds the data browser's filter.
671<p>The filter applies to the data shown in the browser. Call
672<a href="#refresh">refresh</a>() to apply the new filter. A filter is a string containing
673a SQL WHERE clause without the WHERE keyword, e.g. "id>1000",
674"name LIKE 'A%'", etc.
675<p> There is no default filter.
676<p> <p>See also <a href="#sort-prop">sort</a>.
677
678<p>Set this property's value with <a href="#setFilter">setFilter</a>() and get this property's value with <a href="#filter">filter</a>().
679<h3 class=fn>bool <a name="readOnly-prop"></a>readOnly</h3>
680<p>This property holds whether the browser is read-only.
681<p>The default is FALSE, i.e. data can be edited. If the data browser
682is read-only, no database edits will be allowed.
683
684<p>Set this property's value with <a href="#setReadOnly">setReadOnly</a>() and get this property's value with <a href="#isReadOnly">isReadOnly</a>().
685<h3 class=fn><a href="qstringlist.html">QStringList</a> <a name="sort-prop"></a>sort</h3>
686<p>This property holds the data browser's sort.
687<p>The data browser's sort affects the order in which records are
688viewed in the browser. Call <a href="#refresh">refresh</a>() to apply the new sort.
689<p> When retrieving the sort property, a string list is returned in
690the form 'fieldname order', e.g. 'id ASC', 'surname DESC'.
691<p> There is no default sort.
692<p> Note that if you want to iterate over the list, you should iterate
693over a copy, e.g.
694<pre>
695 <a href="qstringlist.html">QStringList</a> list = myDataBrowser.sort();
696 QStringList::Iterator it = list.<a href="qvaluelist.html#begin">begin</a>();
697 while( it != list.<a href="qvaluelist.html#end">end</a>() ) {
698 myProcessing( *it );
699 ++it;
700 }
701 </pre>
702
703
704<p>Set this property's value with <a href="#setSort">setSort</a>() and get this property's value with <a href="#sort">sort</a>().
705<!-- eof -->
706<hr><p>
707This file is part of the <a href="index.html">Qt toolkit</a>.
708Copyright &copy; 1995-2007
709<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
710<table width=100% cellspacing=0 border=0><tr>
711<td>Copyright &copy; 2007
712<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
713<td align=right><div align=right>Qt 3.3.8</div>
714</table></div></address></body>
715</html>
Note: See TracBrowser for help on using the repository browser.