~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/q3sqlfieldinfo.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/doc/src/q3sqlfieldinfo.qdoc -->
 
6
<head>
 
7
    <title>Qt 4.0: Q3SqlFieldInfo Class Reference</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">Q3SqlFieldInfo Class Reference</h1>
 
21
<p>The Q3SqlFieldInfo class stores meta data associated with a SQL field. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;Q3SqlFieldInfo&gt;</pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See the <a href="porting4.html">Porting Guide</a> for more information.</p>
 
23
<p>Part of the <a href="qt3support.html">Qt3Support</a> module.</p>
 
24
<ul>
 
25
<li><a href="q3sqlfieldinfo-members.html">List of all members, including inherited members</a></li>
 
26
</ul>
 
27
<a name="public-functions"></a>
 
28
<h3>Public Functions</h3>
 
29
<ul>
 
30
<li><div class="fn"/><b><a href="q3sqlfieldinfo.html#Q3SqlFieldInfo">Q3SqlFieldInfo</a></b> ( const QString &amp; <i>name</i> = QString(), QVariant::Type <i>typ</i> = QVariant::Invalid, int <i>required</i> = -1, int <i>len</i> = -1, int <i>prec</i> = -1, const QVariant &amp; <i>defValue</i> = QVariant(), int <i>typeID</i> = 0, bool <i>generated</i> = true, bool <i>trim</i> = false, bool <i>calculated</i> = false )</li>
 
31
<li><div class="fn"/><b><a href="q3sqlfieldinfo.html#Q3SqlFieldInfo-2">Q3SqlFieldInfo</a></b> ( const QSqlField &amp; <i>other</i> )</li>
 
32
<li><div class="fn"/>virtual <b><a href="q3sqlfieldinfo.html#dtor.Q3SqlFieldInfo">~Q3SqlFieldInfo</a></b> ()</li>
 
33
<li><div class="fn"/>QVariant <b><a href="q3sqlfieldinfo.html#defaultValue">defaultValue</a></b> () const</li>
 
34
<li><div class="fn"/>bool <b><a href="q3sqlfieldinfo.html#isCalculated">isCalculated</a></b> () const</li>
 
35
<li><div class="fn"/>bool <b><a href="q3sqlfieldinfo.html#isGenerated">isGenerated</a></b> () const</li>
 
36
<li><div class="fn"/>int <b><a href="q3sqlfieldinfo.html#isRequired">isRequired</a></b> () const</li>
 
37
<li><div class="fn"/>bool <b><a href="q3sqlfieldinfo.html#isTrim">isTrim</a></b> () const</li>
 
38
<li><div class="fn"/>int <b><a href="q3sqlfieldinfo.html#length">length</a></b> () const</li>
 
39
<li><div class="fn"/>QString <b><a href="q3sqlfieldinfo.html#name">name</a></b> () const</li>
 
40
<li><div class="fn"/>int <b><a href="q3sqlfieldinfo.html#precision">precision</a></b> () const</li>
 
41
<li><div class="fn"/>virtual void <b><a href="q3sqlfieldinfo.html#setCalculated">setCalculated</a></b> ( bool <i>calculated</i> )</li>
 
42
<li><div class="fn"/>virtual void <b><a href="q3sqlfieldinfo.html#setGenerated">setGenerated</a></b> ( bool <i>generated</i> )</li>
 
43
<li><div class="fn"/>virtual void <b><a href="q3sqlfieldinfo.html#setTrim">setTrim</a></b> ( bool <i>trim</i> )</li>
 
44
<li><div class="fn"/>QSqlField <b><a href="q3sqlfieldinfo.html#toField">toField</a></b> () const</li>
 
45
<li><div class="fn"/>QVariant::Type <b><a href="q3sqlfieldinfo.html#type">type</a></b> () const</li>
 
46
<li><div class="fn"/>int <b><a href="q3sqlfieldinfo.html#typeID">typeID</a></b> () const</li>
 
47
<li><div class="fn"/>bool <b><a href="q3sqlfieldinfo.html#operator-eq-eq">operator==</a></b> ( const Q3SqlFieldInfo &amp; <i>other</i> ) const</li>
 
48
</ul>
 
49
<a name="details"></a>
 
50
<hr />
 
51
<h2>Detailed Description</h2>
 
52
<p>The Q3SqlFieldInfo class stores meta data associated with a SQL field.</p>
 
53
<p>Q3SqlFieldInfo objects only store meta data; field values are stored in <a href="qsqlfield.html">QSqlField</a> objects.</p>
 
54
<p>All values must be set in the constructor, and may be retrieved using <a href="q3sqlfieldinfo.html#isRequired">isRequired</a>(), <a href="q3sqlfieldinfo.html#type">type</a>(), <a href="q3sqlfieldinfo.html#length">length</a>(), <a href="q3sqlfieldinfo.html#precision">precision</a>(), <a href="q3sqlfieldinfo.html#defaultValue">defaultValue</a>(), <a href="q3sqlfieldinfo.html#name">name</a>(), <a href="q3sqlfieldinfo.html#isGenerated">isGenerated</a>() and <a href="q3sqlfieldinfo.html#typeID">typeID</a>().</p>
 
