Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QItemEditorCreator< T > Class Template Reference

The QItemEditorCreator class makes it possible to create item editor creator bases without subclassing QItemEditorCreatorBase. More...

#include <qitemeditorfactory.h>

+ Inheritance diagram for QItemEditorCreator< T >:
+ Collaboration diagram for QItemEditorCreator< T >:

Public Member Functions

 QItemEditorCreator (const QByteArray &valuePropertyName)
 Constructs an editor creator object using valuePropertyName as the name of the property to be used for editing.
 
QWidgetcreateWidget (QWidget *parent) const override
 \reimp
 
QByteArray valuePropertyName () const override
 \reimp
 
- Public Member Functions inherited from QItemEditorCreatorBase
virtual ~QItemEditorCreatorBase ()
 Destroys the editor creator object.
 

Detailed Description

template<class T>
class QItemEditorCreator< T >

The QItemEditorCreator class makes it possible to create item editor creator bases without subclassing QItemEditorCreatorBase.

Since
4.2

\inmodule QtWidgets

QItemEditorCreator is a convenience template class. It uses the template class to create editors for QItemEditorFactory. This way, it is not necessary to subclass QItemEditorCreatorBase.

QItemEditorCreator<MyEditor> *itemCreator =
new QItemEditorCreator<MyEditor>("myProperty");

The constructor takes the name of the property that contains the editing data. QStyledItemDelegate can then access the property by name when it sets and retrieves editing data. Only use this class if your editor does not define a user property (using the USER keyword in the Q_PROPERTY macro). If the widget has a user property, you should use QStandardItemEditorCreator instead.

See also
QItemEditorCreatorBase, QStandardItemEditorCreator, QItemEditorFactory

Definition at line 29 of file qitemeditorfactory.h.

Constructor & Destructor Documentation

◆ QItemEditorCreator()

template<class T >
Q_INLINE_TEMPLATE QItemEditorCreator< T >::QItemEditorCreator ( const QByteArray & valuePropertyName)
inlineexplicit

Constructs an editor creator object using valuePropertyName as the name of the property to be used for editing.

The property name is used by QStyledItemDelegate when setting and getting editor data.

Note that the valuePropertyName is only used if the editor widget does not have a user property defined.

Definition at line 56 of file qitemeditorfactory.h.

Member Function Documentation

◆ createWidget()

template<class T >
template< class T > QWidget * QItemEditorCreator< T >::createWidget ( QWidget * parent) const
inlineoverridevirtual

\reimp

Implements QItemEditorCreatorBase.

Definition at line 33 of file qitemeditorfactory.h.

◆ valuePropertyName()

template<class T >
template< class T > QByteArray QItemEditorCreator< T >::valuePropertyName ( ) const
inlineoverridevirtual

\reimp

Implements QItemEditorCreatorBase.

Definition at line 34 of file qitemeditorfactory.h.


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