itom  4.1.0
Property Class Reference

#include <Property.h>

Inheritance diagram for Property:
EnumProperty EnumProperty FlagsProperty ito::AutoIntervalProperty ito::QVector2DProperty ito::QVector3DProperty ito::QVector4DProperty Vec3fProperty

Public Member Functions

 Property (const QString &name=QString(), QObject *propertyObject=0, QObject *parent=0)
 
virtual QVariant value (int role=Qt::UserRole) const
 
virtual QString displayValue (int role=Qt::UserRole) const
 
virtual void setValue (const QVariant &value)
 
QObject * propertyObject ()
 
bool isRoot ()
 
bool isReadOnly ()
 
int row ()
 
QString editorHints ()
 
virtual void setEditorHints (const QString &hints)
 
QString info ()
 
virtual void setInfo (const QString &info)
 
bool enabled ()
 
virtual void setEnabled (bool enabled)
 
virtual QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option)
 
virtual QVariant editorData (QWidget *editor)
 
virtual bool setEditorData (QWidget *editor, const QVariant &data)
 
PropertyfindPropertyObject (QObject *propertyObject)
 
 Property (const QString &name=QString(), QObject *propertyObject=0, QObject *parent=0)
 
virtual QVariant value (int role=Qt::UserRole) const
 
virtual void setValue (const QVariant &value)
 
QObject * propertyObject ()
 
bool isRoot ()
 
bool isReadOnly ()
 
int row ()
 
QString editorHints ()
 
virtual void setEditorHints (const QString &hints)
 
virtual QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option)
 
virtual QVariant editorData (QWidget *editor)
 
virtual bool setEditorData (QWidget *editor, const QVariant &data)
 
PropertyfindPropertyObject (QObject *propertyObject)
 

Protected Attributes

QObject * m_propertyObject
 
QString m_hints
 
QString m_info
 
bool m_enabled
 

Private Slots

void setValue (double value)
 
void setValue (int value)
 
void setValue (QColor value)
 
void setValue (bool value)
 
void setValue (QFont value)
 
void setValue (QStringList value)
 
void setValue (double value)
 
void setValue (int value)
 
void setValue (QColor value)
 
void setValue (bool value)
 

Detailed Description

The Property class is the base class for all properties in the QPropertyEditor You can implement custom properties inherited from this class to further enhence the functionality of the QPropertyEditor

Constructor & Destructor Documentation

Property::Property ( const QString &  name = QString(),
QObject *  propertyObject = 0,
QObject *  parent = 0 
)

Constructor

Parameters
namethe name of the property within the propertyObject (will be used in the QPropertyEditorWidget view too)
propertyObjectthe object that contains the property
parentoptional parent object
Property::Property ( const QString &  name = QString(),
QObject *  propertyObject = 0,
QObject *  parent = 0 
)

Constructor

Parameters
namethe name of the property within the propertyObject (will be used in the QPropertyEditorWidget view too)
propertyObjectthe object that contains the property
parentoptional parent object

Member Function Documentation

virtual QWidget* Property::createEditor ( QWidget *  parent,
const QStyleOptionViewItem &  option 
)
virtual

Creates an editor for the data managed by this instance

Parameters
parentwidget the newly created editor widget will be child of
optioncurrently not used
Returns
QWidget* pointer to the editor widget

Reimplemented in EnumProperty, EnumProperty, and FlagsProperty.

QWidget * Property::createEditor ( QWidget *  parent,
const QStyleOptionViewItem &  option 
)
virtual

Creates an editor for the data managed by this instance

Parameters
parentwidget the newly created editor widget will be child of
optioncurrently not used
Returns
QWidget* pointer to the editor widget

Reimplemented in EnumProperty, EnumProperty, and FlagsProperty.

QString Property::displayValue ( int  role = Qt::UserRole) const
virtual

The value stored by this property

Returns
QString the data converted to a readable string
virtual QVariant Property::editorData ( QWidget *  editor)
virtual

Returns the data of the editor widget used to manipulate this instance

Returns
QVariant the data converted to a QVariant

Reimplemented in EnumProperty, EnumProperty, and FlagsProperty.

QVariant Property::editorData ( QWidget *  editor)
virtual

Returns the data of the editor widget used to manipulate this instance

Returns
QVariant the data converted to a QVariant

Reimplemented in EnumProperty, EnumProperty, and FlagsProperty.

QString Property::editorHints ( )
inline

returns optional settings for the editor widget that is used to manipulate the properties value

Returns
QString a string that contains property settings for the editor widget (e.g. "minimum=1.0;maximum=10.0;")
QString Property::editorHints ( )
inline

returns optional settings for the editor widget that is used to manipulate the properties value

Returns
QString a string that contains property settings for the editor widget (e.g. "minimum=1.0;maximum=10.0;")
Property* Property::findPropertyObject ( QObject *  propertyObject)

Tries to find the first property that manages the given propertyObject

Parameters
propertyObject
Returns
Property
Property * Property::findPropertyObject ( QObject *  propertyObject)

Tries to find the first property that manages the given propertyObject

Parameters
propertyObject
Returns
Property
bool Property::isReadOnly ( )

Flag if the property can be set

Returns
bool true if this property has no set method
bool Property::isReadOnly ( )

Flag if the property can be set

Returns
bool true if this property has no set method
bool Property::isRoot ( )
inline

Flag if property is used for indicating a group or really manages a property

Returns
bool true if this property is only used to display a category in the QPropertyEditorWidget
bool Property::isRoot ( )
inline

Flag if property is used for indicating a group or really manages a property

Returns
bool true if this property is only used to display a category in the QPropertyEditorWidget
QObject* Property::propertyObject ( )
inline

Returns the QObject which contains the property managed by this instance

Returns
QObject* pointer to the QObject that contains user defined properties
QObject* Property::propertyObject ( )
inline

Returns the QObject which contains the property managed by this instance

Returns
QObject* pointer to the QObject that contains user defined properties
int Property::row ( )
inline

Returns the row of this instance within the QPropertyModel

Returns
int row within the QPropertyModel
int Property::row ( )
inline

Returns the row of this instance within the QPropertyModel

Returns
int row within the QPropertyModel
virtual bool Property::setEditorData ( QWidget *  editor,
const QVariant &  data 
)
virtual

Changes the editor widget's data to a specific value

Parameters
editorthe editor widget
datathe data to set in the editor widget
Returns
bool true if editor widget was set to the given data successfully, false if the data can not be set in the editor (e.g. wrong datatype)

Reimplemented in EnumProperty, EnumProperty, and FlagsProperty.

bool Property::setEditorData ( QWidget *  editor,
const QVariant &  data 
)
virtual

Changes the editor widget's data to a specific value

Parameters
editorthe editor widget
datathe data to set in the editor widget
Returns
bool true if editor widget was set to the given data successfully, false if the data can not be set in the editor (e.g. wrong datatype)

Reimplemented in EnumProperty, EnumProperty, and FlagsProperty.

virtual void Property::setEditorHints ( const QString &  hints)
inlinevirtual

Sets properties for the editor widget that is used to manipulate the data value managed by this instance

Parameters
hintsa string containing property settings for the editor widget that manipulates this property

Reimplemented in ito::QVector3DProperty, ito::QVector4DProperty, ito::AutoIntervalProperty, ito::QVector2DProperty, and Vec3fProperty.

virtual void Property::setEditorHints ( const QString &  hints)
inlinevirtual

Sets properties for the editor widget that is used to manipulate the data value managed by this instance

Parameters
hintsa string containing property settings for the editor widget that manipulates this property

Reimplemented in ito::QVector3DProperty, ito::QVector4DProperty, ito::AutoIntervalProperty, ito::QVector2DProperty, and Vec3fProperty.

virtual void Property::setValue ( const QVariant &  value)
virtual

Sets the value stored by this property

Parameters
valuethe data converted to a QVariant

Reimplemented in ito::QVector3DProperty, ito::QVector4DProperty, ito::AutoIntervalProperty, ito::QVector2DProperty, and Vec3fProperty.

void Property::setValue ( const QVariant &  value)
virtual

Sets the value stored by this property

Parameters
valuethe data converted to a QVariant

Reimplemented in ito::QVector3DProperty, ito::QVector4DProperty, ito::AutoIntervalProperty, ito::QVector2DProperty, and Vec3fProperty.

void Property::setValue ( double  value)
privateslot

This slot is used to immediately set the properties when the editor widget's value of a double or float property has changed

Parameters
valuethe new value
void Property::setValue ( int  value)
privateslot

This slot is used to immediately set the properties when the editor widget's value of an integer property has changed

Parameters
valuethe new value
void Property::setValue ( double  value)
privateslot

This slot is used to immediately set the properties when the editor widget's value of a double or float property has changed

Parameters
valuethe new value
void Property::setValue ( int  value)
privateslot

This slot is used to immediately set the properties when the editor widget's value of an integer property has changed

Parameters
valuethe new value
virtual QVariant Property::value ( int  role = Qt::UserRole) const
virtual

The value stored by this property

Returns
QVariant the data converted to a QVariant

Reimplemented in ito::QVector3DProperty, ito::QVector4DProperty, ito::AutoIntervalProperty, EnumProperty, ito::QVector2DProperty, EnumProperty, FlagsProperty, and Vec3fProperty.

QVariant Property::value ( int  role = Qt::UserRole) const
virtual

The value stored by this property

Returns
QVariant the data converted to a QVariant

Reimplemented in ito::QVector3DProperty, ito::QVector4DProperty, ito::AutoIntervalProperty, EnumProperty, ito::QVector2DProperty, EnumProperty, FlagsProperty, and Vec3fProperty.


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