CopperSpice API  1.7.2
QStandardItemEditorCreator< T > Class Template Reference

Provides the possibility to register widgets without having to subclass QItemEditorCreatorBase. More...

Inheritance diagram for QStandardItemEditorCreator< T >:
QItemEditorCreatorBase

Public Methods

 QStandardItemEditorCreator ()
 
QWidgetcreateWidget (QWidget *parent) const override
 
QString valuePropertyName () const override
 
- Public Methods inherited from QItemEditorCreatorBase
virtual ~QItemEditorCreatorBase ()
 

Detailed Description

template<class T>
class QStandardItemEditorCreator< T >

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:

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 the CopperSpice Meta Object System. Set the user property as follows:

CS_PROPERTY_READ(color, read)
CS_PROPERTY_WRITE(color, setColor)
CS_PROPERTY_USER(color, true)
See also
QItemEditorCreatorBase, QItemEditorCreator, QItemEditorFactory, QItemDelegate

Constructor & Destructor Documentation

template<class T >
QStandardItemEditorCreator< T >::QStandardItemEditorCreator ( )
inline

Constructs an editor creator object.

Method Documentation

template<class T >
QWidget * QStandardItemEditorCreator< T >::createWidget ( QWidget parent) const
inlineoverridevirtual
template<class T >
QString QStandardItemEditorCreator< T >::valuePropertyName ( ) const
inlineoverridevirtual