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
|
<?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>QItemEditorFactory 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">  </td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QItemEditorFactory Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QItemEditorFactory class provides widgets for editing item data in views and delegates. <a href="#details">More...</a></p>
<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qitemeditorfactory.html#QItemEditorFactory">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qitemeditorfactory.html#QItemEditorFactory-2">__init__</a></b> (<i>self</i>, QItemEditorFactory)</li><li><div class="fn" />QWidget <b><a href="qitemeditorfactory.html#createEditor">createEditor</a></b> (<i>self</i>, QVariant.Type, QWidget)</li><li><div class="fn" /><b><a href="qitemeditorfactory.html#registerEditor">registerEditor</a></b> (<i>self</i>, QVariant.Type, QItemEditorCreatorBase)</li><li><div class="fn" />QByteArray <b><a href="qitemeditorfactory.html#valuePropertyName">valuePropertyName</a></b> (<i>self</i>, QVariant.Type)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" />QItemEditorFactory <b><a href="qitemeditorfactory.html#defaultFactory">defaultFactory</a></b> ()</li><li><div class="fn" /><b><a href="qitemeditorfactory.html#setDefaultFactory">setDefaultFactory</a></b> (QItemEditorFactory)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QItemEditorFactory class provides widgets for editing item data in views and delegates.</p>
<p>When editing data in an item view, editors are created and displayed by a delegate. <a href="qitemdelegate.html">QItemDelegate</a>, which is the delegate by default installed on Qt's item views, uses a QItemEditorFactory to create editors for it. A default unique instance provided by QItemEditorFactory is used by all item delegates. If you set a new default factory with <a href="qitemeditorfactory.html#setDefaultFactory">setDefaultFactory</a>(), the new factory will be used by existing and new delegates.</p>
<p>A factory keeps a collection of <a href="qitemeditorcreatorbase.html">QItemEditorCreatorBase</a> instances, which are specialized editors that produce editors for one particular <a href="qvariant.html">QVariant</a> data type (All Qt models store their data in <a href="qvariant.html">QVariant</a>s).</p>
<a name="standard-editing-widgets" />
<h3>Standard Editing Widgets</h3>
<p>The standard factory implementation provides editors for a variety of data types. These are created whenever a delegate needs to provide an editor for data supplied by a model. The following table shows the relationship between types and the standard editors provided.</p>
<p><table align="center" border="0" cellpadding="2" cellspacing="1" class="generic">
<thead><tr class="qt-style" valign="top"><th>Type</th><th>Editor Widget</th></tr></thead>
<tr class="odd" valign="top"><td>bool</td><td><a href="qcombobox.html">QComboBox</a></td></tr>
<tr class="even" valign="top"><td>double</td><td><a href="qdoublespinbox.html">QDoubleSpinBox</a></td></tr>
<tr class="odd" valign="top"><td>int</td><td rowspan="2"><a href="qspinbox.html">QSpinBox</a></td></tr>
<tr class="even" valign="top"><td>unsigned int</td></tr>
<tr class="odd" valign="top"><td><a href="qdate.html">QDate</a></td><td><a href="qdateedit.html">QDateEdit</a></td></tr>
<tr class="even" valign="top"><td><a href="qdatetime.html">QDateTime</a></td><td><a href="qdatetimeedit.html">QDateTimeEdit</a></td></tr>
<tr class="odd" valign="top"><td><a href="qpixmap.html">QPixmap</a></td><td><a href="qlabel.html">QLabel</a></td></tr>
<tr class="even" valign="top"><td><a href="qstring.html">QString</a></td><td><a href="qlineedit.html">QLineEdit</a></td></tr>
<tr class="odd" valign="top"><td><a href="qtime.html">QTime</a></td><td><a href="qtimeedit.html">QTimeEdit</a></td></tr>
</table></p>
<p>Additional editors can be registered with the <a href="qitemeditorfactory.html#registerEditor">registerEditor</a>() function.</p>
<p>See also <a href="qitemdelegate.html">QItemDelegate</a>, <a href="model-view-programming.html">Model/View Programming</a>, and <a href="itemviews-coloreditorfactory.html">Color Editor Factory Example</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QItemEditorFactory" />QItemEditorFactory.__init__ (<i>self</i>)</h3><p>Constructs a new item editor factory.</p>
<a name="//apple_ref/cpp/instm/QItemEditorFactory/~QItemEditorFactory" />
<h3 class="fn"><a name="QItemEditorFactory-2" />QItemEditorFactory.__init__ (<i>self</i>, <a href="qitemeditorfactory.html">QItemEditorFactory</a>)</h3><h3 class="fn"><a name="createEditor" /><a href="qwidget.html">QWidget</a> QItemEditorFactory.createEditor (<i>self</i>, <a href="qvariant.html#Type-enum">QVariant.Type</a>, <a href="qwidget.html">QWidget</a>)</h3><p>The <i>QWidget</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Creates an editor widget with the given <i>parent</i> for the specified <i>type</i> of data, and returns it as a <a href="qwidget.html">QWidget</a>.</p>
<p>See also <a href="qitemeditorfactory.html#registerEditor">registerEditor</a>().</p>
<a name="//apple_ref/cpp/clm/QItemEditorFactory/defaultFactory" />
<h3 class="fn"><a name="defaultFactory" /><a href="qitemeditorfactory.html">QItemEditorFactory</a> QItemEditorFactory.defaultFactory ()</h3><p>Returns the default item editor factory.</p>
<p>See also <a href="qitemeditorfactory.html#setDefaultFactory">setDefaultFactory</a>().</p>
<a name="//apple_ref/cpp/instm/QItemEditorFactory/registerEditor" />
<h3 class="fn"><a name="registerEditor" />QItemEditorFactory.registerEditor (<i>self</i>, <a href="qvariant.html#Type-enum">QVariant.Type</a>, <a href="qitemeditorcreatorbase.html">QItemEditorCreatorBase</a>)</h3><p>The <i>QItemEditorCreatorBase</i> argument has it's ownership transferred to Qt.</p><p>Registers an item editor creator specified by <i>creator</i> for the given <i>type</i> of data.</p>
<p><b>Note:</b> The factory takes ownership of the item editor creator and will destroy it if a new creator for the same type is registered later.</p>
<p>See also <a href="qitemeditorfactory.html#createEditor">createEditor</a>().</p>
<a name="//apple_ref/cpp/clm/QItemEditorFactory/setDefaultFactory" />
<h3 class="fn"><a name="setDefaultFactory" />QItemEditorFactory.setDefaultFactory (<a href="qitemeditorfactory.html">QItemEditorFactory</a>)</h3><p>The <i>QItemEditorFactory</i> argument has it's ownership transferred to Qt.</p><p>Sets the default item editor factory to the given <i>factory</i>. Both new and existing delegates will use the new factory.</p>
<p>See also <a href="qitemeditorfactory.html#defaultFactory">defaultFactory</a>().</p>
<a name="//apple_ref/cpp/instm/QItemEditorFactory/valuePropertyName" />
<h3 class="fn"><a name="valuePropertyName" /><a href="qbytearray.html">QByteArray</a> QItemEditorFactory.valuePropertyName (<i>self</i>, <a href="qvariant.html#Type-enum">QVariant.Type</a>)</h3><p>Returns the property name used to access data for the given <i>type</i> of data.</p>
<p /><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.7.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt 4.6.2</td></tr></table></div></address></body></html>
|