<!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>TQDataView 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>TQDataView Class Reference<br><small>[<a href="sql.html">sql module</a>]</small></h1> <p>The TQDataView class provides read-only SQL forms. <a href="#details">More...</a> <p><tt>#include <<a href="qdataview-h.html">ntqdataview.h</a>></tt> <p>Inherits <a href="ntqwidget.html">TQWidget</a>. <p><a href="qdataview-members.html">List of all member functions.</a> <h2>Public Members</h2> <ul> <li class=fn><a href="#TQDataView"><b>TQDataView</b></a> ( TQWidget * parent = 0, const char * name = 0, WFlags fl = 0 )</li> <li class=fn><a href="#~TQDataView"><b>~TQDataView</b></a> ()</li> <li class=fn>virtual void <a href="#setForm"><b>setForm</b></a> ( TQSqlForm * form )</li> <li class=fn>TQSqlForm * <a href="#form"><b>form</b></a> ()</li> <li class=fn>virtual void <a href="#setRecord"><b>setRecord</b></a> ( TQSqlRecord * record )</li> <li class=fn>TQSqlRecord * <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> ( TQSqlRecord * 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 TQDataView class provides read-only SQL forms. <p> <p> This class provides a form which displays SQL field data from a record buffer. Because TQDataView does not support editing it uses less resources than a <a href="ntqdatabrowser.html">TQDataBrowser</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 TQDataBrowser; if you want a table-based presentation of your data use <a href="ntqdatatable.html">TQDataTable</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="ntqsqlrecord.html">TQSqlRecord</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="TQDataView"></a>TQDataView::TQDataView ( <a href="ntqwidget.html">TQWidget</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="~TQDataView"></a>TQDataView::~TQDataView () </h3> Destroys the object and frees any allocated resources. <h3 class=fn>void <a name="clearValues"></a>TQDataView::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="ntqsqlform.html">TQSqlForm</a> * <a name="form"></a>TQDataView::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>TQDataView::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="ntqsqlrecord.html">TQSqlRecord</a> * <a name="record"></a>TQDataView::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>TQDataView::refresh ( <a href="ntqsqlrecord.html">TQSqlRecord</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>TQDataView::setForm ( <a href="ntqsqlform.html">TQSqlForm</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>TQDataView::setRecord ( <a href="ntqsqlrecord.html">TQSqlRecord</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>TQDataView::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">TQt 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>TQt 3.3.8</div> </table></div></address></body> </html>