Public Member Functions

QxtItemEditorCreatorBase< T > Class Template Reference
[QxtGui]

Provides means for introducing default property values to initialize an editor with. More...

#include <qxtitemeditorcreatorbase.h>

Inheritance diagram for QxtItemEditorCreatorBase< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

QVariant defaultPropertyValue (const QByteArray &property) const
void setDefaultPropertyValue (const QByteArray &property, const QVariant &value)
QWidget * initializeEditor (QWidget *editor) const

Detailed Description

template<class T>
class QxtItemEditorCreatorBase< T >

Provides means for introducing default property values to initialize an editor with.

The QxtItemEditorCreator class provides the possibility to set default property values which are applied when initializing given editor.

Definition at line 44 of file qxtitemeditorcreatorbase.h.


Member Function Documentation

template<class T >
QVariant QxtItemEditorCreatorBase< T >::defaultPropertyValue ( const QByteArray &  property ) const [inline]

Returns the default value of property.

Definition at line 50 of file qxtitemeditorcreatorbase.h.

    {
        return properties.value(property);
    }
template<class T >
Q_INLINE_TEMPLATE QWidget * QxtItemEditorCreatorBase< T >::initializeEditor ( QWidget *  editor ) const [inline]

Initializes editor with introduced default property values.

Definition at line 73 of file qxtitemeditorcreatorbase.h.

Referenced by QxtStandardItemEditorCreator< T >::createWidget(), and QxtItemEditorCreator< T >::createWidget().

{
    QHashIterator<QByteArray, QVariant> i(properties);
    while (i.hasNext())
    {
        i.next();
        editor->setProperty(i.key(), i.value());
    }
    return editor;
}
template<class T >
void QxtItemEditorCreatorBase< T >::setDefaultPropertyValue ( const QByteArray &  property,
const QVariant &  value 
) [inline]

Sets the default value for property.

Definition at line 58 of file qxtitemeditorcreatorbase.h.

    {
        properties.insert(property, value);
    }

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines