source: trunk/doc/html/qdataview.html

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

reference documentation added

File size: 7.1 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/qdataview.cpp:51 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QDataView 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>QDataView Class Reference<br><small>[<a href="sql.html">sql module</a>]</small></h1>
33
34<p>The QDataView class provides read-only SQL forms.
35<a href="#details">More...</a>
36<p><tt>#include &lt;<a href="qdataview-h.html">qdataview.h</a>&gt;</tt>
37<p>Inherits <a href="qwidget.html">QWidget</a>.
38<p><a href="qdataview-members.html">List of all member functions.</a>
39<h2>Public Members</h2>
40<ul>
41<li class=fn><a href="#QDataView"><b>QDataView</b></a> ( QWidget&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, WFlags&nbsp;fl = 0 )</li>
42<li class=fn><a href="#~QDataView"><b>~QDataView</b></a> ()</li>
43<li class=fn>virtual void <a href="#setForm"><b>setForm</b></a> ( QSqlForm&nbsp;*&nbsp;form )</li>
44<li class=fn>QSqlForm * <a href="#form"><b>form</b></a> ()</li>
45<li class=fn>virtual void <a href="#setRecord"><b>setRecord</b></a> ( QSqlRecord&nbsp;*&nbsp;record )</li>
46<li class=fn>QSqlRecord * <a href="#record"><b>record</b></a> ()</li>
47</ul>
48<h2>Public Slots</h2>
49<ul>
50<li class=fn>virtual void <a href="#refresh"><b>refresh</b></a> ( QSqlRecord&nbsp;*&nbsp;buf )</li>
51<li class=fn>virtual void <a href="#readFields"><b>readFields</b></a> ()</li>
52<li class=fn>virtual void <a href="#writeFields"><b>writeFields</b></a> ()</li>
53<li class=fn>virtual void <a href="#clearValues"><b>clearValues</b></a> ()</li>
54</ul>
55<hr><a name="details"></a><h2>Detailed Description</h2>
56
57
58The QDataView class provides read-only SQL forms.
59<p>
60
61
62<p> This class provides a form which displays SQL field data from a
63record buffer. Because QDataView does not support editing it uses
64less resources than a <a href="qdatabrowser.html">QDataBrowser</a>. This class is well suited for
65displaying read-only data from a SQL database.
66<p> If you want a to present your data in an editable form use
67QDataBrowser; if you want a table-based presentation of your data
68use <a href="qdatatable.html">QDataTable</a>.
69<p> The form is associated with the data view with <a href="#setForm">setForm</a>() and the
70record is associated with <a href="#setRecord">setRecord</a>(). You can also pass a
71<a href="qsqlrecord.html">QSqlRecord</a> to the <a href="#refresh">refresh</a>() function which will set the record to
72the given record and read the record's fields into the form.
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="QDataView"></a>QDataView::QDataView ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0, WFlags&nbsp;fl = 0 )
77</h3>
78Constructs a data view which is a child of <em>parent</em>, called <em>name</em>, and with widget flags <em>fl</em>.
79
80<h3 class=fn><a name="~QDataView"></a>QDataView::~QDataView ()
81</h3>
82Destroys the object and frees any allocated resources.
83
84<h3 class=fn>void <a name="clearValues"></a>QDataView::clearValues ()<tt> [virtual slot]</tt>
85</h3>
86Clears the default form's values. If there is no default form,
87nothing happens. All the values are set to their 'zero state',
88e.g. 0 for numeric fields, "" for string fields.
89
90<h3 class=fn><a href="qsqlform.html">QSqlForm</a>&nbsp;* <a name="form"></a>QDataView::form ()
91</h3>
92Returns the default form used by the data view, or 0 if there is
93none.
94<p> <p>See also <a href="#setForm">setForm</a>().
95
96<h3 class=fn>void <a name="readFields"></a>QDataView::readFields ()<tt> [virtual slot]</tt>
97</h3>
98Causes the default form to read its fields from the record buffer.
99If there is no default form, or no record, nothing happens.
100<p> <p>See also <a href="#setForm">setForm</a>().
101
102<h3 class=fn><a href="qsqlrecord.html">QSqlRecord</a>&nbsp;* <a name="record"></a>QDataView::record ()
103</h3>
104Returns the default record used by the data view, or 0 if there is
105none.
106<p> <p>See also <a href="#setRecord">setRecord</a>().
107
108<h3 class=fn>void <a name="refresh"></a>QDataView::refresh ( <a href="qsqlrecord.html">QSqlRecord</a>&nbsp;*&nbsp;buf )<tt> [virtual slot]</tt>
109</h3>
110Causes the default form to display the contents of <em>buf</em>. If
111there is no default form, nothing happens.The <em>buf</em> also becomes
112the default record for all subsequent calls to <a href="#readFields">readFields</a>() and
113writefields(). This slot is equivalant to calling:
114<p> <pre>
115 myView.setRecord( record );
116 myView.readFields();
117 </pre>
118
119<p> <p>See also <a href="#setRecord">setRecord</a>() and <a href="#readFields">readFields</a>().
120
121<h3 class=fn>void <a name="setForm"></a>QDataView::setForm ( <a href="qsqlform.html">QSqlForm</a>&nbsp;*&nbsp;form )<tt> [virtual]</tt>
122</h3>
123Sets the form used by the data view to <em>form</em>. If a record has
124already been assigned to the data view, the form will display that
125record's data.
126<p> <p>See also <a href="#form">form</a>().
127
128<h3 class=fn>void <a name="setRecord"></a>QDataView::setRecord ( <a href="qsqlrecord.html">QSqlRecord</a>&nbsp;*&nbsp;record )<tt> [virtual]</tt>
129</h3>
130Sets the record used by the data view to <em>record</em>. If a form has
131already been assigned to the data view, the form will display the
132data from <em>record</em> in that form.
133<p> <p>See also <a href="#record">record</a>().
134
135<h3 class=fn>void <a name="writeFields"></a>QDataView::writeFields ()<tt> [virtual slot]</tt>
136</h3>
137Causes the default form to write its fields to the record buffer.
138If there is no default form, or no record, nothing happens.
139<p> <p>See also <a href="#setForm">setForm</a>().
140
141<!-- eof -->
142<hr><p>
143This file is part of the <a href="index.html">Qt toolkit</a>.
144Copyright &copy; 1995-2007
145<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
146<table width=100% cellspacing=0 border=0><tr>
147<td>Copyright &copy; 2007
148<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
149<td align=right><div align=right>Qt 3.3.8</div>
150</table></div></address></body>
151</html>
Note: See TracBrowser for help on using the repository browser.