1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qsqlrecord.cpp -->
<title>Qt 4.8: QSqlRecord Class Reference</title>
<link rel="stylesheet" type="text/css" href="style/offline.css" />
</head>
<body>
<div class="header" id="qtdocheader">
<div class="content">
<a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
</div>
<div class="breadcrumb toolblock">
<ul>
<li class="first"><a href="index.html">Home</a></li>
<!-- Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtsql.html">QtSql</a></li>
<li>QSqlRecord</li>
</ul>
</div>
</div>
<div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QSqlRecord Class Reference</h1>
<!-- $$$QSqlRecord-brief -->
<p>The QSqlRecord class encapsulates a database record. <a href="#details">More...</a></p>
<!-- @@@QSqlRecord -->
<pre class="cpp"> <span class="preprocessor">#include <QSqlRecord></span></pre><p><b>Inherited by: </b><a href="q3sqlcursor.html" class="compat">Q3SqlCursor</a> and <a href="qsqlindex.html">QSqlIndex</a>.</p>
<ul>
<li><a href="qsqlrecord-members.html">List of all members, including inherited members</a></li>
<li><a href="qsqlrecord-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#QSqlRecord">QSqlRecord</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#QSqlRecord-2">QSqlRecord</a></b> ( const QSqlRecord & <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#dtor.QSqlRecord">~QSqlRecord</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#append">append</a></b> ( const QSqlField & <i>field</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#clear">clear</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#clearValues">clearValues</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#contains">contains</a></b> ( const QString & <i>name</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#count">count</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSqlField </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#field">field</a></b> ( int <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSqlField </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#field-2">field</a></b> ( const QString & <i>name</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QString </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#fieldName">fieldName</a></b> ( int <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#indexOf">indexOf</a></b> ( const QString & <i>name</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#insert">insert</a></b> ( int <i>pos</i>, const QSqlField & <i>field</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#isEmpty">isEmpty</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#isGenerated">isGenerated</a></b> ( const QString & <i>name</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#isGenerated-2">isGenerated</a></b> ( int <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#isNull">isNull</a></b> ( const QString & <i>name</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#isNull-2">isNull</a></b> ( int <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#remove">remove</a></b> ( int <i>pos</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#replace">replace</a></b> ( int <i>pos</i>, const QSqlField & <i>field</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#setGenerated">setGenerated</a></b> ( const QString & <i>name</i>, bool <i>generated</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#setGenerated-2">setGenerated</a></b> ( int <i>index</i>, bool <i>generated</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#setNull">setNull</a></b> ( int <i>index</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#setNull-2">setNull</a></b> ( const QString & <i>name</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#setValue">setValue</a></b> ( int <i>index</i>, const QVariant & <i>val</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#setValue-2">setValue</a></b> ( const QString & <i>name</i>, const QVariant & <i>val</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#value">value</a></b> ( int <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QVariant </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#value-2">value</a></b> ( const QString & <i>name</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#operator-not-eq">operator!=</a></b> ( const QSqlRecord & <i>other</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSqlRecord & </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#operator-eq">operator=</a></b> ( const QSqlRecord & <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsqlrecord.html#operator-eq-eq">operator==</a></b> ( const QSqlRecord & <i>other</i> ) const</td></tr>
</table>
<a name="details"></a>
<!-- $$$QSqlRecord-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QSqlRecord class encapsulates a database record.</p>
<p>The QSqlRecord class encapsulates the functionality and characteristics of a database record (usually a row in a table or view within the database). QSqlRecord supports adding and removing fields as well as setting and retrieving field values.</p>
<p>The values of a record's fields' can be set by name or position with <a href="qsqlrecord.html#setValue">setValue</a>(); if you want to set a field to null use <a href="qsqlrecord.html#setNull">setNull</a>(). To find the position of a field by name use <a href="qsqlrecord.html#indexOf">indexOf</a>(), and to find the name of a field at a particular position use <a href="qsqlrecord.html#fieldName">fieldName</a>(). Use <a href="qsqlrecord.html#field">field</a>() to retrieve a <a href="qsqlfield.html">QSqlField</a> object for a given field. Use <a href="qsqlrecord.html#contains">contains</a>() to see if the record contains a particular field name.</p>
<p>When queries are generated to be executed on the database only those fields for which <a href="qsqlrecord.html#isGenerated">isGenerated</a>() is true are included in the generated SQL.</p>
<p>A record can have fields added with <a href="qsqlrecord.html#append">append</a>() or <a href="qsqlrecord.html#insert">insert</a>(), replaced with <a href="qsqlrecord.html#replace">replace</a>(), and removed with <a href="qsqlrecord.html#remove">remove</a>(). All the fields can be removed with <a href="qsqlrecord.html#clear">clear</a>(). The number of fields is given by <a href="qsqlrecord.html#count">count</a>(); all their values can be cleared (to null) using <a href="qsqlrecord.html#clearValues">clearValues</a>().</p>
</div>
<p><b>See also </b><a href="qsqlfield.html">QSqlField</a> and <a href="qsqlquery.html#record">QSqlQuery::record</a>().</p>
<!-- @@@QSqlRecord -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QSqlRecord[overload1]$$$QSqlRecord -->
<h3 class="fn"><a name="QSqlRecord"></a>QSqlRecord::<span class="name">QSqlRecord</span> ()</h3>
<p>Constructs an empty record.</p>
<p><b>See also </b><a href="qsqlrecord.html#isEmpty">isEmpty</a>(), <a href="qsqlrecord.html#append">append</a>(), and <a href="qsqlrecord.html#insert">insert</a>().</p>
<!-- @@@QSqlRecord -->
<!-- $$$QSqlRecord$$$QSqlRecordconstQSqlRecord& -->
<h3 class="fn"><a name="QSqlRecord-2"></a>QSqlRecord::<span class="name">QSqlRecord</span> ( const <span class="type">QSqlRecord</span> & <i>other</i> )</h3>
<p>Constructs a copy of <i>other</i>.</p>
<p><a href="qsqlrecord.html">QSqlRecord</a> is <a href="implicit-sharing.html#implicitly-shared">implicitly shared</a>. This means you can make copies of a record in <a href="containers.html#constant-time">constant time</a>.</p>
<!-- @@@QSqlRecord -->
<!-- $$$~QSqlRecord[overload1]$$$~QSqlRecord -->
<h3 class="fn"><a name="dtor.QSqlRecord"></a>QSqlRecord::<span class="name">~QSqlRecord</span> ()</h3>
<p>Destroys the object and frees any allocated resources.</p>
<!-- @@@~QSqlRecord -->
<!-- $$$append[overload1]$$$appendconstQSqlField& -->
<h3 class="fn"><a name="append"></a><span class="type">void</span> QSqlRecord::<span class="name">append</span> ( const <span class="type"><a href="qsqlfield.html">QSqlField</a></span> & <i>field</i> )</h3>
<p>Append a copy of field <i>field</i> to the end of the record.</p>
<p><b>See also </b><a href="qsqlrecord.html#insert">insert</a>(), <a href="qsqlrecord.html#replace">replace</a>(), and <a href="qsqlrecord.html#remove">remove</a>().</p>
<!-- @@@append -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn"><a name="clear"></a><span class="type">void</span> QSqlRecord::<span class="name">clear</span> ()</h3>
<p>Removes all the record's fields.</p>
<p><b>See also </b><a href="qsqlrecord.html#clearValues">clearValues</a>() and <a href="qsqlrecord.html#isEmpty">isEmpty</a>().</p>
<!-- @@@clear -->
<!-- $$$clearValues[overload1]$$$clearValues -->
<h3 class="fn"><a name="clearValues"></a><span class="type">void</span> QSqlRecord::<span class="name">clearValues</span> ()</h3>
<p>Clears the value of all fields in the record and sets each field to null.</p>
<p><b>See also </b><a href="qsqlrecord.html#setValue">setValue</a>().</p>
<!-- @@@clearValues -->
<!-- $$$contains[overload1]$$$containsconstQString& -->
<h3 class="fn"><a name="contains"></a><span class="type">bool</span> QSqlRecord::<span class="name">contains</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i> ) const</h3>
<p>Returns true if there is a field in the record called <i>name</i>; otherwise returns false.</p>
<!-- @@@contains -->
<!-- $$$count[overload1]$$$count -->
<h3 class="fn"><a name="count"></a><span class="type">int</span> QSqlRecord::<span class="name">count</span> () const</h3>
<p>Returns the number of fields in the record.</p>
<p><b>See also </b><a href="qsqlrecord.html#isEmpty">isEmpty</a>().</p>
<!-- @@@count -->
<!-- $$$field[overload1]$$$fieldint -->
<h3 class="fn"><a name="field"></a><span class="type"><a href="qsqlfield.html">QSqlField</a></span> QSqlRecord::<span class="name">field</span> ( <span class="type">int</span> <i>index</i> ) const</h3>
<p>Returns the field at position <i>index</i>. If the <i>index</i> is out of range, function returns a <a href="containers.html#default-constructed-values">default-constructed value</a>.</p>
<!-- @@@field -->
<!-- $$$field$$$fieldconstQString& -->
<h3 class="fn"><a name="field-2"></a><span class="type"><a href="qsqlfield.html">QSqlField</a></span> QSqlRecord::<span class="name">field</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the field called <i>name</i>.</p>
<!-- @@@field -->
<!-- $$$fieldName[overload1]$$$fieldNameint -->
<h3 class="fn"><a name="fieldName"></a><span class="type"><a href="qstring.html">QString</a></span> QSqlRecord::<span class="name">fieldName</span> ( <span class="type">int</span> <i>index</i> ) const</h3>
<p>Returns the name of the field at position <i>index</i>. If the field does not exist, an empty string is returned.</p>
<p><b>See also </b><a href="qsqlrecord.html#indexOf">indexOf</a>().</p>
<!-- @@@fieldName -->
<!-- $$$indexOf[overload1]$$$indexOfconstQString& -->
<h3 class="fn"><a name="indexOf"></a><span class="type">int</span> QSqlRecord::<span class="name">indexOf</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i> ) const</h3>
<p>Returns the position of the field called <i>name</i> within the record, or -1 if it cannot be found. Field names are not case-sensitive. If more than one field matches, the first one is returned.</p>
<p><b>See also </b><a href="qsqlrecord.html#fieldName">fieldName</a>().</p>
<!-- @@@indexOf -->
<!-- $$$insert[overload1]$$$insertintconstQSqlField& -->
<h3 class="fn"><a name="insert"></a><span class="type">void</span> QSqlRecord::<span class="name">insert</span> ( <span class="type">int</span> <i>pos</i>, const <span class="type"><a href="qsqlfield.html">QSqlField</a></span> & <i>field</i> )</h3>
<p>Inserts the field <i>field</i> at position <i>pos</i> in the record.</p>
<p><b>See also </b><a href="qsqlrecord.html#append">append</a>(), <a href="qsqlrecord.html#replace">replace</a>(), and <a href="qsqlrecord.html#remove">remove</a>().</p>
<!-- @@@insert -->
<!-- $$$isEmpty[overload1]$$$isEmpty -->
<h3 class="fn"><a name="isEmpty"></a><span class="type">bool</span> QSqlRecord::<span class="name">isEmpty</span> () const</h3>
<p>Returns true if there are no fields in the record; otherwise returns false.</p>
<p><b>See also </b><a href="qsqlrecord.html#append">append</a>(), <a href="qsqlrecord.html#insert">insert</a>(), and <a href="qsqlrecord.html#clear">clear</a>().</p>
<!-- @@@isEmpty -->
<!-- $$$isGenerated[overload1]$$$isGeneratedconstQString& -->
<h3 class="fn"><a name="isGenerated"></a><span class="type">bool</span> QSqlRecord::<span class="name">isGenerated</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i> ) const</h3>
<p>Returns true if the record has a field called <i>name</i> and this field is to be generated (the default); otherwise returns false.</p>
<p><b>See also </b><a href="qsqlrecord.html#setGenerated">setGenerated</a>().</p>
<!-- @@@isGenerated -->
<!-- $$$isGenerated$$$isGeneratedint -->
<h3 class="fn"><a name="isGenerated-2"></a><span class="type">bool</span> QSqlRecord::<span class="name">isGenerated</span> ( <span class="type">int</span> <i>index</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns true if the record has a field at position <i>index</i> and this field is to be generated (the default); otherwise returns false.</p>
<p><b>See also </b><a href="qsqlrecord.html#setGenerated">setGenerated</a>().</p>
<!-- @@@isGenerated -->
<!-- $$$isNull[overload1]$$$isNullconstQString& -->
<h3 class="fn"><a name="isNull"></a><span class="type">bool</span> QSqlRecord::<span class="name">isNull</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i> ) const</h3>
<p>Returns true if the field called <i>name</i> is null or if there is no field called <i>name</i>; otherwise returns false.</p>
<p><b>See also </b><a href="qsqlrecord.html#setNull">setNull</a>().</p>
<!-- @@@isNull -->
<!-- $$$isNull$$$isNullint -->
<h3 class="fn"><a name="isNull-2"></a><span class="type">bool</span> QSqlRecord::<span class="name">isNull</span> ( <span class="type">int</span> <i>index</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns true if the field <i>index</i> is null or if there is no field at position <i>index</i>; otherwise returns false.</p>
<!-- @@@isNull -->
<!-- $$$remove[overload1]$$$removeint -->
<h3 class="fn"><a name="remove"></a><span class="type">void</span> QSqlRecord::<span class="name">remove</span> ( <span class="type">int</span> <i>pos</i> )</h3>
<p>Removes the field at position <i>pos</i>. If <i>pos</i> is out of range, nothing happens.</p>
<p><b>See also </b><a href="qsqlrecord.html#append">append</a>(), <a href="qsqlrecord.html#insert">insert</a>(), and <a href="qsqlrecord.html#replace">replace</a>().</p>
<!-- @@@remove -->
<!-- $$$replace[overload1]$$$replaceintconstQSqlField& -->
<h3 class="fn"><a name="replace"></a><span class="type">void</span> QSqlRecord::<span class="name">replace</span> ( <span class="type">int</span> <i>pos</i>, const <span class="type"><a href="qsqlfield.html">QSqlField</a></span> & <i>field</i> )</h3>
<p>Replaces the field at position <i>pos</i> with the given <i>field</i>. If <i>pos</i> is out of range, nothing happens.</p>
<p><b>See also </b><a href="qsqlrecord.html#append">append</a>(), <a href="qsqlrecord.html#insert">insert</a>(), and <a href="qsqlrecord.html#remove">remove</a>().</p>
<!-- @@@replace -->
<!-- $$$setGenerated[overload1]$$$setGeneratedconstQString&bool -->
<h3 class="fn"><a name="setGenerated"></a><span class="type">void</span> QSqlRecord::<span class="name">setGenerated</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i>, <span class="type">bool</span> <i>generated</i> )</h3>
<p>Sets the generated flag for the field called <i>name</i> to <i>generated</i>. If the field does not exist, nothing happens. Only fields that have <i>generated</i> set to true are included in the SQL that is generated by <a href="qsqlquerymodel.html">QSqlQueryModel</a> for example.</p>
<p><b>See also </b><a href="qsqlrecord.html#isGenerated">isGenerated</a>().</p>
<!-- @@@setGenerated -->
<!-- $$$setGenerated$$$setGeneratedintbool -->
<h3 class="fn"><a name="setGenerated-2"></a><span class="type">void</span> QSqlRecord::<span class="name">setGenerated</span> ( <span class="type">int</span> <i>index</i>, <span class="type">bool</span> <i>generated</i> )</h3>
<p>This is an overloaded function.</p>
<p>Sets the generated flag for the field <i>index</i> to <i>generated</i>.</p>
<p><b>See also </b><a href="qsqlrecord.html#isGenerated">isGenerated</a>().</p>
<!-- @@@setGenerated -->
<!-- $$$setNull[overload1]$$$setNullint -->
<h3 class="fn"><a name="setNull"></a><span class="type">void</span> QSqlRecord::<span class="name">setNull</span> ( <span class="type">int</span> <i>index</i> )</h3>
<p>Sets the value of field <i>index</i> to null. If the field does not exist, nothing happens.</p>
<p><b>See also </b><a href="qsqlrecord.html#isNull">isNull</a>() and <a href="qsqlrecord.html#setValue">setValue</a>().</p>
<!-- @@@setNull -->
<!-- $$$setNull$$$setNullconstQString& -->
<h3 class="fn"><a name="setNull-2"></a><span class="type">void</span> QSqlRecord::<span class="name">setNull</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i> )</h3>
<p>This is an overloaded function.</p>
<p>Sets the value of the field called <i>name</i> to null. If the field does not exist, nothing happens.</p>
<!-- @@@setNull -->
<!-- $$$setValue[overload1]$$$setValueintconstQVariant& -->
<h3 class="fn"><a name="setValue"></a><span class="type">void</span> QSqlRecord::<span class="name">setValue</span> ( <span class="type">int</span> <i>index</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>val</i> )</h3>
<p>Sets the value of the field at position <i>index</i> to <i>val</i>. If the field does not exist, nothing happens.</p>
<p><b>See also </b><a href="qsqlrecord.html#value">value</a>() and <a href="qsqlrecord.html#setNull">setNull</a>().</p>
<!-- @@@setValue -->
<!-- $$$setValue$$$setValueconstQString&constQVariant& -->
<h3 class="fn"><a name="setValue-2"></a><span class="type">void</span> QSqlRecord::<span class="name">setValue</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i>, const <span class="type"><a href="qvariant.html">QVariant</a></span> & <i>val</i> )</h3>
<p>This is an overloaded function.</p>
<p>Sets the value of the field called <i>name</i> to <i>val</i>. If the field does not exist, nothing happens.</p>
<!-- @@@setValue -->
<!-- $$$value[overload1]$$$valueint -->
<h3 class="fn"><a name="value"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QSqlRecord::<span class="name">value</span> ( <span class="type">int</span> <i>index</i> ) const</h3>
<p>Returns the value of the field located at position <i>index</i> in the record. If <i>index</i> is out of bounds, an invalid <a href="qvariant.html">QVariant</a> is returned.</p>
<p><b>See also </b><a href="qsqlrecord.html#setValue">setValue</a>(), <a href="qsqlrecord.html#fieldName">fieldName</a>(), and <a href="qsqlrecord.html#isNull">isNull</a>().</p>
<!-- @@@value -->
<!-- $$$value$$$valueconstQString& -->
<h3 class="fn"><a name="value-2"></a><span class="type"><a href="qvariant.html">QVariant</a></span> QSqlRecord::<span class="name">value</span> ( const <span class="type"><a href="qstring.html">QString</a></span> & <i>name</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the value of the field called <i>name</i> in the record. If field <i>name</i> does not exist an invalid variant is returned.</p>
<p><b>See also </b><a href="qsqlrecord.html#indexOf">indexOf</a>().</p>
<!-- @@@value -->
<!-- $$$operator!=[overload1]$$$operator!=constQSqlRecord& -->
<h3 class="fn"><a name="operator-not-eq"></a><span class="type">bool</span> QSqlRecord::<span class="name">operator!=</span> ( const <span class="type">QSqlRecord</span> & <i>other</i> ) const</h3>
<p>Returns true if this object is not identical to <i>other</i>; otherwise returns false.</p>
<p><b>See also </b><a href="qsqlrecord.html#operator-eq-eq">operator==</a>().</p>
<!-- @@@operator!= -->
<!-- $$$operator=[overload1]$$$operator=constQSqlRecord& -->
<h3 class="fn"><a name="operator-eq"></a><span class="type">QSqlRecord</span> & QSqlRecord::<span class="name">operator=</span> ( const <span class="type">QSqlRecord</span> & <i>other</i> )</h3>
<p>Sets the record equal to <i>other</i>.</p>
<p><a href="qsqlrecord.html">QSqlRecord</a> is <a href="implicit-sharing.html#implicitly-shared">implicitly shared</a>. This means you can make copies of a record in <a href="containers.html#constant-time">constant time</a>.</p>
<!-- @@@operator= -->
<!-- $$$operator==[overload1]$$$operator==constQSqlRecord& -->
<h3 class="fn"><a name="operator-eq-eq"></a><span class="type">bool</span> QSqlRecord::<span class="name">operator==</span> ( const <span class="type">QSqlRecord</span> & <i>other</i> ) const</h3>
<p>Returns true if this object is identical to <i>other</i> (i.e., has the same fields in the same order); otherwise returns false.</p>
<p><b>See also </b><a href="qsqlrecord.html#operator-not-eq">operator!=</a>().</p>
<!-- @@@operator== -->
</div>
<div class="ft">
<span></span>
</div>
</div>
<div class="footer">
<p>
<acronym title="Copyright">©</acronym> 2012 Nokia Corporation and/or its
subsidiaries. Documentation contributions included herein are the copyrights of
their respective owners.</p>
<br />
<p>
The documentation provided herein is licensed under the terms of the
<a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
License version 1.3</a> as published by the Free Software Foundation.</p>
<p>
Documentation sources may be obtained from <a href="http://www.qt-project.org">
www.qt-project.org</a>.</p>
<br />
<p>
Nokia, Qt and their respective logos are trademarks of Nokia Corporation
in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners. <a title="Privacy Policy"
href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
</div>
</body>
</html>
|