You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
152 lines
6.9 KiB
152 lines
6.9 KiB
14 years ago
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||
|
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/sql/qdataview.cpp:51 -->
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||
|
<title>QDataView Class</title>
|
||
|
<style type="text/css"><!--
|
||
|
fn { margin-left: 1cm; text-indent: -1cm; }
|
||
|
a:link { color: #004faf; text-decoration: none }
|
||
|
a:visited { color: #672967; text-decoration: none }
|
||
|
body { background: #ffffff; color: black; }
|
||
|
--></style>
|
||
|
</head>
|
||
|
<body>
|
||
|
|
||
|
<table border="0" cellpadding="0" cellspacing="0" width="100%">
|
||
|
<tr bgcolor="#E5E5E5">
|
||
|
<td valign=center>
|
||
|
<a href="index.html">
|
||
|
<font color="#004faf">Home</font></a>
|
||
|
| <a href="classes.html">
|
||
|
<font color="#004faf">All Classes</font></a>
|
||
|
| <a href="mainclasses.html">
|
||
|
<font color="#004faf">Main Classes</font></a>
|
||
|
| <a href="annotated.html">
|
||
|
<font color="#004faf">Annotated</font></a>
|
||
|
| <a href="groups.html">
|
||
|
<font color="#004faf">Grouped Classes</font></a>
|
||
|
| <a href="functions.html">
|
||
|
<font color="#004faf">Functions</font></a>
|
||
|
</td>
|
||
|
<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>
|
||
|
|
||
|
<p>The QDataView class provides read-only SQL forms.
|
||
|
<a href="#details">More...</a>
|
||
|
<p><tt>#include <<a href="qdataview-h.html">qdataview.h</a>></tt>
|
||
|
<p>Inherits <a href="qwidget.html">QWidget</a>.
|
||
|
<p><a href="qdataview-members.html">List of all member functions.</a>
|
||
|
<h2>Public Members</h2>
|
||
|
<ul>
|
||
|
<li class=fn><a href="#QDataView"><b>QDataView</b></a> ( QWidget * parent = 0, const char * name = 0, WFlags fl = 0 )</li>
|
||
|
<li class=fn><a href="#~QDataView"><b>~QDataView</b></a> ()</li>
|
||
|
<li class=fn>virtual void <a href="#setForm"><b>setForm</b></a> ( QSqlForm * form )</li>
|
||
|
<li class=fn>QSqlForm * <a href="#form"><b>form</b></a> ()</li>
|
||
|
<li class=fn>virtual void <a href="#setRecord"><b>setRecord</b></a> ( QSqlRecord * record )</li>
|
||
|
<li class=fn>QSqlRecord * <a href="#record"><b>record</b></a> ()</li>
|
||
|
</ul>
|
||
|
<h2>Public Slots</h2>
|
||
|
<ul>
|
||
|
<li class=fn>virtual void <a href="#refresh"><b>refresh</b></a> ( QSqlRecord * buf )</li>
|
||
|
<li class=fn>virtual void <a href="#readFields"><b>readFields</b></a> ()</li>
|
||
|
<li class=fn>virtual void <a href="#writeFields"><b>writeFields</b></a> ()</li>
|
||
|
<li class=fn>virtual void <a href="#clearValues"><b>clearValues</b></a> ()</li>
|
||
|
</ul>
|
||
|
<hr><a name="details"></a><h2>Detailed Description</h2>
|
||
|
|
||
|
|
||
|
The QDataView class provides read-only SQL forms.
|
||
|
<p>
|
||
|
|
||
|
|
||
|
<p> This class provides a form which displays SQL field data from a
|
||
|
record buffer. Because QDataView does not support editing it uses
|
||
|
less resources than a <a href="qdatabrowser.html">QDataBrowser</a>. This class is well suited for
|
||
|
displaying read-only data from a SQL database.
|
||
|
<p> If you want a to present your data in an editable form use
|
||
|
QDataBrowser; if you want a table-based presentation of your data
|
||
|
use <a href="qdatatable.html">QDataTable</a>.
|
||
|
<p> The form is associated with the data view with <a href="#setForm">setForm</a>() and the
|
||
|
record is associated with <a href="#setRecord">setRecord</a>(). You can also pass a
|
||
|
<a href="qsqlrecord.html">QSqlRecord</a> to the <a href="#refresh">refresh</a>() function which will set the record to
|
||
|
the given record and read the record's fields into the form.
|
||
|
<p>See also <a href="database.html">Database Classes</a>.
|
||
|
|
||
|
<hr><h2>Member Function Documentation</h2>
|
||
|
<h3 class=fn><a name="QDataView"></a>QDataView::QDataView ( <a href="qwidget.html">QWidget</a> * parent = 0, const char * name = 0, WFlags fl = 0 )
|
||
|
</h3>
|
||
|
Constructs a data view which is a child of <em>parent</em>, called <em>name</em>, and with widget flags <em>fl</em>.
|
||
|
|
||
|
<h3 class=fn><a name="~QDataView"></a>QDataView::~QDataView ()
|
||
|
</h3>
|
||
|
Destroys the object and frees any allocated resources.
|
||
|
|
||
|
<h3 class=fn>void <a name="clearValues"></a>QDataView::clearValues ()<tt> [virtual slot]</tt>
|
||
|
</h3>
|
||
|
Clears the default form's values. If there is no default form,
|
||
|
nothing happens. All the values are set to their 'zero state',
|
||
|
e.g. 0 for numeric fields, "" for string fields.
|
||
|
|
||
|
<h3 class=fn><a href="qsqlform.html">QSqlForm</a> * <a name="form"></a>QDataView::form ()
|
||
|
</h3>
|
||
|
Returns the default form used by the data view, or 0 if there is
|
||
|
none.
|
||
|
<p> <p>See also <a href="#setForm">setForm</a>().
|
||
|
|
||
|
<h3 class=fn>void <a name="readFields"></a>QDataView::readFields ()<tt> [virtual slot]</tt>
|
||
|
</h3>
|
||
|
Causes the default form to read its fields from the record buffer.
|
||
|
If there is no default form, or no record, nothing happens.
|
||
|
<p> <p>See also <a href="#setForm">setForm</a>().
|
||
|
|
||
|
<h3 class=fn><a href="qsqlrecord.html">QSqlRecord</a> * <a name="record"></a>QDataView::record ()
|
||
|
</h3>
|
||
|
Returns the default record used by the data view, or 0 if there is
|
||
|
none.
|
||
|
<p> <p>See also <a href="#setRecord">setRecord</a>().
|
||
|
|
||
|
<h3 class=fn>void <a name="refresh"></a>QDataView::refresh ( <a href="qsqlrecord.html">QSqlRecord</a> * buf )<tt> [virtual slot]</tt>
|
||
|
</h3>
|
||
|
Causes the default form to display the contents of <em>buf</em>. If
|
||
|
there is no default form, nothing happens.The <em>buf</em> also becomes
|
||
|
the default record for all subsequent calls to <a href="#readFields">readFields</a>() and
|
||
|
writefields(). This slot is equivalant to calling:
|
||
|
<p> <pre>
|
||
|
myView.setRecord( record );
|
||
|
myView.readFields();
|
||
|
</pre>
|
||
|
|
||
|
<p> <p>See also <a href="#setRecord">setRecord</a>() and <a href="#readFields">readFields</a>().
|
||
|
|
||
|
<h3 class=fn>void <a name="setForm"></a>QDataView::setForm ( <a href="qsqlform.html">QSqlForm</a> * form )<tt> [virtual]</tt>
|
||
|
</h3>
|
||
|
Sets the form used by the data view to <em>form</em>. If a record has
|
||
|
already been assigned to the data view, the form will display that
|
||
|
record's data.
|
||
|
<p> <p>See also <a href="#form">form</a>().
|
||
|
|
||
|
<h3 class=fn>void <a name="setRecord"></a>QDataView::setRecord ( <a href="qsqlrecord.html">QSqlRecord</a> * record )<tt> [virtual]</tt>
|
||
|
</h3>
|
||
|
Sets the record used by the data view to <em>record</em>. If a form has
|
||
|
already been assigned to the data view, the form will display the
|
||
|
data from <em>record</em> in that form.
|
||
|
<p> <p>See also <a href="#record">record</a>().
|
||
|
|
||
|
<h3 class=fn>void <a name="writeFields"></a>QDataView::writeFields ()<tt> [virtual slot]</tt>
|
||
|
</h3>
|
||
|
Causes the default form to write its fields to the record buffer.
|
||
|
If there is no default form, or no record, nothing happens.
|
||
|
<p> <p>See also <a href="#setForm">setForm</a>().
|
||
|
|
||
|
<!-- eof -->
|
||
|
<hr><p>
|
||
|
This file is part of the <a href="index.html">Qt toolkit</a>.
|
||
|
Copyright © 1995-2007
|
||
|
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
||
|
<table width=100% cellspacing=0 border=0><tr>
|
||
|
<td>Copyright © 2007
|
||
|
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
||
|
<td align=right><div align=right>Qt 3.3.8</div>
|
||
|
</table></div></address></body>
|
||
|
</html>
|