55
<p>See also <a href="q3sqlrecordinfo.html">Q3SqlRecordInfo</a>.</p>
 
56
<hr />
 
57
<h2>Member Function Documentation</h2>
 
58
<h3 class="fn"><a name="Q3SqlFieldInfo"></a>Q3SqlFieldInfo::Q3SqlFieldInfo ( const <a href="qstring.html">QString</a> &amp; <i>name</i> = QString(), <a href="qvariant.html#Type-enum">QVariant::Type</a> <i>typ</i> = QVariant::Invalid, int <i>required</i> = -1, int <i>len</i> = -1, int <i>prec</i> = -1, const <a href="qvariant.html">QVariant</a> &amp; <i>defValue</i> = QVariant(), int <i>typeID</i> = 0, bool <i>generated</i> = true, bool <i>trim</i> = false, bool <i>calculated</i> = false )</h3>
 
59
<p>Constructs a <a href="q3sqlfieldinfo.html">Q3SqlFieldInfo</a> with the following parameters:</p>
 
60
<table align="center" cellpadding="2" cellspacing="1" border="0">
 
61
<tr valign="top" bgcolor="#f0f0f0"><td><i>name</i></td><td>the name of the field.</td></tr>
 
62
<tr valign="top" bgcolor="#e0e0e0"><td><i>typ</i></td><td>the field's type in a <a href="qvariant.html">QVariant</a>.</td></tr>
 
63
<tr valign="top" bgcolor="#f0f0f0"><td><i>required</i></td><td>greater than 0 if the field is required, 0 if its value can be NULL and less than 0 if it cannot be determined whether the field is required or not.</td></tr>
 
64
<tr valign="top" bgcolor="#e0e0e0"><td><i>len</i></td><td>the length of the field. Note that for non-character types some databases return either the length in bytes or the number of digits. -1 signifies that the length cannot be determined.</td></tr>
 
65
<tr valign="top" bgcolor="#f0f0f0"><td><i>prec</i></td><td>the precision of the field, or -1 if the field has no precision or it cannot be determined.</td></tr>
 
66
<tr valign="top" bgcolor="#e0e0e0"><td><i>defValue</i></td><td>the default value that is inserted into the table if none is specified by the user. QVariant() if there is no default value or it cannot be determined.</td></tr>
 
67
<tr valign="top" bgcolor="#f0f0f0"><td><i>typeID</i></td><td>the internal typeID of the database system (only useful for low-level programming). 0 if unknown.</td></tr>
 
68
<tr valign="top" bgcolor="#e0e0e0"><td><i>generated</i></td><td>TRUE indicates that this field should be included in auto-generated SQL statments, e.g. in <a href="q3sqlcursor.html">Q3SqlCursor</a>.</td></tr>
 
69
<tr valign="top" bgcolor="#f0f0f0"><td><i>trim</i></td><td>TRUE indicates that widgets should remove trailing whitespace from character fields. This does not affect the field value but only its representation inside widgets.</td></tr>
 
70
<tr valign="top" bgcolor="#e0e0e0"><td><i>calculated</i></td><td>TRUE indicates that the value of this field is calculated. The value of calculated fields can by modified by subclassing <a href="q3sqlcursor.html">Q3SqlCursor</a> and overriding <a href="q3sqlcursor.html#calculateField">Q3SqlCursor::calculateField</a>().</td></tr>
 
71
</table>
 
72
<h3 class="fn"><a name="Q3SqlFieldInfo-2"></a>Q3SqlFieldInfo::Q3SqlFieldInfo ( const <a href="qsqlfield.html">QSqlField</a> &amp; <i>other</i> )</h3>
 
73
<p>Creates a <a href="q3sqlfieldinfo.html">Q3SqlFieldInfo</a> object with the type and the name of the <a href="qsqlfield.html">QSqlField</a> <i>other</i>.</p>
 
74
<h3 class="fn"><a name="dtor.Q3SqlFieldInfo"></a>Q3SqlFieldInfo::~Q3SqlFieldInfo ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
75
<p>Destroys the object and frees any allocated resources.</p>
 
76
<h3 class="fn"><a name="defaultValue"></a><a href="qvariant.html">QVariant</a> Q3SqlFieldInfo::defaultValue () const</h3>
 
77
<p>Returns the field's default value or an empty <a href="qvariant.html">QVariant</a> if the field has no default value or the value couldn't be determined. The default value is the value inserted in the database when it is not explicitly specified by the user.</p>
 
78
<h3 class="fn"><a name="isCalculated"></a>bool Q3SqlFieldInfo::isCalculated () const</h3>
 
