Developpez.com - Qt
X

Choisissez d'abord la catégorieensuite la rubrique :

Viadeo Twitter Google Bookmarks ! Facebook Digg del.icio.us MySpace Yahoo MyWeb Blinklist Netvouz Reddit Simpy StumbleUpon Bookmarks Windows Live Favorites 
Logo Documentation Qt ·  Page d'accueil  ·  Toutes les classes  ·  Toutes les fonctions  ·  Vues d'ensemble  · 

QStandardItemEditorCreator Class Reference

The QStandardItemEditorCreator class provides the possibility to register widgets without having to subclass QItemEditorCreatorBase. More...

 #include <QStandardItemEditorCreator>

Inherits: QItemEditorCreatorBase.

This class was introduced in Qt 4.2.

Public Functions

QStandardItemEditorCreator ()

Reimplemented Public Functions

virtual QWidget * createWidget ( QWidget * parent ) const
virtual QByteArray valuePropertyName () const

Detailed Description

The QStandardItemEditorCreator class provides the possibility to register widgets without having to subclass QItemEditorCreatorBase.

This convenience template class makes it possible to register widgets without having to subclass QItemEditorCreatorBase.

Example:

 QItemEditorFactory *editorFactory = new QItemEditorFactory;
 QItemEditorCreatorBase *creator = new QStandardItemEditorCreator<MyFancyDateTimeEdit>();
 editorFactory->registerEditor(QVariant::DateType, creator);

Setting the editorFactory created above in an item delegate via QItemDelegate::setItemEditorFactory() makes sure that all values of type QVariant::DateTime will be edited in MyFancyDateTimeEdit.

The editor must provide a user property that will contain the editing data. The property is used by QItemDelegates to set and retrieve the data (using Qt's meta-object system). You set the user property with the USER keyword:

 Q_PROPERTY(QColor color READ color WRITE setColor USER true)

See also QItemEditorCreatorBase, QItemEditorCreator, QItemEditorFactory, QItemDelegate, and Color Editor Factory Example.

Member Function Documentation

QStandardItemEditorCreator::QStandardItemEditorCreator ()

Constructs an editor creator object.

QWidget * QStandardItemEditorCreator::createWidget ( QWidget * parent ) const [virtual]

Reimplemented from QItemEditorCreatorBase::createWidget().

QByteArray QStandardItemEditorCreator::valuePropertyName () const [virtual]

Reimplemented from QItemEditorCreatorBase::valuePropertyName().

Responsable bénévole de la rubrique Qt : Thibaut Cuvelier -