<class name="QItemEditorFactory" doc="/** <p>The <a href="QItemEditorFactory.html#QItemEditorFactory()"><tt>QItemEditorFactory</tt></a> 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"><tt>QItemDelegate</tt></a>, which is the delegate by default installed on Qt's item views, uses a <a href="QItemEditorFactory.html#QItemEditorFactory()"><tt>QItemEditorFactory</tt></a> to create editors for it. A default unique instance provided by <a href="QItemEditorFactory.html#QItemEditorFactory()"><tt>QItemEditorFactory</tt></a> is used by all item delegates. If you set a new default factory with <a href="QItemEditorFactory.html#setDefaultFactory(com.trolltech.qt.gui.QItemEditorFactory)"><tt>setDefaultFactory</tt></a>, the new factory will be used by existing and new delegates.</p> <p>A factory keeps a collection of <a href="QItemEditorCreatorBase.html"><tt>QItemEditorCreatorBase</tt></a> instances, which are specialized editors that produce editors for one particular <a href="%2E%2E/porting4.html#qvariant"><tt>QVariant</tt></a> data type (All Qt models store their data in <a href="%2E%2E/porting4.html#qvariant"><tt>QVariant</tt></a>s).</p> <a name="standard-editing-widgets"></a> <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" cellpadding="2" cellspacing="1" border="0"> <thead><tr valign="top" class="qt-style"><th>Type</th><th>Editor Widget</th></tr></thead> <tr valign="top" class="odd"><td>bool</td><td><a href="QComboBox.html"><tt>QComboBox</tt></a></td></tr> <tr valign="top" class="even"><td>double</td><td><a href="QDoubleSpinBox.html"><tt>QDoubleSpinBox</tt></a></td></tr> <tr valign="top" class="odd"><td>int</td><td rowspan="2"><a href="QSpinBox.html"><tt>QSpinBox</tt></a></td></tr> <tr valign="top" class="even"><td>unsigned int</td></tr> <tr valign="top" class="odd"><td><a href="%2E%2E/core/QDate.html"><tt>QDate</tt></a></td><td><a href="QDateEdit.html"><tt>QDateEdit</tt></a></td></tr> <tr valign="top" class="even"><td><a href="%2E%2E/core/QDateTime.html"><tt>QDateTime</tt></a></td><td><a href="QDateTimeEdit.html"><tt>QDateTimeEdit</tt></a></td></tr> <tr valign="top" class="odd"><td><a href="QPixmap.html"><tt>QPixmap</tt></a></td><td><a href="QLabel.html"><tt>QLabel</tt></a></td></tr> <tr valign="top" class="even"><td><a href="%2E%2E/porting4.html#qstring"><tt>QString</tt></a></td><td><a href="QLineEdit.html"><tt>QLineEdit</tt></a></td></tr> <tr valign="top" class="odd"><td><a href="%2E%2E/core/QTime.html"><tt>QTime</tt></a></td><td><a href="QTimeEdit.html"><tt>QTimeEdit</tt></a></td></tr> </table></p> <p>Additional editors can be registered with the <a href="QItemEditorFactory.html#registerEditor(int, com.trolltech.qt.gui.QItemEditorCreatorBase)"><tt>registerEditor</tt></a> function.</p> @see <a href="QItemDelegate.html"><tt>QItemDelegate</tt></a> @see <a href="%2E%2E/model-view-programming.html">Model/View Programming</tt></a> @see Color Editor Factory Example</tt> */"> <method name="public QItemEditorFactory()" doc="/** <p>Constructs a new item editor factory.</p> */"/> <method name="public final void registerEditor(int type, com.trolltech.qt.gui.QItemEditorCreatorBase creator)" doc="/** <p>Registers an item editor creator specified by <tt>creator</tt> for the given <tt>type</tt> 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> @see <a href="QItemEditorFactory.html#createEditor(int, com.trolltech.qt.gui.QWidget)"><tt>createEditor</tt></a> */"/> <method name="public com.trolltech.qt.gui.QWidget createEditor(int type, com.trolltech.qt.gui.QWidget parent)" doc="/** <p>Creates an editor widget with the given <tt>parent</tt> for the specified <tt>type</tt> of data, and returns it as a <a href="QWidget.html"><tt>QWidget</tt></a>.</p> @see <a href="QItemEditorFactory.html#registerEditor(int, com.trolltech.qt.gui.QItemEditorCreatorBase)"><tt>registerEditor</tt></a> */"/> <method name="public com.trolltech.qt.core.QByteArray valuePropertyName(int type)" doc="/** <p>Returns the property name used to access data for the given <tt>type</tt> of data.</p> */"/> <method name="public native static com.trolltech.qt.gui.QItemEditorFactory defaultFactory()" doc="/** <p>Returns the default item editor factory.</p> @see <a href="QItemEditorFactory.html#setDefaultFactory(com.trolltech.qt.gui.QItemEditorFactory)"><tt>setDefaultFactory</tt></a> */"/> <method name="public static void setDefaultFactory(com.trolltech.qt.gui.QItemEditorFactory factory)" doc="/** <p>Sets the default item editor factory to the given <tt>factory</tt>. Both new and existing delegates will use the new factory.</p> @see <a href="QItemEditorFactory.html#defaultFactory()"><tt>defaultFactory</tt></a> */"/> </class>