Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 3f684444755c5ad1181cdd5a97348f3c > files > 1462

PyQt4-devel-4.7.4-2.fc14.i686.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QSqlError Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QSqlError Class Reference<br /><sup><sup>[<a href="qtsql.html">QtSql</a> module]</sup></sup></h1><p>The QSqlError class provides SQL database error information. <a href="#details">More...</a></p>
<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qsqlerror.html#ErrorType-enum">ErrorType</a></b> { NoError, ConnectionError, StatementError, TransactionError, UnknownError }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qsqlerror.html#QSqlError">__init__</a></b> (<i>self</i>, QString&#160;<i>driverText</i>&#160;=&#160;QString(), QString&#160;<i>databaseText</i>&#160;=&#160;QString(), ErrorType&#160;<i>type</i>&#160;=&#160;QSqlError.NoError, int&#160;<i>number</i>&#160;=&#160;-1)</li><li><div class="fn" /><b><a href="qsqlerror.html#QSqlError-2">__init__</a></b> (<i>self</i>, QSqlError)</li><li><div class="fn" />QString <b><a href="qsqlerror.html#databaseText">databaseText</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qsqlerror.html#driverText">driverText</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qsqlerror.html#isValid">isValid</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qsqlerror.html#number">number</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qsqlerror.html#setDatabaseText">setDatabaseText</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qsqlerror.html#setDriverText">setDriverText</a></b> (<i>self</i>, QString)</li><li><div class="fn" /><b><a href="qsqlerror.html#setNumber">setNumber</a></b> (<i>self</i>, int)</li><li><div class="fn" /><b><a href="qsqlerror.html#setType">setType</a></b> (<i>self</i>, ErrorType)</li><li><div class="fn" />QString <b><a href="qsqlerror.html#text">text</a></b> (<i>self</i>)</li><li><div class="fn" />ErrorType <b><a href="qsqlerror.html#type">type</a></b> (<i>self</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QSqlError class provides SQL database error information.</p>
<p>A QSqlError object can provide database-specific error data, including the <a href="qsqlerror.html#driverText">driverText</a>() and <a href="qsqlerror.html#databaseText">databaseText</a>() messages (or both concatenated together as <a href="qsqlerror.html#text">text</a>()), and the error <a href="qsqlerror.html#number">number</a>() and <a href="qsqlerror.html#type">type</a>(). The functions all have setters so that you can create and return QSqlError objects from your own classes, for example from your own SQL drivers.</p>
<p>See also <a href="qsqldatabase.html#lastError">QSqlDatabase.lastError</a>() and <a href="qsqlquery.html#lastError">QSqlQuery.lastError</a>().</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="ErrorType-enum" />QSqlError.ErrorType</h3><p>This enum type describes the context in which the error occurred, e.g., a connection error, a statement error, etc.</p>
<p><table border="1" cellpadding="2" cellspacing="1" class="valuelist" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QSqlError.NoError</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">No error occurred.</td></tr>
<tr><td valign="top"><tt>QSqlError.ConnectionError</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Connection error.</td></tr>
<tr><td valign="top"><tt>QSqlError.StatementError</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">SQL statement syntax error.</td></tr>
<tr><td valign="top"><tt>QSqlError.TransactionError</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">Transaction failed error.</td></tr>
<tr><td valign="top"><tt>QSqlError.UnknownError</tt></td><td align="center" valign="top"><tt>4</tt></td><td valign="top">Unknown error.</td></tr>
</table></p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QSqlError" />QSqlError.__init__ (<i>self</i>, QString&#160;<i>driverText</i>&#160;=&#160;QString(), QString&#160;<i>databaseText</i>&#160;=&#160;QString(), <a href="qsqlerror.html#ErrorType-enum">ErrorType</a>&#160;<i>type</i>&#160;=&#160;QSqlError.NoError, int&#160;<i>number</i>&#160;=&#160;-1)</h3><p>Constructs an error containing the driver error text <i>driverText</i>, the database-specific error text <i>databaseText</i>, the type <i>type</i> and the optional error number <i>number</i>.</p>
<h3 class="fn"><a name="QSqlError-2" />QSqlError.__init__ (<i>self</i>, <a href="qsqlerror.html">QSqlError</a>)</h3><p>Creates a copy of <i>other</i>.</p>
<a name="//apple_ref/cpp/instm/QSqlError/~QSqlError" />
<h3 class="fn"><a name="databaseText" />QString QSqlError.databaseText (<i>self</i>)</h3><p>Returns the text of the error as reported by the database. This may contain database-specific descriptions; it may be empty.</p>
<p>See also <a href="qsqlerror.html#setDatabaseText">setDatabaseText</a>(), <a href="qsqlerror.html#driverText">driverText</a>(), and <a href="qsqlerror.html#text">text</a>().</p>
<a name="//apple_ref/cpp/instm/QSqlError/driverText" />
<h3 class="fn"><a name="driverText" />QString QSqlError.driverText (<i>self</i>)</h3><p>Returns the text of the error as reported by the driver. This may contain database-specific descriptions. It may also be empty.</p>
<p>See also <a href="qsqlerror.html#setDriverText">setDriverText</a>(), <a href="qsqlerror.html#databaseText">databaseText</a>(), and <a href="qsqlerror.html#text">text</a>().</p>
<a name="//apple_ref/cpp/instm/QSqlError/isValid" />
<h3 class="fn"><a name="isValid" />bool QSqlError.isValid (<i>self</i>)</h3><p>Returns true if an error is set, otherwise false.</p>
<p>Example:</p>
<pre> QSqlQueryModel model;
 model.setQuery("select * from myTable");
 if (model.lastError().isValid())
     qDebug() &lt;&lt; model.lastError();</pre>
