Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > 8e6051afcdb111a0317a58fb64c2abf5 > files > 4357

qt4-doc-4.6.3-0.2mdv2010.2.i586.rpm

<?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">
<!-- qitemeditorfactory.cpp -->
<head>
  <title>Qt 4.6: QItemEditorCreatorBase Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<a name="//apple_ref/cpp/cl//QItemEditorCreatorBase"></a>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><h1 class="title">QItemEditorCreatorBase Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span>
</h1>
<p>The QItemEditorCreatorBase class provides an abstract base class that must be subclassed when implementing new item editor creators. <a href="#details">More...</a></p>
<pre> #include &lt;QItemEditorCreatorBase&gt;</pre><p>Inherited by <a href="qitemeditorcreator.html">QItemEditorCreator</a> and <a href="qstandarditemeditorcreator.html">QStandardItemEditorCreator</a>.</p>
<p>This class was introduced in Qt 4.2.</p>
<ul>
<li><a href="qitemeditorcreatorbase-members.html">List of all members, including inherited members</a></li>
</ul>
<hr />
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td class="memItemLeft" align="right" valign="top">virtual </td><td class="memItemRight" valign="bottom"><b><a href="qitemeditorcreatorbase.html#dtor.QItemEditorCreatorBase">~QItemEditorCreatorBase</a></b> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QWidget * </td><td class="memItemRight" valign="bottom"><b><a href="qitemeditorcreatorbase.html#createWidget">createWidget</a></b> ( QWidget * <i>parent</i> ) const = 0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual QByteArray </td><td class="memItemRight" valign="bottom"><b><a href="qitemeditorcreatorbase.html#valuePropertyName">valuePropertyName</a></b> () const = 0</td></tr>
</table>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QItemEditorCreatorBase class provides an abstract base class that must be subclassed when implementing new item editor creators.</p>
<p>QItemEditorCreatorBase objects are specialized widget factories that provide editor widgets for one particular <a href="qvariant.html">QVariant</a> data type. They are used by <a href="qitemeditorfactory.html">QItemEditorFactory</a> to create editors for <a href="qitemdelegate.html">QItemDelegate</a>s. Creator bases must be registered with <a href="qitemeditorfactory.html#registerEditor">QItemEditorFactory::registerEditor</a>().</p>
<p>An editor should provide a user property for the data it edits. QItemDelagates can then access the property using Qt's <a href="metaobjects.html">meta-object system</a> to set and retrieve the editing data. A property is set as the user property with the USER keyword:</p>
<pre> Q_PROPERTY(QColor color READ color WRITE setColor USER true)</pre>
<p>If the editor does not provide a user property, it must return the name of the property from <a href="qitemeditorcreatorbase.html#valuePropertyName">valuePropertyName</a>(); delegates will then use the name to access the property. If a user property exists, item delegates will not call <a href="qitemeditorcreatorbase.html#valuePropertyName">valuePropertyName</a>().</p>
<p><a href="qstandarditemeditorcreator.html">QStandardItemEditorCreator</a> is a convenience template class that can be used to register widgets without the need to subclass QItemEditorCreatorBase.</p>
<p>See also <a href="qstandarditemeditorcreator.html">QStandardItemEditorCreator</a>, <a href="qitemeditorfactory.html">QItemEditorFactory</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>Member Function Documentation</h2>
<a name="//apple_ref/cpp/instm/QItemEditorCreatorBase/~QItemEditorCreatorBase"></a>
<h3 class="fn"><a name="dtor.QItemEditorCreatorBase"></a>QItemEditorCreatorBase::~QItemEditorCreatorBase ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Destroys the editor creator object.</p>
<a name="//apple_ref/cpp/instm/QItemEditorCreatorBase/createWidget"></a>
<h3 class="fn"><a name="createWidget"></a><a href="qwidget.html">QWidget</a> * QItemEditorCreatorBase::createWidget ( <a href="qwidget.html">QWidget</a> * <i>parent</i> ) const&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Returns an editor widget with the given <i>parent</i>.</p>
<p>When implementing this function in subclasses of this class, you must construct and return new editor widgets with the parent widget specified.</p>
<a name="//apple_ref/cpp/instm/QItemEditorCreatorBase/valuePropertyName"></a>
<h3 class="fn"><a name="valuePropertyName"></a><a href="qbytearray.html">QByteArray</a> QItemEditorCreatorBase::valuePropertyName () const&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Returns the name of the property used to get and set values in the creator's editor widgets.</p>
<p>When implementing this function in subclasses, you must ensure that the editor widget's property specified by this function can accept the type the creator is registered for. For example, a creator which constructs <a href="qcheckbox.html">QCheckBox</a> widgets to edit boolean values would return the <a href="qabstractbutton.html#checkable-prop">checkable</a> property name from this function, and must be registered in the item editor factory for the <a href="qvariant.html#Type-enum">QVariant::Bool</a> type.</p>
<p>Note: Since Qt 4.2 the item delegates query the user property of widgets, and only call this function if the widget has no user property. You can override this behavior by reimplementing <a href="qabstractitemdelegate.html#setModelData">QAbstractItemDelegate::setModelData</a>() and <a href="qabstractitemdelegate.html#setEditorData">QAbstractItemDelegate::setEditorData</a>().</p>
<p>See also <a href="qmetaobject.html#userProperty">QMetaObject::userProperty</a>() and <a href="qitemeditorfactory.html#registerEditor">QItemEditorFactory::registerEditor</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="40%" align="left">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="40%" align="right"><div align="right">Qt 4.6.3</div></td>
</tr></table></div></address></body>
</html>