<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <!-- /tmp/qt-4.3.4-qt-1203442408707/qt-x11-opensource-src-4.3.4/src/qt3support/sql/q3sqleditorfactory.cpp --> <head> <title>Qt 4.3: Q3SqlEditorFactory Class Reference</title> <link href="classic.css" rel="stylesheet" type="text/css" /> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td> <td width="1"> </td><td class="postheader" 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="groups.html"><font color="#004faf">Grouped Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a> · <a href="functions.html"><font color="#004faf">Functions</font></a></td> <td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">Q3SqlEditorFactory Class Reference<br /><sup><sup>[<a href="qt3support.html">Qt3Support</a> module]</sup></sup></h1> <p>The Q3SqlEditorFactory class is used to create the editors used by <a href="q3datatable.html">Q3DataTable</a> and <a href="q3sqlform.html">Q3SqlForm</a>. <a href="#details">More...</a></p> <pre> #include <Q3SqlEditorFactory></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 <a href="porting4.html#qsqleditorfactory">Porting to Qt 4</a> for more information.</p> <p><b>Note to Qt Desktop Light Edition users:</b> This class is only available in the <a href="commercialeditions.html#qt-desktop-edition">Qt Desktop Edition</a>.</p> <p>Inherits <a href="q3editorfactory.html">Q3EditorFactory</a>.</p> <ul> <li><a href="q3sqleditorfactory-members.html">List of all members, including inherited members</a></li> </ul> <a name="public-functions"></a> <h3>Public Functions</h3> <ul> <li><div class="fn"/><b><a href="q3sqleditorfactory.html#Q3SqlEditorFactory">Q3SqlEditorFactory</a></b> ( QObject * <i>parent</i> = 0 )</li> <li><div class="fn"/><b><a href="q3sqleditorfactory.html#dtor.Q3SqlEditorFactory">~Q3SqlEditorFactory</a></b> ()</li> <li><div class="fn"/>virtual QWidget * <b><a href="q3sqleditorfactory.html#createEditor">createEditor</a></b> ( QWidget * <i>parent</i>, const QVariant & <i>variant</i> )</li> <li><div class="fn"/>virtual QWidget * <b><a href="q3sqleditorfactory.html#createEditor-2">createEditor</a></b> ( QWidget * <i>parent</i>, const QSqlField * <i>field</i> )</li> </ul> <ul> <li><div class="fn"/>1 public function inherited from <a href="q3editorfactory.html#public-functions">Q3EditorFactory</a></li> <li><div class="fn"/>29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li> </ul> <a name="static-public-members"></a> <h3>Static Public Members</h3> <ul> <li><div class="fn"/>Q3SqlEditorFactory * <b><a href="q3sqleditorfactory.html#defaultFactory">defaultFactory</a></b> ()</li> <li><div class="fn"/>void <b><a href="q3sqleditorfactory.html#installDefaultFactory">installDefaultFactory</a></b> ( Q3SqlEditorFactory * <i>factory</i> )</li> </ul> <ul> <li><div class="fn"/>2 static public members inherited from <a href="q3editorfactory.html#static-public-members">Q3EditorFactory</a></li> <li><div class="fn"/>5 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li> </ul> <h3>Additional Inherited Members</h3> <ul> <li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li> <li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li> <li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li> <li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li> </ul> <a name="details"></a> <hr /> <h2>Detailed Description</h2> <p>The Q3SqlEditorFactory class is used to create the editors used by <a href="q3datatable.html">Q3DataTable</a> and <a href="q3sqlform.html">Q3SqlForm</a>.</p> <p>Q3SqlEditorFactory is used by <a href="q3datatable.html">Q3DataTable</a> and <a href="q3sqlform.html">Q3SqlForm</a> to automatically create appropriate editors for a given <a href="qsqlfield.html">QSqlField</a>. For example if the field is a <a href="qvariant.html#Type-enum">QVariant::String</a> a <a href="qlineedit.html">QLineEdit</a> would be the default editor, whereas a <a href="qvariant.html#Type-enum">QVariant::Int</a>'s default editor would be a <a href="qspinbox.html">QSpinBox</a>.</p> <p>If you want to create different editors for fields with the same data type, subclass Q3SqlEditorFactory and reimplement the <a href="q3sqleditorfactory.html#createEditor">createEditor</a>() function.</p> <p>See also <a href="q3datatable.html">Q3DataTable</a> and <a href="q3sqlform.html">Q3SqlForm</a>.</p> <hr /> <h2>Member Function Documentation</h2> <h3 class="fn"><a name="Q3SqlEditorFactory"></a>Q3SqlEditorFactory::Q3SqlEditorFactory ( <a href="qobject.html">QObject</a> * <i>parent</i> = 0 )</h3> <p>Constructs a SQL editor factory with parent <i>parent</i>.</p> <h3 class="fn"><a name="dtor.Q3SqlEditorFactory"></a>Q3SqlEditorFactory::~Q3SqlEditorFactory ()</h3> <p>Destroys the object and frees any allocated resources.</p> <h3 class="fn"><a name="createEditor"></a><a href="qwidget.html">QWidget</a> * Q3SqlEditorFactory::createEditor ( <a href="qwidget.html">QWidget</a> * <i>parent</i>, const <a href="qvariant.html">QVariant</a> & <i>variant</i> ) <tt> [virtual]</tt></h3> <p>Creates and returns the appropriate editor widget for the <a href="qvariant.html">QVariant</a> <i>variant</i>.</p> <p>The widget that is returned has the parent <i>parent</i> (which may be zero). If <i>variant</i> is invalid, 0 is returned.</p> <p>Reimplemented from <a href="q3editorfactory.html#createEditor">Q3EditorFactory</a>.</p> <h3 class="fn"><a name="createEditor-2"></a><a href="qwidget.html">QWidget</a> * Q3SqlEditorFactory::createEditor ( <a href="qwidget.html">QWidget</a> * <i>parent</i>, const <a href="qsqlfield.html">QSqlField</a> * <i>field</i> ) <tt> [virtual]</tt></h3> <p>This is an overloaded member function, provided for convenience.</p> <p>Creates and returns the appropriate editor for the <a href="qsqlfield.html">QSqlField</a> <i>field</i>.</p> <h3 class="fn"><a name="defaultFactory"></a>Q3SqlEditorFactory * Q3SqlEditorFactory::defaultFactory () <tt> [static]</tt></h3> <p>Returns an instance of a default editor factory.</p> <h3 class="fn"><a name="installDefaultFactory"></a>void Q3SqlEditorFactory::installDefaultFactory ( Q3SqlEditorFactory * <i>factory</i> ) <tt> [static]</tt></h3> <p>Replaces the default editor factory with <i>factory</i>. All <a href="q3datatable.html">Q3DataTable</a> and <a href="q3sqlform.html">Q3SqlForm</a> instantiations will use this new factory for creating field editors. <i><a href="q3sqleditorfactory.html">Q3SqlEditorFactory</a> takes ownership of <i>factory</i>, and destroys it when it is no longer needed.</i></p> <p /><address><hr /><div align="center"> <table width="100%" cellspacing="0" border="0"><tr class="address"> <td width="30%">Copyright © 2008 <a href="trolltech.html">Trolltech</a></td> <td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td> <td width="30%" align="right"><div align="right">Qt 4.3.4</div></td> </tr></table></div></address></body> </html>