<p>See also <a href="qsqlerror.html#type">type</a>().</p>
<a name="//apple_ref/cpp/instm/QSqlError/number" />
<h3 class="fn"><a name="number" />int QSqlError.number (<i>self</i>)</h3><p>Returns the database-specific error number, or -1 if it cannot be determined.</p>
<p>See also <a href="qsqlerror.html#setNumber">setNumber</a>().</p>
<a name="//apple_ref/cpp/instm/QSqlError/setDatabaseText" />
<h3 class="fn"><a name="setDatabaseText" />QSqlError.setDatabaseText (<i>self</i>, QString)</h3><p>Sets the database error text to the value of <i>databaseText</i>.</p>
<p>See also <a href="qsqlerror.html#databaseText">databaseText</a>(), <a href="qsqlerror.html#setDriverText">setDriverText</a>(), and <a href="qsqlerror.html#text">text</a>().</p>
<a name="//apple_ref/cpp/instm/QSqlError/setDriverText" />
<h3 class="fn"><a name="setDriverText" />QSqlError.setDriverText (<i>self</i>, QString)</h3><p>Sets the driver error text to the value of <i>driverText</i>.</p>
<p>See also <a href="qsqlerror.html#driverText">driverText</a>(), <a href="qsqlerror.html#setDatabaseText">setDatabaseText</a>(), and <a href="qsqlerror.html#text">text</a>().</p>
<a name="//apple_ref/cpp/instm/QSqlError/setNumber" />
<h3 class="fn"><a name="setNumber" />QSqlError.setNumber (<i>self</i>, int)</h3><p>Sets the database-specific error number to <i>number</i>.</p>
<p>See also <a href="qsqlerror.html#number">number</a>().</p>
<a name="//apple_ref/cpp/instm/QSqlError/setType" />
<h3 class="fn"><a name="setType" />QSqlError.setType (<i>self</i>, <a href="qsqlerror.html#ErrorType-enum">ErrorType</a>)</h3><p>Sets the error type to the value of <i>type</i>.</p>
<p>See also <a href="qsqlerror.html#type">type</a>().</p>
<a name="//apple_ref/cpp/instm/QSqlError/text" />
<h3 class="fn"><a name="text" />QString QSqlError.text (<i>self</i>)</h3><p>This is a convenience function that returns <a href="qsqlerror.html#databaseText">databaseText</a>() and <a href="qsqlerror.html#driverText">driverText</a>() concatenated into a single string.</p>
<p>See also <a href="qsqlerror.html#driverText">driverText</a>() and <a href="qsqlerror.html#databaseText">databaseText</a>().</p>
<a name="//apple_ref/cpp/instm/QSqlError/type" />
<h3 class="fn"><a name="type" /><a href="qsqlerror.html#ErrorType-enum">ErrorType</a> QSqlError.type (<i>self</i>)</h3><p>Returns the error type, or -1 if the type cannot be determined.</p>
<p>See also <a href="qsqlerror.html#setType">setType</a>().</p>
<a name="//apple_ref/cpp/instm/QSqlError/operator=" />
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.4 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.3</td></tr></table></div></address></body></html>