Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > d5e62c01ae8d1e579463c6a871dd44bf > files > 3899

qtbase5-doc-5.12.6-2.mga7.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qitemeditorfactory.cpp -->
  <title>QItemEditorCreatorBase Class | Qt Widgets 5.12.6</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td >Qt 5.12</td><td ><a href="qtwidgets-index.html">Qt Widgets</a></td><td ><a href="qtwidgets-module.html">C++ Classes</a></td><td >QItemEditorCreatorBase</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtwidgets-index.html">Qt 5.12.6 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QItemEditorCreatorBase Class</h1>
<!-- $$$QItemEditorCreatorBase-brief -->
<p>The <a href="qitemeditorcreatorbase.html">QItemEditorCreatorBase</a> class provides an abstract base class that must be subclassed when implementing new item editor creators. <a href="#details">More...</a></p>
<!-- @@@QItemEditorCreatorBase -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QItemEditorCreatorBase&gt;</span>
</td></tr><tr><td class="memItemLeft rightAlign topAlign"> qmake:</td><td class="memItemRight bottomAlign"> QT += widgets</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Since:</td><td class="memItemRight bottomAlign">  Qt 4.2</td></tr><tr><td class="memItemLeft rightAlign topAlign"> Inherited By:</td><td class="memItemRight bottomAlign"> <p><a href="qitemeditorcreator.html">QItemEditorCreator</a> and <a href="qstandarditemeditorcreator.html">QStandardItemEditorCreator</a></p>
</td></tr></table></div><ul>
<li><a href="qitemeditorcreatorbase-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-functions"></a>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual </td><td class="memItemRight bottomAlign"><b><a href="qitemeditorcreatorbase.html#dtor.QItemEditorCreatorBase">~QItemEditorCreatorBase</a></b>()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QWidget *</td><td class="memItemRight bottomAlign"><b><a href="qitemeditorcreatorbase.html#createWidget">createWidget</a></b>(QWidget *<i>parent</i>) const = 0</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QByteArray </td><td class="memItemRight bottomAlign"><b><a href="qitemeditorcreatorbase.html#valuePropertyName">valuePropertyName</a></b>() const = 0</td></tr>
</table></div>
<a name="details"></a>
<!-- $$$QItemEditorCreatorBase-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>The <a href="qitemeditorcreatorbase.html">QItemEditorCreatorBase</a> class provides an abstract base class that must be subclassed when implementing new item editor creators.</p>
<p><a href="qitemeditorcreatorbase.html">QItemEditorCreatorBase</a> objects are specialized widget factories that provide editor widgets for one particular <a href="../qtcore/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="../qtcore/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 class="cpp">

  Q_PROPERTY(<span class="type"><a href="../qtgui/qcolor.html">QColor</a></span> color READ color WRITE setColor USER <span class="keyword">true</span>)

</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 <a href="qitemeditorcreatorbase.html">QItemEditorCreatorBase</a>.</p>
</div>
<p><b>See also </b><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="qtwidgets-itemviews-coloreditorfactory-example.html">Color Editor Factory Example</a>.</p>
<!-- @@@QItemEditorCreatorBase -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$~QItemEditorCreatorBase[overload1]$$$~QItemEditorCreatorBase -->
<h3 class="fn" id="dtor.QItemEditorCreatorBase"><a name="dtor.QItemEditorCreatorBase"></a><code>[virtual] </code>QItemEditorCreatorBase::<span class="name">~QItemEditorCreatorBase</span>()</h3>
<p>Destroys the editor creator object.</p>
<!-- @@@~QItemEditorCreatorBase -->
<!-- $$$createWidget[overload1]$$$createWidgetQWidget* -->
<h3 class="fn" id="createWidget"><a name="createWidget"></a><code>[pure virtual] </code><span class="type"><a href="qwidget.html">QWidget</a></span> *QItemEditorCreatorBase::<span class="name">createWidget</span>(<span class="type"><a href="qwidget.html">QWidget</a></span> *<i>parent</i>) const</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>
<!-- @@@createWidget -->
<!-- $$$valuePropertyName[overload1]$$$valuePropertyName -->
<h3 class="fn" id="valuePropertyName"><a name="valuePropertyName"></a><code>[pure virtual] </code><span class="type"><a href="../qtcore/qbytearray.html">QByteArray</a></span> QItemEditorCreatorBase::<span class="name">valuePropertyName</span>() const</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 QVariant::Bool 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><b>See also </b><a href="../qtcore/qmetaobject.html#userProperty">QMetaObject::userProperty</a>() and <a href="qitemeditorfactory.html#registerEditor">QItemEditorFactory::registerEditor</a>().</p>
<!-- @@@valuePropertyName -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>