Qt 4.8
Public Functions | Properties | List of all members
QStandardItemEditorCreator< T > Class Template Reference

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

#include <qitemeditorfactory.h>

Inheritance diagram for QStandardItemEditorCreator< T >:
QItemEditorCreatorBase

Public Functions

QWidgetcreateWidget (QWidget *parent) const
 Reimplemented Function More...
 
 QStandardItemEditorCreator ()
 Constructs an editor creator object. More...
 
QByteArray valuePropertyName () const
 Reimplemented Function More...
 
- Public Functions inherited from QItemEditorCreatorBase
virtual ~QItemEditorCreatorBase ()
 Destroys the editor creator object. More...
 

Properties

QByteArray propertyName
 

Detailed Description

template<class T>
class QStandardItemEditorCreator< T >

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

Since
4.2

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

Example:

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 QItemDelegate to set and retrieve the data (using Qt's Meta-Object System{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, {Color Editor Factory Example}

Definition at line 82 of file qitemeditorfactory.h.

Constructors and Destructors

◆ QStandardItemEditorCreator()

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

Constructs an editor creator object.

Definition at line 85 of file qitemeditorfactory.h.

86  : propertyName(T::staticMetaObject.userProperty().name())
87  {}
const char * name

Functions

◆ createWidget()

template<class T >
QWidget * QStandardItemEditorCreator< T >::createWidget ( QWidget parent) const
inlinevirtual

Reimplemented Function

Implements QItemEditorCreatorBase.

Definition at line 88 of file qitemeditorfactory.h.

88 { return new T(parent); }

◆ valuePropertyName()

template<class T >
QByteArray QStandardItemEditorCreator< T >::valuePropertyName ( ) const
inlinevirtual

Reimplemented Function

Implements QItemEditorCreatorBase.

Definition at line 89 of file qitemeditorfactory.h.

89 { return propertyName; }

Properties

◆ propertyName

template<class T >
QByteArray QStandardItemEditorCreator< T >::propertyName
private

Definition at line 92 of file qitemeditorfactory.h.


The documentation for this class was generated from the following files: