<?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/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <link rel="stylesheet" type="text/css" href="style/narrow.css" /> <!--[if IE]> <meta name="MSSmartTagsPreventParsing" content="true"> <meta http-equiv="imagetoolbar" content="no"> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> <![endif]--> <script src="scripts/superfish.js" type="text/javascript"></script> <script src="scripts/narrow.js" type="text/javascript"></script> </head> <body class="" onload="CheckEmptyAndLoadList();"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="narrowsearch"></div> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li> <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="supported-platforms.html">Supported Platforms</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search" id="sidebarsearch"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> <div id="resultdialog"> <a href="#" id="resultclose">Close</a> <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span> results:</p> <ul id="resultlist" class="all"> </ul> </div> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <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 class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></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> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2015 The Qt Company Ltd. 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> Qt and respective logos are trademarks of The Qt Company Ltd 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> <script src="scripts/functions.js" type="text/javascript"></script> </body> </html>