79
<p>Returns TRUE if the field is calculated; otherwise returns FALSE.</p>
 
80
<p>See also <a href="q3sqlfieldinfo.html#setCalculated">setCalculated</a>().</p>
 
81
<h3 class="fn"><a name="isGenerated"></a>bool Q3SqlFieldInfo::isGenerated () const</h3>
 
82
<p>Returns TRUE if the field should be included in auto-generated SQL statments, e.g. in <a href="q3sqlcursor.html">Q3SqlCursor</a>; otherwise returns FALSE.</p>
 
83
<p>See also <a href="q3sqlfieldinfo.html#setGenerated">setGenerated</a>().</p>
 
84
<h3 class="fn"><a name="isRequired"></a>int Q3SqlFieldInfo::isRequired () const</h3>
 
85
<p>Returns a value greater than 0 if the field is required (NULL values are not allowed), 0 if it isn't required (NULL values are allowed) or less than 0 if it cannot be determined whether the field is required or not.</p>
 
86
<h3 class="fn"><a name="isTrim"></a>bool Q3SqlFieldInfo::isTrim () const</h3>
 
87
<p>Returns TRUE if trailing whitespace should be removed from character fields; otherwise returns FALSE.</p>
 
88
<p>See also <a href="q3sqlfieldinfo.html#setTrim">setTrim</a>().</p>
 
89
<h3 class="fn"><a name="length"></a>int Q3SqlFieldInfo::length () const</h3>
 
90
<p>Returns the field's length. For fields storing text the return value is the maximum number of characters the field can hold. For non-character fields some database systems return the number of bytes needed or the number of digits allowed. If the length cannot be determined -1 is returned.</p>
 
91
<h3 class="fn"><a name="name"></a><a href="qstring.html">QString</a> Q3SqlFieldInfo::name () const</h3>
 
92
<p>Returns the name of the field in the SQL table.</p>
 
93
<h3 class="fn"><a name="precision"></a>int Q3SqlFieldInfo::precision () const</h3>
 
94
<p>Returns the field's precision or -1 if the field has no precision or it cannot be determined.</p>
 
95
<h3 class="fn"><a name="setCalculated"></a>void Q3SqlFieldInfo::setCalculated ( bool <i>calculated</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
96
<p><i>calculated</i> set to TRUE indicates that this field is a calculated field. The value of calculated fields can by modified by subclassing <a href="q3sqlcursor.html">Q3SqlCursor</a> and overriding <a href="q3sqlcursor.html#calculateField">Q3SqlCursor::calculateField</a>().</p>
 
97
<p>See also <a href="q3sqlfieldinfo.html#isCalculated">isCalculated</a>().</p>
 
98
<h3 class="fn"><a name="setGenerated"></a>void Q3SqlFieldInfo::setGenerated ( bool <i>generated</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
99
<p><i>generated</i> set to FALSE indicates that this field should not appear in auto-generated SQL statements (for example in <a href="q3sqlcursor.html">Q3SqlCursor</a>).</p>
 
100
<p>See also <a href="q3sqlfieldinfo.html#isGenerated">isGenerated</a>().</p>
 
101
<h3 class="fn"><a name="setTrim"></a>void Q3SqlFieldInfo::setTrim ( bool <i>trim</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
102
<p>If <i>trim</i> is TRUE widgets should remove trailing whitespace from character fields. This does not affect the field value but only its representation inside widgets.</p>
 
103
<p>See also <a href="q3sqlfieldinfo.html#isTrim">isTrim</a>().</p>
 
104
<h3 class="fn"><a name="toField"></a><a href="qsqlfield.html">QSqlField</a> Q3SqlFieldInfo::toField () const</h3>
 
105
<p>Returns an empty <a href="qsqlfield.html">QSqlField</a> based on the information in this <a href="q3sqlfieldinfo.html">Q3SqlFieldInfo</a>.</p>
 
106
<h3 class="fn"><a name="type"></a><a href="qvariant.html#Type-enum">QVariant::Type</a> Q3SqlFieldInfo::type () const</h3>
 
107
<p>Returns the field's type or <a href="qvariant.html#Type-enum">QVariant::Invalid</a> if the type is unknown.</p>
 
108
<h3 class="fn"><a name="typeID"></a>int Q3SqlFieldInfo::typeID () const</h3>
 
109
<p>Returns the internal type identifier as returned from the database system. The return value is 0 if the type is unknown.</p>
 
110
<h3 class="fn"><a name="operator-eq-eq"></a>bool Q3SqlFieldInfo::operator== ( const Q3SqlFieldInfo &amp; <i>other</i> ) const</h3>
 
111
<p>Assigns <i>other</i> to this field info and returns a reference to it.</p>
 
112
<p /><address><hr /><div align="center">
 
113
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
114
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
115
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
116
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
117
</tr></table></div></address></body>
 
118
</html>