Provides means for introducing default property values to initialize an editor with. More...
#include <qxtitemeditorcreatorbase.h>
Public Member Functions | |
QVariant | defaultPropertyValue (const QByteArray &property) const |
void | setDefaultPropertyValue (const QByteArray &property, const QVariant &value) |
QWidget * | initializeEditor (QWidget *editor) const |
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.
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);
}
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; }
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); }